summaryrefslogtreecommitdiff
path: root/include/chillAST/chillAST_def.hh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2016-09-23 10:59:54 -0600
committerTuowen Zhao <ztuowen@gmail.com>2016-09-23 10:59:54 -0600
commit699861922d5349ffa98b518f34016b2be2ca368d (patch)
treeb1172a41c89b382487772ef05c8a5ce70c068fa0 /include/chillAST/chillAST_def.hh
parent16f097d5548e9b31ab4b0dc343afeb680b361e28 (diff)
downloadchill-699861922d5349ffa98b518f34016b2be2ca368d.tar.gz
chill-699861922d5349ffa98b518f34016b2be2ca368d.tar.bz2
chill-699861922d5349ffa98b518f34016b2be2ca368d.zip
more changes
Diffstat (limited to 'include/chillAST/chillAST_def.hh')
-rw-r--r--include/chillAST/chillAST_def.hh90
1 files changed, 61 insertions, 29 deletions
diff --git a/include/chillAST/chillAST_def.hh b/include/chillAST/chillAST_def.hh
index 318b51b..0e5832e 100644
--- a/include/chillAST/chillAST_def.hh
+++ b/include/chillAST/chillAST_def.hh
@@ -19,7 +19,7 @@
#define CHILLAST_NODETYPE_TRANSLATIONUNIT CHILLAST_NODETYPE_SOURCEFILE
enum CHILL_ASTNODE_TYPE {
- CHILLAST_NODETYPE_UNKNOWN=0,
+ CHILLAST_NODETYPE_UNKNOWN = 0,
CHILLAST_NODETYPE_SOURCEFILE,
CHILLAST_NODETYPE_TYPEDEFDECL,
CHILLAST_NODETYPE_VARDECL,
@@ -58,26 +58,26 @@ enum CHILL_ASTNODE_TYPE {
CHILLAST_NODETYPE_CUDASYNCTHREADS,
CHILLAST_NODETYPE_NULL // explicit non-statement
// TODO
-
-} ;
-enum CHILL_FUNCTION_TYPE {
+};
+
+enum CHILL_FUNCTION_TYPE {
CHILL_FUNCTION_CPU = 0,
CHILL_FUNCTION_GPU
};
-
-enum CHILL_MEMBER_EXP_TYPE {
+
+enum CHILL_MEMBER_EXP_TYPE {
CHILL_MEMBER_EXP_DOT = 0,
CHILL_MEMBER_EXP_ARROW
};
-
-enum CHILL_PREPROCESSING_TYPE {
+
+enum CHILL_PREPROCESSING_TYPE {
CHILL_PREPROCESSING_TYPEUNKNOWN = 0,
CHILL_PREPROCESSING_COMMENT,
CHILL_PREPROCESSING_POUNDDEFINE,
CHILL_PREPROCESSING_POUNDINCLUDE,
CHILL_PREPROCESSING_PRAGMA // unused so far
-};
+};
enum CHILL_PREPROCESSING_POSITION { // when tied to another statement
CHILL_PREPROCESSING_POSITIONUNKNOWN = 0,
@@ -87,14 +87,18 @@ enum CHILL_PREPROCESSING_POSITION { // when tied to another statement
CHILL_PREPROCESSING_IMMEDIATELYBEFORE // on same line
};
-char *parseUnderlyingType( char *sometype );
-char *parseArrayParts( char *sometype );
-bool isRestrict( const char *sometype );
-char *splitTypeInfo( char *underlyingtype );
-char *ulhack( char *brackets ); // change "1024UL" to "1024"
-char *restricthack( char *typeinfo ); // remove __restrict__ , MODIFIES the argument!
+char *parseUnderlyingType(char *sometype);
+
+char *parseArrayParts(char *sometype);
+
+bool isRestrict(const char *sometype);
+
+char *splitTypeInfo(char *underlyingtype);
+
+char *ulhack(char *brackets); // change "1024UL" to "1024"
+char *restricthack(char *typeinfo); // remove __restrict__ , MODIFIES the argument!
-extern const char* Chill_AST_Node_Names[]; // WARNING MUST BE KEPT IN SYNC WITH BELOW LIST
+extern const char *Chill_AST_Node_Names[]; // WARNING MUST BE KEPT IN SYNC WITH BELOW LIST
// fwd declarations
class chillAST_node; // the generic node. specific types derive from this
@@ -102,60 +106,88 @@ class chillAST_NULL; // empty
class chillAST_SourceFile; // ast for an entire source file (translationunit)
class chillAST_TypedefDecl;
+
class chillAST_VarDecl;
+
//class chillAST_ParmVarDecl;
class chillAST_FunctionDecl;
+
class chillAST_RecordDecl; // structs and unions (and classes?)
class chillAST_MacroDefinition;
+
class chillAST_CompoundStmt; // just a bunch of other statements
class chillAST_ForStmt; // AKA a LOOP
class chillAST_TernaryOperator;
+
class chillAST_BinaryOperator;
+
class chillAST_ArraySubscriptExpr;
+
class chillAST_MemberExpr;
+
class chillAST_DeclRefExpr;
+
class chillAST_IntegerLiteral;
+
class chillAST_FloatingLiteral;
+
class chillAST_UnaryOperator;
+
class chillAST_ImplicitCastExpr;
+
class chillAST_CStyleCastExpr;
+
class chillAST_CStyleAddressOf;
+
class chillAST_ReturnStmt;
+
class chillAST_CallExpr;
+
class chillAST_ParenExpr;
+
class chillAST_Sizeof;
+
class chillAST_Malloc;
+
class chillAST_Free;
+
class chillAST_NoOp;
+
class chillAST_CudaMalloc;
+
class chillAST_CudaFree;
+
class chillAST_CudaMemcpy;
+
class chillAST_CudaKernelCall;
+
class chillAST_CudaSyncthreads;
+
class chillAST_Preprocessing;
-typedef std::vector<chillAST_VarDecl *> chillAST_SymbolTable; // typedef
+typedef std::vector<chillAST_VarDecl *> chillAST_SymbolTable; // typedef
typedef std::vector<chillAST_TypedefDecl *> chillAST_TypedefTable; // typedef
-bool symbolTableHasVariableNamed( chillAST_SymbolTable *table, const char *name ); // fwd decl
-chillAST_VarDecl *symbolTableFindVariableNamed( chillAST_SymbolTable *table, const char *name ); // fwd decl TODO too many similar named functions
+bool symbolTableHasVariableNamed(chillAST_SymbolTable *table, const char *name); // fwd decl
+chillAST_VarDecl *symbolTableFindVariableNamed(chillAST_SymbolTable *table,
+ const char *name); // fwd decl TODO too many similar named functions
-void printSymbolTable( chillAST_SymbolTable *st ); // fwd decl
-void printSymbolTableMoreInfo( chillAST_SymbolTable *st ); // fwd decl
+void printSymbolTable(chillAST_SymbolTable *st); // fwd decl
+void printSymbolTableMoreInfo(chillAST_SymbolTable *st); // fwd decl
-chillAST_node *lessthanmacro( chillAST_node *left, chillAST_node *right); // fwd declaration
-chillAST_SymbolTable *addSymbolToTable( chillAST_SymbolTable *st, chillAST_VarDecl *vd ); // fwd decl
-chillAST_TypedefTable *addTypedefToTable( chillAST_TypedefTable *tt, chillAST_TypedefDecl *td ); // fwd decl
+chillAST_node *lessthanmacro(chillAST_node *left, chillAST_node *right); // fwd declaration
+chillAST_SymbolTable *addSymbolToTable(chillAST_SymbolTable *st, chillAST_VarDecl *vd); // fwd decl
+chillAST_TypedefTable *addTypedefToTable(chillAST_TypedefTable *tt, chillAST_TypedefDecl *td); // fwd decl
-bool streq( const char *a, const char *b); // fwd decl
-void chillindent( int i, FILE *fp ); // fwd declaration
-void insertNewDeclAtLocationOfOldIfNeeded( chillAST_VarDecl *newdecl, chillAST_VarDecl *olddecl);
+bool streq(const char *a, const char *b); // fwd decl
+void chillindent(int i, FILE *fp); // fwd declaration
+void insertNewDeclAtLocationOfOldIfNeeded(chillAST_VarDecl *newdecl, chillAST_VarDecl *olddecl);
-chillAST_DeclRefExpr *buildDeclRefExpr( chillAST_VarDecl *);
+chillAST_DeclRefExpr *buildDeclRefExpr(chillAST_VarDecl *);
-chillAST_FunctionDecl *findFunctionDecl( chillAST_node *node, const char *procname);
+chillAST_FunctionDecl *findFunctionDecl(chillAST_node *node, const char *procname);
#endif