Collaboration diagram for High level AST builders:
|
Building AST trees using raw SgNode constructors is tedious and error-prone. It becomes even more difficult with the presence of symbol tables. This namespace contains major AST node builders on top of the constructors to take care of symbol tables, various edges to scope, parent and so on.
Builders for expressions | |
| handle side effects of parent pointers, Sg_File_Info, lvalue etc. Expressions are usually built using bottomup approach, i.e. buiding operands first, then the expression operating on the operands. It is also possible to build expressions with NULL operands or empty values first, then set them afterwards.
| |
| #define | BUILD_UNARY_PROTO(suffix) |
| Template function to build a unary expression of type T with advanced information specified such as parenthesis and file info. Instantiated functions include:buildAddressOfOp(),buildBitComplementOp(),buildBitComplementOp(),buildMinusOp(),buildNotOp(),buildPointerDerefExp(),buildUnaryAddOp(),buildMinusMinusOp(),buildPlusPlusOp(). | |
| #define | BUILD_BINARY_PROTO(suffix) |
| Template function to build a binary expression of type T,with extra information for parenthesis and file info, Instantiated functions include: buildAddOp(), buildAndAssignOp(), buildAndOp(), buildArrowExp(),buildArrowStarOp(), buildAssignOp(),buildBitAndOp(),buildBitOrOp(),buildBitXorOp(),buildCommaOpExp(), buildConcatenationOp(),buildDivAssignOp(), buildDivideOp(),buildDotExp(),buildEqualityOp(),buildExponentiationOp(),buildGreaterOrEqualOp(),buildGreaterThanOp(),buildIntegerDivideOp(),buildIorAssignOp(),buildLessOrEqualOp(),buildLessThanOp(),buildLshiftAssignOp(),buildLshiftOp(),buildMinusAssignOp(),buildModAssignOp(),buildModOp(),buildMultAssignOp(),buildMultiplyOp(),buildNotEqualOp(),buildOrOp(),buildPlusAssignOp(),buildPntrArrRefExp(),buildRshiftAssignOp(),buildRshiftOp(),buildScopeOp(),buildSubtractOp()buildXorAssignOp(). | |
| SgNullExpression * | SageBuilder::buildNullExpression () |
| Build a null expression, set file info as the default one. | |
| SgNullExpression * | SageBuilder::buildNullExpression_nfi () |
| No file info version of buildNullExpression(). File info is to be set later on. | |
| SgBoolValExp * | SageBuilder::buildBoolValExp (int value=0) |
| Build a bool value expression, the name convention of SgBoolValExp is little different from others for some unknown reason. | |
| SgBoolValExp * | SageBuilder::buildBoolValExp (bool value=0) |
| SgBoolValExp * | SageBuilder::buildBoolValExp_nfi (int value) |
| SgCharVal * | SageBuilder::buildCharVal (char value=0) |
| SgCharVal * | SageBuilder::buildCharVal_nfi (char value, const std::string &str) |
| SgWcharVal * | SageBuilder::buildWcharVal (wchar_t value=0) |
| SgWcharVal * | SageBuilder::buildWcharVal_nfi (wchar_t value, const std::string &str) |
| SgComplexVal * | SageBuilder::buildComplexVal (long double real_value=0.0, long double imaginary_value=0.0) |
| SgComplexVal * | SageBuilder::buildComplexVal (SgValueExp *real_value, SgValueExp *imaginary_value) |
| SgComplexVal * | SageBuilder::buildComplexVal_nfi (SgValueExp *real_value, SgValueExp *imaginary_value, const std::string &str) |
| SgComplexVal * | SageBuilder::buildImaginaryVal (long double imaginary_value) |
| SgComplexVal * | SageBuilder::buildImaginaryVal (SgValueExp *imaginary_value) |
| SgComplexVal * | SageBuilder::buildImaginaryVal_nfi (SgValueExp *imaginary_value, const std::string &str) |
| SgDoubleVal * | SageBuilder::buildDoubleVal (double value=0.0) |
| Build a double value expression. | |
| SgDoubleVal * | SageBuilder::buildDoubleVal_nfi (double value, const std::string &str) |
| SgFloatVal * | SageBuilder::buildFloatVal (float value=0.0) |
| SgFloatVal * | SageBuilder::buildFloatVal_nfi (float value, const std::string &str) |
| SgIntVal * | SageBuilder::buildIntVal (int value=0) |
| Build an integer value expression. | |
| SgIntVal * | SageBuilder::buildIntValHex (int value=0) |
| SgIntVal * | SageBuilder::buildIntVal_nfi (int value, const std::string &str) |
| SgLongIntVal * | SageBuilder::buildLongIntVal (long value=0) |
| Build a long integer value expression. | |
| SgLongIntVal * | SageBuilder::buildLongIntValHex (long value=0) |
| SgLongIntVal * | SageBuilder::buildLongIntVal_nfi (long value, const std::string &str) |
| SgLongLongIntVal * | SageBuilder::buildLongLongIntVal (long long value=0) |
| Build a long long integer value expression. | |
| SgLongLongIntVal * | SageBuilder::buildLongLongIntValHex (long long value=0) |
| SgLongLongIntVal * | SageBuilder::buildLongLongIntVal_nfi (long long value, const std::string &str) |
| SgEnumVal * | SageBuilder::buildEnumVal_nfi (int value, SgEnumDeclaration *decl, SgName name) |
| SgLongDoubleVal * | SageBuilder::buildLongDoubleVal (long double value=0.0) |
| SgLongDoubleVal * | SageBuilder::buildLongDoubleVal_nfi (long double value, const std::string &str) |
| SgShortVal * | SageBuilder::buildShortVal (short value=0) |
| SgShortVal * | SageBuilder::buildShortValHex (short value=0) |
| SgShortVal * | SageBuilder::buildShortVal_nfi (short value, const std::string &str) |
| SgStringVal * | SageBuilder::buildStringVal (std::string value="") |
| SgStringVal * | SageBuilder::buildStringVal_nfi (std::string value) |
| SgUnsignedCharVal * | SageBuilder::buildUnsignedCharVal (unsigned char v=0) |
| Build an unsigned char. | |
| SgUnsignedCharVal * | SageBuilder::buildUnsignedCharValHex (unsigned char v=0) |
| SgUnsignedCharVal * | SageBuilder::buildUnsignedCharVal_nfi (unsigned char v, const std::string &str) |
| SgUnsignedShortVal * | SageBuilder::buildUnsignedShortVal (unsigned short v=0) |
| Build an unsigned short integer. | |
| SgUnsignedShortVal * | SageBuilder::buildUnsignedShortValHex (unsigned short v=0) |
| SgUnsignedShortVal * | SageBuilder::buildUnsignedShortVal_nfi (unsigned short v, const std::string &str) |
| SgUnsignedIntVal * | SageBuilder::buildUnsignedIntVal (unsigned int v=0) |
| Build an unsigned integer. | |
| SgUnsignedIntVal * | SageBuilder::buildUnsignedIntValHex (unsigned int v=0) |
| SgUnsignedIntVal * | SageBuilder::buildUnsignedIntVal_nfi (unsigned int v, const std::string &str) |
| SgUnsignedLongVal * | SageBuilder::buildUnsignedLongVal (unsigned long v=0) |
| Build a unsigned long integer. | |
| SgUnsignedLongVal * | SageBuilder::buildUnsignedLongValHex (unsigned long v=0) |
| SgUnsignedLongVal * | SageBuilder::buildUnsignedLongVal_nfi (unsigned long v, const std::string &str) |
| SgUnsignedLongLongIntVal * | SageBuilder::buildUnsignedLongLongIntVal (unsigned long long v=0) |
| Build an unsigned long long integer. | |
| SgUnsignedLongLongIntVal * | SageBuilder::buildUnsignedLongLongIntValHex (unsigned long long v=0) |
| SgUnsignedLongLongIntVal * | SageBuilder::buildUnsignedLongLongIntVal_nfi (unsigned long long v, const std::string &str) |
| SgUpcThreads * | SageBuilder::buildUpcThreads () |
| Build UPC THREADS (integer expression). | |
| SgUpcThreads * | SageBuilder::buildUpcThreads_nfi () |
| SgUpcMythread * | SageBuilder::buildUpcMythread () |
| Build UPC MYTHREAD (integer expression). | |
| SgUpcMythread * | SageBuilder::buildUpcMythread_nfi () |
| SgThisExp * | SageBuilder::buildThisExp (SgClassSymbol *sym) |
| Build this pointer. | |
| SgThisExp * | SageBuilder::buildThisExp_nfi (SgClassSymbol *sym) |
| template<class T> | |
| T * | SageBuilder::buildUnaryExpression (SgExpression *operand=NULL) |
| Template function to build a unary expression of type T. Instantiated functions include:buildAddressOfOp(),buildBitComplementOp(),buildBitComplementOp(),buildMinusOp(),buildNotOp(),buildPointerDerefExp(),buildUnaryAddOp(),buildMinusMinusOp(),buildPlusPlusOp(). They are also used for the unary vararg operators (which are not technically unary operators). | |
| template<class T> | |
| T * | SageBuilder::buildUnaryExpression_nfi (SgExpression *operand) |
| SgCastExp * | SageBuilder::buildCastExp (SgExpression *operand_i=NULL, SgType *expression_type=NULL, SgCastExp::cast_type_enum cast_type=SgCastExp::e_C_style_cast) |
| Build a type casting expression. | |
| SgCastExp * | SageBuilder::buildCastExp_nfi (SgExpression *operand_i, SgType *expression_type, SgCastExp::cast_type_enum cast_type) |
| SgVarArgOp * | SageBuilder::buildVarArgOp_nfi (SgExpression *operand_i, SgType *expression_type) |
| Build vararg op expression. | |
| SgMinusMinusOp * | SageBuilder::buildMinusMinusOp (SgExpression *operand_i, SgUnaryOp::Sgop_mode a_mode) |
| Build -- expression, Sgop_mode is a value of either SgUnaryOp::prefix or SgUnaryOp::postfix. | |
| SgMinusMinusOp * | SageBuilder::buildMinusMinusOp_nfi (SgExpression *operand_i, SgUnaryOp::Sgop_mode a_mode) |
| SgPlusPlusOp * | SageBuilder::buildPlusPlusOp (SgExpression *operand_i, SgUnaryOp::Sgop_mode a_mode) |
| Build ++x or x++ , specify prefix or postfix using either SgUnaryOp::prefix or SgUnaryOp::postfix. | |
| SgPlusPlusOp * | SageBuilder::buildPlusPlusOp_nfi (SgExpression *operand_i, SgUnaryOp::Sgop_mode a_mode) |
| SgNewExp * | SageBuilder::buildNewExp (SgType *type, SgExprListExp *exprListExp, SgConstructorInitializer *constInit, SgExpression *expr, short int val, SgFunctionDeclaration *funcDecl) |
| template<class T> | |
| T * | SageBuilder::buildBinaryExpression (SgExpression *lhs=NULL, SgExpression *rhs=NULL) |
| Template function to build a binary expression of type T, taking care of parent pointers, file info, lvalue, etc. Available instances include: buildAddOp(), buildAndAssignOp(), buildAndOp(), buildArrowExp(),buildArrowStarOp(), buildAssignOp(),buildBitAndOp(),buildBitOrOp(),buildBitXorOp(),buildCommaOpExp(), buildConcatenationOp(),buildDivAssignOp(),buildDivideOp(),buildDotExp(),buildEqualityOp(),buildExponentiationOp(),buildGreaterOrEqualOp(),buildGreaterThanOp(),buildIntegerDivideOp(),buildIorAssignOp(),buildLessOrEqualOp(),buildLessThanOp(),buildLshiftAssignOp(),buildLshiftOp(),buildMinusAssignOp(),buildModAssignOp(),buildModOp(),buildMultAssignOp(),buildMultiplyOp(),buildNotEqualOp(),buildOrOp(),buildPlusAssignOp(),buildPntrArrRefExp(),buildRshiftAssignOp(),buildRshiftOp(),buildScopeOp(),buildSubtractOp()buildXorAssignOp(). | |
| template<class T> | |
| T * | SageBuilder::buildBinaryExpression_nfi (SgExpression *lhs, SgExpression *rhs) |
| SgConditionalExp * | SageBuilder::buildConditionalExp (SgExpression *test=NULL, SgExpression *a=NULL, SgExpression *b=NULL) |
| Build a conditional expression ?:. | |
| SgConditionalExp * | SageBuilder::buildConditionalExp_nfi (SgExpression *test, SgExpression *a, SgExpression *b, SgType *t) |
| SgExprListExp * | SageBuilder::buildExprListExp (SgExpression *expr1=NULL, SgExpression *expr2=NULL, SgExpression *expr3=NULL, SgExpression *expr4=NULL, SgExpression *expr5=NULL, SgExpression *expr6=NULL, SgExpression *expr7=NULL, SgExpression *expr8=NULL, SgExpression *expr9=NULL, SgExpression *expr10=NULL) |
| Build a SgExprListExp, used for function call parameter list etc. | |
| SgExprListExp * | SageBuilder::buildExprListExp (const std::vector< SgExpression * > &exprs) |
| SgExprListExp * | SageBuilder::buildExprListExp_nfi () |
| SgExprListExp * | SageBuilder::buildExprListExp_nfi (const std::vector< SgExpression * > &exprs) |
| SgVarRefExp * | SageBuilder::buildVarRefExp (const SgName &name, SgScopeStatement *scope=NULL) |
| Build SgVarRefExp based on a variable's Sage name. It will lookup symbol table internally starting from scope. A variable name is unique so type can be inferred (double check this). | |
| SgVarRefExp * | SageBuilder::buildVarRefExp (const std::string &varName, SgScopeStatement *scope=NULL) |
| Build SgVarRefExp based on a variable's name. It will lookup symbol table internally starting from scope. A variable is unique so type can be inferred. | |
| SgVarRefExp * | SageBuilder::buildVarRefExp (const char *varName, SgScopeStatement *scope=NULL) |
| Build a variable reference using a C style char array. | |
| SgVarRefExp * | SageBuilder::buildVarRefExp (SgVariableSymbol *varSymbol) |
| Build a variable reference from an existing symbol. | |
| SgVarRefExp * | SageBuilder::buildVarRefExp_nfi (SgVariableSymbol *varSymbol) |
| SgVarRefExp * | SageBuilder::buildVarRefExp (SgVariableDeclaration *vardecl) |
| Build a variable reference from an existing variable declaration. The assumption is a SgVariableDeclartion only declares one variable in the ROSE AST. | |
| SgVarRefExp * | SageBuilder::buildVarRefExp (SgInitializedName *initname, SgScopeStatement *scope=NULL) |
| build a variable reference from an initialized name It first tries to grab the associated symbol, then call buildVarRefExp(const SgName& name, SgScopeStatement*) if symbol does not exist. | |
| SgVarRefExp * | SageBuilder::buildOpaqueVarRefExp (const std::string &varName, SgScopeStatement *scope=NULL) |
| Build a variable reference expression at scope to an opaque variable which has unknown information except for its name. Used when referring to an internal variable defined in some headers of runtime libraries.(The headers are not yet inserted into the file during translation). Similar to buildOpaqueType();. | |
| SgFunctionRefExp * | SageBuilder::buildFunctionRefExp (const SgName &name, const SgType *func_type, SgScopeStatement *scope=NULL) |
| Build SgFunctionRefExp based on a C++ function's name and function type. It will lookup symbol table internally starting from scope. A hidden prototype will be created internally to introduce a new function symbol if the function symbol cannot be found. | |
| SgFunctionRefExp * | SageBuilder::buildFunctionRefExp (const char *name, const SgType *func_type, SgScopeStatement *scope=NULL) |
| SgFunctionRefExp * | SageBuilder::buildFunctionRefExp (const SgName &name, SgScopeStatement *scope=NULL) |
| Build SgFunctionRefExp based on a C function's name. It will lookup symbol table internally starting from scope and return the first matching function. | |
| SgFunctionRefExp * | SageBuilder::buildFunctionRefExp (const char *name, SgScopeStatement *scope=NULL) |
| SgFunctionRefExp * | SageBuilder::buildFunctionRefExp (const SgFunctionDeclaration *func_decl) |
| Build SgFunctionRefExp based on a function's declaration. | |
| SgFunctionRefExp * | SageBuilder::buildFunctionRefExp (SgFunctionSymbol *sym) |
| Build SgFunctionRefExp based on a function's symbol. | |
| SgFunctionRefExp * | SageBuilder::buildFunctionRefExp_nfi (SgFunctionSymbol *sym) |
| SgMemberFunctionRefExp * | SageBuilder::buildMemberFunctionRefExp_nfi (SgMemberFunctionSymbol *sym, bool virtual_call, bool need_qualifier) |
| SgMemberFunctionRefExp * | SageBuilder::buildMemberFunctionRefExp (SgMemberFunctionSymbol *sym, bool virtual_call, bool need_qualifier) |
| SgClassNameRefExp * | SageBuilder::buildClassNameRefExp_nfi (SgClassSymbol *sym) |
| SgClassNameRefExp * | SageBuilder::buildClassNameRefExp (SgClassSymbol *sym) |
| SgFunctionCallExp * | SageBuilder::buildFunctionCallExp (SgFunctionSymbol *sym, SgExprListExp *parameters=NULL) |
| Build a function call expression. | |
| SgFunctionCallExp * | SageBuilder::buildFunctionCallExp_nfi (SgExpression *f, SgExprListExp *parameters=NULL) |
| SgFunctionCallExp * | SageBuilder::buildFunctionCallExp (SgExpression *f, SgExprListExp *parameters=NULL) |
| SgFunctionCallExp * | SageBuilder::buildFunctionCallExp (const SgName &name, SgType *return_type, SgExprListExp *parameters=NULL, SgScopeStatement *scope=NULL) |
| Build a function call expression,it will automatically search for function symbols internally to build a right function reference etc. It tolerates the lack of the function symbol to support generating calls to library functions whose headers have not yet been inserted. | |
| SgAssignInitializer * | SageBuilder::buildAssignInitializer (SgExpression *operand_i=NULL, SgType *expression_type=NULL) |
| Build the rhs of a variable declaration which includes an assignment. | |
| SgAssignInitializer * | SageBuilder::buildAssignInitializer_nfi (SgExpression *operand_i=NULL, SgType *expression_type=NULL) |
| SgAggregateInitializer * | SageBuilder::buildAggregateInitializer (SgExprListExp *initializers=NULL, SgType *type=NULL) |
| Build an aggregate initializer. | |
| SgAggregateInitializer * | SageBuilder::buildAggregateInitializer_nfi (SgExprListExp *initializers, SgType *type=NULL) |
| SgConstructorInitializer * | SageBuilder::buildConstructorInitializer (SgMemberFunctionDeclaration *declaration, SgExprListExp *args, SgType *expression_type, bool need_name, bool need_qualifier, bool need_parenthesis_after_name, bool associated_class_unknown) |
| SgConstructorInitializer * | SageBuilder::buildConstructorInitializer_nfi (SgMemberFunctionDeclaration *declaration, SgExprListExp *args, SgType *expression_type, bool need_name, bool need_qualifier, bool need_parenthesis_after_name, bool associated_class_unknown) |
| SgSizeOfOp * | SageBuilder::buildSizeOfOp (SgExpression *exp=NULL) |
| Build sizeof() expression with an expression parameter. | |
| SgSizeOfOp * | SageBuilder::buildSizeOfOp_nfi (SgExpression *exp) |
| SgSizeOfOp * | SageBuilder::buildSizeOfOp (SgType *type=NULL) |
| Build sizeof() expression with a type parameter. | |
| SgSizeOfOp * | SageBuilder::buildSizeOfOp_nfi (SgType *type) |
Scope stack interfaces | |
| a global data structure to store current scope and parent scopes. Scope stack is provided as an alternative to manually passing scope parameters to builder functions. It is not required to be used. Please use the recommendeded operation functions for maintaining the scope stack. Don't use raw container access functions to ScopeStack. e.g. avoid ScopeStack.push_back(), using pushScopeStack() instead.
| |
| void | SageBuilder::pushScopeStack (SgScopeStatement *stmt) |
| Public interfaces of the scope stack, should be stable. | |
| void | SageBuilder::pushScopeStack (SgNode *node) |
| void | SageBuilder::popScopeStack () |
| SgScopeStatement * | SageBuilder::topScopeStack () |
| bool | SageBuilder::emptyScopeStack () |
| void | SageBuilder::clearScopeStack () |
| std::list< SgScopeStatement * > | SageBuilder::ScopeStack |
| intended to be a private member, don't access it directly. could be changed any time | |
Builders for SgType | |
| Builders for simple and complex SgType nodes, such as integer type, function type, array type, struct type, etc.
| |
| SgTypeBool * | SageBuilder::buildBoolType () |
| Built in simple types. | |
| SgTypeChar * | SageBuilder::buildCharType () |
| SgTypeDouble * | SageBuilder::buildDoubleType () |
| SgTypeFloat * | SageBuilder::buildFloatType () |
| SgTypeInt * | SageBuilder::buildIntType () |
| SgTypeLong * | SageBuilder::buildLongType () |
| SgTypeLongDouble * | SageBuilder::buildLongDoubleType () |
| SgTypeLongLong * | SageBuilder::buildLongLongType () |
| SgTypeShort * | SageBuilder::buildShortType () |
| SgTypeString * | SageBuilder::buildStringType () |
| SgTypeString * | SageBuilder::buildStringType (SgExpression *stringLengthExpression, size_t stringLengthLiteral) |
| SgTypeVoid * | SageBuilder::buildVoidType () |
| SgTypeWchar * | SageBuilder::buildWcharType () |
| SgTypeSignedChar * | SageBuilder::buildSignedCharType () |
| SgTypeSignedInt * | SageBuilder::buildSignedIntType () |
| SgTypeSignedLong * | SageBuilder::buildSignedLongType () |
| SgTypeSignedLongLong * | SageBuilder::buildSignedLongLongType () |
| SgTypeSignedShort * | SageBuilder::buildSignedShortType () |
| SgTypeUnsignedChar * | SageBuilder::buildUnsignedCharType () |
| SgTypeUnsignedInt * | SageBuilder::buildUnsignedIntType () |
| SgTypeUnsignedLong * | SageBuilder::buildUnsignedLongType () |
| SgTypeUnsignedLongLong * | SageBuilder::buildUnsignedLongLongType () |
| SgTypeUnsignedShort * | SageBuilder::buildUnsignedShortType () |
| SgTypeUnknown * | SageBuilder::buildUnknownType () |
| SgPointerType * | SageBuilder::buildPointerType (SgType *base_type=NULL) |
| Build a pointer type. | |
| SgReferenceType * | SageBuilder::buildReferenceType (SgType *base_type=NULL) |
| Build a reference type. | |
| SgModifierType * | SageBuilder::buildConstType (SgType *base_type=NULL) |
| Build a const type. | |
| SgModifierType * | SageBuilder::buildVolatileType (SgType *base_type=NULL) |
| Build a volatile type. | |
| SgModifierType * | SageBuilder::buildRestrictType (SgType *base_type) |
| Build a restrict type. | |
| SgArrayType * | SageBuilder::buildArrayType (SgType *base_type=NULL, SgExpression *index=NULL) |
| Build ArrayType. | |
| SgModifierType * | SageBuilder::buildFortranKindType (SgType *base_type, SgExpression *kindExpression) |
| Build a type based on the Fortran kind mechanism. | |
| SgFunctionType * | SageBuilder::buildFunctionType (SgType *return_type, SgFunctionParameterTypeList *typeList=NULL) |
| Build function type from return type and parameter type list. | |
| SgFunctionType * | SageBuilder::buildFunctionType (SgType *return_type, SgFunctionParameterList *argList=NULL) |
| Build function type from return type and parameter list. | |
| SgMemberFunctionType * | SageBuilder::buildMemberFunctionType (SgType *return_type, SgFunctionParameterTypeList *typeList, SgClassDefinition *struct_name, unsigned int mfunc_specifier) |
| SgType * | SageBuilder::buildOpaqueType (std::string const type_name, SgScopeStatement *scope) |
| Build an opaque type with a name, useful when a type's details are unknown during transformation, especially for a runtime library's internal type. Must provide scope here. | |
| SgModifierType * | SageBuilder::buildUpcStrictType (SgType *base_type=NULL) |
| Build a UPC strict type. | |
| SgModifierType * | SageBuilder::buildUpcRelaxedType (SgType *base_type=NULL) |
| Build a UPC relaxed type. | |
| SgModifierType * | SageBuilder::buildUpcSharedType (SgType *base_type=NULL, long layout=-1) |
| Build a UPC shared type. | |
| SgModifierType * | SageBuilder::buildUpcBlockIndefiniteType (SgType *base_type=NULL) |
| Build a UPC shared[] type. | |
| SgModifierType * | SageBuilder::buildUpcBlockStarType (SgType *base_type=NULL) |
| Build a UPC shared[*] type. | |
| SgModifierType * | SageBuilder::buildUpcBlockNumberType (SgType *base_type, long block_factor) |
| Build a UPC shared[n] type. | |
| SgTypeComplex * | SageBuilder::buildComplexType (SgType *base_type=NULL) |
| Build a complex type. | |
| SgTypeImaginary * | SageBuilder::buildImaginaryType (SgType *base_type=NULL) |
| Build an imaginary type. | |
Builders for support nodes | |
| AST high level builders for SgSupport nodes | |
| SgInitializedName * | SageBuilder::buildInitializedName (const SgName &name, SgType *type, SgInitializer *init=NULL) |
| Initialized names are tricky, their scope vary depending on context, so scope and symbol information are not needed until the initialized name is being actually used somewhere. | |
| SgInitializedName * | SageBuilder::buildInitializedName (const std::string &name, SgType *type) |
| SgInitializedName * | SageBuilder::buildInitializedName (const char *name, SgType *type) |
| SgInitializedName * | SageBuilder::buildInitializedName_nfi (const SgName &name, SgType *type, SgInitializer *init) |
| SgFunctionParameterTypeList * | SageBuilder::buildFunctionParameterTypeList (SgFunctionParameterList *paralist) |
| Build SgFunctionParameterTypeList from SgFunctionParameterList. | |
| SgFunctionParameterTypeList * | SageBuilder::buildFunctionParameterTypeList (SgExprListExp *expList) |
| Build SgFunctionParameterTypeList from an expression list, useful when building a function call. | |
| SgFunctionParameterTypeList * | SageBuilder::buildFunctionParameterTypeList () |
| Build an empty SgFunctionParameterTypeList. | |
Builders for statements | |
| AST high level builders for SgStatement, explicit scope parameters are allowed for flexibility. Please use SageInterface::appendStatement(), prependStatement(), and insertStatement() to attach the newly built statements into an AST tree. Calling member functions like SgScopeStatement::prepend_statement() or using container functions such as pushback() is discouraged since they don't handle many side effects for symbol tables, source file information, scope and parent pointers etc. | |
| SgVariableDeclaration * | SageBuilder::buildVariableDeclaration (const SgName &name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement *scope=NULL) |
| Build a variable declaration, handle symbol table transparently. | |
| SgVariableDeclaration * | SageBuilder::buildVariableDeclaration (const std::string &name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement *scope=NULL) |
| SgVariableDeclaration * | SageBuilder::buildVariableDeclaration (const char *name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement *scope=NULL) |
| SgVariableDeclaration * | SageBuilder::buildVariableDeclaration_nfi (const SgName &name, SgType *type, SgInitializer *varInit, SgScopeStatement *scope) |
| SgTypedefDeclaration * | SageBuilder::buildTypedefDeclaration (const std::string &name, SgType *base_type, SgScopeStatement *scope=NULL) |
| Build a typedef declaration, such as: typedef int myint;. | |
| SgTypedefDeclaration * | SageBuilder::buildTypedefDeclaration_nfi (const std::string &name, SgType *base_type, SgScopeStatement *scope=NULL) |
| SgFunctionParameterList * | SageBuilder::buildFunctionParameterList (SgInitializedName *in1=NULL, SgInitializedName *in2=NULL, SgInitializedName *in3=NULL, SgInitializedName *in4=NULL, SgInitializedName *in5=NULL, SgInitializedName *in6=NULL, SgInitializedName *in7=NULL, SgInitializedName *in8=NULL, SgInitializedName *in9=NULL, SgInitializedName *in10=NULL) |
| Build an empty SgFunctionParameterList, possibly with some initialized names filled in. | |
| SgFunctionParameterList * | SageBuilder::buildFunctionParameterList_nfi () |
| SgFunctionParameterList * | SageBuilder::buildFunctionParameterList (SgFunctionParameterTypeList *paraTypeList) |
| Build an SgFunctionParameterList from SgFunctionParameterTypeList, like (int, float,...), used for parameter list of prototype functions when function type( including parameter type list) is known. | |
| SgFunctionParameterList * | SageBuilder::buildFunctionParameterList_nfi (SgFunctionParameterTypeList *paraTypeList) |
| template<class actualFunction> | |
| actualFunction * | SageBuilder::buildNondefiningFunctionDeclaration_T (const SgName &name, SgType *return_type, SgFunctionParameterList *paralist, bool isMemberFunction, SgScopeStatement *scope=NULL) |
| A template function for function prototype declaration builders. | |
| SgFunctionDeclaration * | SageBuilder::buildNondefiningFunctionDeclaration (const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL) |
| Build a prototype for a function, handle function type, symbol etc transparently. | |
| SgFunctionDeclaration * | SageBuilder::buildNondefiningFunctionDeclaration (const SgFunctionDeclaration *funcdecl, SgScopeStatement *scope=NULL) |
| Build a prototype for an existing function declaration (defining or nondefining is fine). | |
| SgMemberFunctionDeclaration * | SageBuilder::buildNondefiningMemberFunctionDeclaration (const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL) |
| Build a prototype member function declaration. | |
| SgMemberFunctionDeclaration * | SageBuilder::buildDefiningMemberFunctionDeclaration (const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL) |
| Build a defining ( non-prototype) member function declaration. | |
| SgMemberFunctionDeclaration * | SageBuilder::buildNondefiningMemberFunctionDeclaration (const SgMemberFunctionDeclaration *funcdecl, SgScopeStatement *scope=NULL) |
| Build a prototype for an existing member function declaration (defining or nondefining is fine). | |
| template<class actualFunction> | |
| actualFunction * | SageBuilder::buildDefiningFunctionDeclaration_T (const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL) |
| A template function for function declaration builders. | |
| SgFunctionDeclaration * | SageBuilder::buildDefiningFunctionDeclaration (const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL) |
| Build a function declaration with a function body. | |
| SgFunctionDeclaration * | SageBuilder::buildDefiningFunctionDeclaration (const std::string &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL) |
| SgFunctionDeclaration * | SageBuilder::buildDefiningFunctionDeclaration (const char *name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL) |
| SgProcedureHeaderStatement * | SageBuilder::buildProcedureHeaderStatement (const char *name, SgType *return_type, SgFunctionParameterList *parlist, SgProcedureHeaderStatement::subprogram_kind_enum, SgScopeStatement *scope=NULL) |
| Build a Fortran subroutine or procedure. | |
| SgExprStatement * | SageBuilder::buildFunctionCallStmt (const SgName &name, SgType *return_type, SgExprListExp *parameters=NULL, SgScopeStatement *scope=NULL) |
| Build a regular function call statement. | |
| SgExprStatement * | SageBuilder::buildFunctionCallStmt (SgExpression *function, SgExprListExp *parameters=NULL) |
| Build a function call statement using function expression and argument list only, like (*funcPtr)(args);. | |
| SgLabelStatement * | SageBuilder::buildLabelStatement (const SgName &name, SgStatement *stmt=NULL, SgScopeStatement *scope=NULL) |
| Note that the scope of a label statement is special. | |
| SgLabelStatement * | SageBuilder::buildLabelStatement_nfi (const SgName &name, SgStatement *stmt, SgScopeStatement *scope) |
| SgGotoStatement * | SageBuilder::buildGotoStatement (SgLabelStatement *label=NULL) |
| Build a goto statement. | |
| SgGotoStatement * | SageBuilder::buildGotoStatement_nfi (SgLabelStatement *label) |
| SgCaseOptionStmt * | SageBuilder::buildCaseOptionStmt (SgExpression *key=NULL, SgStatement *body=NULL) |
| Build a case option statement. | |
| SgCaseOptionStmt * | SageBuilder::buildCaseOptionStmt_nfi (SgExpression *key, SgStatement *body) |
| SgDefaultOptionStmt * | SageBuilder::buildDefaultOptionStmt (SgStatement *body=NULL) |
| Build a default option statement. | |
| SgDefaultOptionStmt * | SageBuilder::buildDefaultOptionStmt_nfi (SgStatement *body) |
| SgExprStatement * | SageBuilder::buildExprStatement (SgExpression *exp=NULL) |
| Build a SgExprStatement, set File_Info automatically. | |
| SgExprStatement * | SageBuilder::buildExprStatement_nfi (SgExpression *exp) |
| SgSwitchStatement * | SageBuilder::buildSwitchStatement (SgStatement *item_selector=NULL, SgStatement *body=NULL) |
| Build a switch statement. | |
| SgSwitchStatement * | SageBuilder::buildSwitchStatement (SgExpression *item_selector, SgStatement *body=NULL) |
| SgSwitchStatement * | SageBuilder::buildSwitchStatement_nfi (SgStatement *item_selector, SgStatement *body) |
| SgIfStmt * | SageBuilder::buildIfStmt (SgStatement *conditional, SgStatement *true_body, SgStatement *false_body) |
| Build if statement. | |
| SgIfStmt * | SageBuilder::buildIfStmt (SgExpression *conditional, SgStatement *true_body, SgStatement *false_body) |
| SgIfStmt * | SageBuilder::buildIfStmt_nfi (SgStatement *conditional, SgStatement *true_body, SgStatement *false_body) |
| SgForStatement * | SageBuilder::buildForStatement (SgStatement *initialize_stmt, SgStatement *test, SgExpression *increment, SgStatement *loop_body) |
| Build a for statement, assume none of the arguments is NULL. | |
| SgForStatement * | SageBuilder::buildForStatement_nfi (SgStatement *initialize_stmt, SgStatement *test, SgExpression *increment, SgStatement *loop_body) |
| SgUpcForAllStatement * | SageBuilder::buildUpcForAllStatement_nfi (SgStatement *initialize_stmt, SgStatement *test, SgExpression *increment, SgExpression *affinity, SgStatement *loop_body) |
| Build a UPC forall statement. | |
| SgWhileStmt * | SageBuilder::buildWhileStmt (SgStatement *condition, SgStatement *body) |
| Build while statement. | |
| SgWhileStmt * | SageBuilder::buildWhileStmt (SgExpression *condition, SgStatement *body) |
| SgWhileStmt * | SageBuilder::buildWhileStmt_nfi (SgStatement *condition, SgStatement *body) |
| SgDoWhileStmt * | SageBuilder::buildDoWhileStmt (SgStatement *body, SgStatement *condition) |
| Build do-while statement. | |
| SgDoWhileStmt * | SageBuilder::buildDoWhileStmt (SgStatement *body, SgExpression *condition) |
| SgDoWhileStmt * | SageBuilder::buildDoWhileStmt_nfi (SgStatement *body, SgStatement *condition) |
| SgPragmaDeclaration * | SageBuilder::buildPragmaDeclaration (const std::string &name, SgScopeStatement *scope=NULL) |
| Build pragma declaration, handle SgPragma and defining/nondefining pointers internally. | |
| SgPragmaDeclaration * | SageBuilder::buildPragmaDeclaration_nfi (const std::string &name, SgScopeStatement *scope) |
| SgPragma * | SageBuilder::buildPragma (const std::string &name) |
| Build SgPragma. | |
| SgBasicBlock * | SageBuilder::buildBasicBlock (SgStatement *stmt1=NULL, SgStatement *stmt2=NULL, SgStatement *stmt3=NULL, SgStatement *stmt4=NULL, SgStatement *stmt5=NULL, SgStatement *stmt6=NULL, SgStatement *stmt7=NULL, SgStatement *stmt8=NULL, SgStatement *stmt9=NULL, SgStatement *stmt10=NULL) |
| Build a SgBasicBlock, setting file info internally. | |
| SgBasicBlock * | SageBuilder::buildBasicBlock_nfi () |
| SgBasicBlock * | SageBuilder::buildBasicBlock_nfi (const std::vector< SgStatement * > &) |
| SgExprStatement * | SageBuilder::buildAssignStatement (SgExpression *lhs, SgExpression *rhs) |
| Build an assignment statement from lefthand operand and right hand operand. | |
| SgBreakStmt * | SageBuilder::buildBreakStmt () |
| Build a break statement. | |
| SgBreakStmt * | SageBuilder::buildBreakStmt_nfi () |
| SgContinueStmt * | SageBuilder::buildContinueStmt () |
| Build a continue statement. | |
| SgContinueStmt * | SageBuilder::buildContinueStmt_nfi () |
| SgClassDefinition * | SageBuilder::buildClassDefinition (SgClassDeclaration *d=NULL) |
| Build a class definition scope statement. | |
| SgClassDefinition * | SageBuilder::buildClassDefinition_nfi (SgClassDeclaration *d=NULL) |
| Build a class definition scope statement. | |
| SgClassDeclaration * | SageBuilder::buildNondefiningClassDeclaration_nfi (const SgName &name, SgClassDeclaration::class_types kind, SgScopeStatement *scope) |
| Build a structure first nondefining declaration, without file info. | |
| SgClassDeclaration * | SageBuilder::buildNondefiningClassDeclaration (SgName name, SgScopeStatement *scope) |
| SgClassDeclaration * | SageBuilder::buildDefiningClassDeclaration (SgName name, SgScopeStatement *scope) |
| SgClassDeclaration * | SageBuilder::buildClassDeclaration (SgName name, SgScopeStatement *scope) |
| SgEnumDeclaration * | SageBuilder::buildNondefiningEnumDeclaration_nfi (const SgName &name, SgScopeStatement *scope) |
| Build an enum first nondefining declaration, without file info. | |
| SgClassDeclaration * | SageBuilder::buildStructDeclaration (const SgName &name, SgScopeStatement *scope=NULL) |
| Build a structure, It is also a declaration statement in SAGE III. | |
| SgClassDeclaration * | SageBuilder::buildStructDeclaration (const std::string &name, SgScopeStatement *scope=NULL) |
| SgClassDeclaration * | SageBuilder::buildStructDeclaration (const char *name, SgScopeStatement *scope=NULL) |
| SgNamespaceDeclarationStatement * | SageBuilder::buildNamespaceDeclaration (const SgName &name, SgScopeStatement *scope=NULL) |
| SgNamespaceDeclarationStatement * | SageBuilder::buildNamespaceDeclaration_nfi (const SgName &name, bool unnamednamespace, SgScopeStatement *scope) |
| SgNamespaceDefinitionStatement * | SageBuilder::buildNamespaceDefinition (SgNamespaceDeclarationStatement *d=NULL) |
| SgClassDeclaration * | SageBuilder::buildClassDeclaration_nfi (const SgName &name, SgClassDeclaration::class_types kind, SgScopeStatement *scope, SgClassDeclaration *nonDefiningDecl) |
| SgEnumDeclaration * | SageBuilder::buildEnumDeclaration (const SgName &name, SgScopeStatement *scope=NULL) |
| Build an enum, It is also a declaration statement in SAGE III. | |
| SgEnumDeclaration * | SageBuilder::buildEnumDeclaration_nfi (const SgName &name, SgScopeStatement *scope=NULL) |
| Build an enum, It is also a declaration statement in SAGE III. | |
| SgReturnStmt * | SageBuilder::buildReturnStmt (SgExpression *expression=NULL) |
| Build a return statement. | |
| SgReturnStmt * | SageBuilder::buildReturnStmt_nfi (SgExpression *expression) |
| SgNullStatement * | SageBuilder::buildNullStatement () |
| Build a NULL statement. | |
| SgNullStatement * | SageBuilder::buildNullStatement_nfi () |
| SgAsmStmt * | SageBuilder::buildAsmStatement (std::string s) |
| Build a NULL statement. | |
| SgAsmStmt * | SageBuilder::buildAsmStatement_nfi (std::string s) |
| SgAsmStmt * | SageBuilder::buildMultibyteNopStatement (int n) |
Builders for others | |
| AST high level builders for others | |
| SgFile * | SageBuilder::buildFile (const std::string &inputFileName, const std::string &outputFileName, SgProject *project=NULL) |
| Build a SgFile node and attach it to SgProject. | |
| PreprocessingInfo * | SageBuilder::buildComment (SgLocatedNode *target, const std::string &content, PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before, PreprocessingInfo::DirectiveType dtype=PreprocessingInfo::CpreprocessorUnknownDeclaration) |
| Build and attach a comment, comment style is inferred from the language type of the target node if not provided. It is indeed a wrapper of SageInterface::attachComment(). | |
| PreprocessingInfo * | SageBuilder::buildCpreprocessorDefineDeclaration (SgLocatedNode *target, const std::string &content, PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before) |
| Build and attach define XX directives, pass "#define xxx xxx" as content. | |
| AbstractHandle::abstract_handle * | SageBuilder::buildAbstractHandle (SgNode *n) |
| Build an abstract handle from a SgNode. | |
| #define BUILD_UNARY_PROTO | ( | suffix | ) |
Value:
Sg##suffix * build##suffix(SgExpression* op =NULL); \ Sg##suffix * build##suffix##_nfi(SgExpression* op);
The instantiated functions' prototypes are not shown since they are expanded using macros. Doxygen is not smart enough to handle macro expansion.
| #define BUILD_BINARY_PROTO | ( | suffix | ) |
Value:
Sg##suffix * build##suffix(SgExpression* lhs =NULL, SgExpression* rhs =NULL); \ Sg##suffix * build##suffix##_nfi(SgExpression* lhs, SgExpression* rhs);
The instantiated functions' prototypes are not shown since they are expanded using macros. Doxygen is not smart enough to handle macro expansion.
| void SageBuilder::pushScopeStack | ( | SgScopeStatement * | stmt | ) |
Public interfaces of the scope stack, should be stable.
| void SageBuilder::pushScopeStack | ( | SgNode * | node | ) |
| void SageBuilder::popScopeStack | ( | ) |
| SgScopeStatement* SageBuilder::topScopeStack | ( | ) |
| bool SageBuilder::emptyScopeStack | ( | ) |
| void SageBuilder::clearScopeStack | ( | ) |
| SgTypeBool* SageBuilder::buildBoolType | ( | ) |
Built in simple types.
| SgTypeChar* SageBuilder::buildCharType | ( | ) |
| SgTypeDouble* SageBuilder::buildDoubleType | ( | ) |
| SgTypeFloat* SageBuilder::buildFloatType | ( | ) |
| SgTypeInt* SageBuilder::buildIntType | ( | ) |
| SgTypeLong* SageBuilder::buildLongType | ( | ) |
| SgTypeLongDouble* SageBuilder::buildLongDoubleType | ( | ) |
| SgTypeLongLong* SageBuilder::buildLongLongType | ( | ) |
| SgTypeShort* SageBuilder::buildShortType | ( | ) |
| SgTypeString* SageBuilder::buildStringType | ( | ) |
| SgTypeString* SageBuilder::buildStringType | ( | SgExpression * | stringLengthExpression, | |
| size_t | stringLengthLiteral | |||
| ) |
| SgTypeVoid* SageBuilder::buildVoidType | ( | ) |
| SgTypeWchar* SageBuilder::buildWcharType | ( | ) |
| SgTypeSignedChar* SageBuilder::buildSignedCharType | ( | ) |
| SgTypeSignedInt* SageBuilder::buildSignedIntType | ( | ) |
| SgTypeSignedLong* SageBuilder::buildSignedLongType | ( | ) |
| SgTypeSignedLongLong* SageBuilder::buildSignedLongLongType | ( | ) |
| SgTypeSignedShort* SageBuilder::buildSignedShortType | ( | ) |
| SgTypeUnsignedChar* SageBuilder::buildUnsignedCharType | ( | ) |
| SgTypeUnsignedInt* SageBuilder::buildUnsignedIntType | ( | ) |
| SgTypeUnsignedLong* SageBuilder::buildUnsignedLongType | ( | ) |
| SgTypeUnsignedLongLong* SageBuilder::buildUnsignedLongLongType | ( | ) |
| SgTypeUnsignedShort* SageBuilder::buildUnsignedShortType | ( | ) |
| SgTypeUnknown* SageBuilder::buildUnknownType | ( | ) |
| SgPointerType* SageBuilder::buildPointerType | ( | SgType * | base_type = NULL |
) |
Build a pointer type.
| SgReferenceType* SageBuilder::buildReferenceType | ( | SgType * | base_type = NULL |
) |
Build a reference type.
| SgModifierType* SageBuilder::buildConstType | ( | SgType * | base_type = NULL |
) |
Build a const type.
| SgModifierType* SageBuilder::buildVolatileType | ( | SgType * | base_type = NULL |
) |
Build a volatile type.
| SgModifierType* SageBuilder::buildRestrictType | ( | SgType * | base_type | ) |
Build a restrict type.
| SgArrayType* SageBuilder::buildArrayType | ( | SgType * | base_type = NULL, |
|
| SgExpression * | index = NULL | |||
| ) |
Build ArrayType.
| SgModifierType* SageBuilder::buildFortranKindType | ( | SgType * | base_type, | |
| SgExpression * | kindExpression | |||
| ) |
Build a type based on the Fortran kind mechanism.
| SgFunctionType* SageBuilder::buildFunctionType | ( | SgType * | return_type, | |
| SgFunctionParameterTypeList * | typeList = NULL | |||
| ) |
Build function type from return type and parameter type list.
| SgFunctionType* SageBuilder::buildFunctionType | ( | SgType * | return_type, | |
| SgFunctionParameterList * | argList = NULL | |||
| ) |
Build function type from return type and parameter list.
| SgMemberFunctionType* SageBuilder::buildMemberFunctionType | ( | SgType * | return_type, | |
| SgFunctionParameterTypeList * | typeList, | |||
| SgClassDefinition * | struct_name, | |||
| unsigned int | mfunc_specifier | |||
| ) |
| SgType* SageBuilder::buildOpaqueType | ( | std::string const | type_name, | |
| SgScopeStatement * | scope | |||
| ) |
Build an opaque type with a name, useful when a type's details are unknown during transformation, especially for a runtime library's internal type. Must provide scope here.
Some types are not known during translation but nevertheless are needed. For example, some internal types from a runtime library. To work around this problem: this function prepends a hidden typedef declaration into scope 'typedef int OpaqueTypeName;' The translation-generated code is expected to include the runtime library's headers to have the real type declarations.
| SgModifierType* SageBuilder::buildUpcStrictType | ( | SgType * | base_type = NULL |
) |
Build a UPC strict type.
| SgModifierType* SageBuilder::buildUpcRelaxedType | ( | SgType * | base_type = NULL |
) |
Build a UPC relaxed type.
| SgModifierType* SageBuilder::buildUpcSharedType | ( | SgType * | base_type = NULL, |
|
| long | layout = -1 | |||
| ) |
Build a UPC shared type.
| SgModifierType* SageBuilder::buildUpcBlockIndefiniteType | ( | SgType * | base_type = NULL |
) |
Build a UPC shared[] type.
| SgModifierType* SageBuilder::buildUpcBlockStarType | ( | SgType * | base_type = NULL |
) |
Build a UPC shared[*] type.
| SgModifierType* SageBuilder::buildUpcBlockNumberType | ( | SgType * | base_type, | |
| long | block_factor | |||
| ) |
Build a UPC shared[n] type.
| SgTypeComplex* SageBuilder::buildComplexType | ( | SgType * | base_type = NULL |
) |
Build a complex type.
| SgTypeImaginary* SageBuilder::buildImaginaryType | ( | SgType * | base_type = NULL |
) |
Build an imaginary type.
| SgNullExpression* SageBuilder::buildNullExpression | ( | ) |
Build a null expression, set file info as the default one.
| SgNullExpression* SageBuilder::buildNullExpression_nfi | ( | ) |
No file info version of buildNullExpression(). File info is to be set later on.
| SgBoolValExp* SageBuilder::buildBoolValExp | ( | int | value = 0 |
) |
Build a bool value expression, the name convention of SgBoolValExp is little different from others for some unknown reason.
| SgBoolValExp* SageBuilder::buildBoolValExp | ( | bool | value = 0 |
) |
| SgBoolValExp* SageBuilder::buildBoolValExp_nfi | ( | int | value | ) |
| SgCharVal* SageBuilder::buildCharVal | ( | char | value = 0 |
) |
| SgCharVal* SageBuilder::buildCharVal_nfi | ( | char | value, | |
| const std::string & | str | |||
| ) |
| SgWcharVal* SageBuilder::buildWcharVal | ( | wchar_t | value = 0 |
) |
| SgWcharVal* SageBuilder::buildWcharVal_nfi | ( | wchar_t | value, | |
| const std::string & | str | |||
| ) |
| SgComplexVal* SageBuilder::buildComplexVal | ( | long double | real_value = 0.0, |
|
| long double | imaginary_value = 0.0 | |||
| ) |
| SgComplexVal* SageBuilder::buildComplexVal | ( | SgValueExp * | real_value, | |
| SgValueExp * | imaginary_value | |||
| ) |
| SgComplexVal* SageBuilder::buildComplexVal_nfi | ( | SgValueExp * | real_value, | |
| SgValueExp * | imaginary_value, | |||
| const std::string & | str | |||
| ) |
| SgComplexVal* SageBuilder::buildImaginaryVal | ( | long double | imaginary_value | ) |
| SgComplexVal* SageBuilder::buildImaginaryVal | ( | SgValueExp * | imaginary_value | ) |
| SgComplexVal* SageBuilder::buildImaginaryVal_nfi | ( | SgValueExp * | imaginary_value, | |
| const std::string & | str | |||
| ) |
| SgDoubleVal* SageBuilder::buildDoubleVal | ( | double | value = 0.0 |
) |
Build a double value expression.
| SgDoubleVal* SageBuilder::buildDoubleVal_nfi | ( | double | value, | |
| const std::string & | str | |||
| ) |
| SgFloatVal* SageBuilder::buildFloatVal | ( | float | value = 0.0 |
) |
| SgFloatVal* SageBuilder::buildFloatVal_nfi | ( | float | value, | |
| const std::string & | str | |||
| ) |
| SgIntVal* SageBuilder::buildIntVal | ( | int | value = 0 |
) |
Build an integer value expression.
| SgIntVal* SageBuilder::buildIntValHex | ( | int | value = 0 |
) |
| SgIntVal* SageBuilder::buildIntVal_nfi | ( | int | value, | |
| const std::string & | str | |||
| ) |
| SgLongIntVal* SageBuilder::buildLongIntVal | ( | long | value = 0 |
) |
Build a long integer value expression.
| SgLongIntVal* SageBuilder::buildLongIntValHex | ( | long | value = 0 |
) |
| SgLongIntVal* SageBuilder::buildLongIntVal_nfi | ( | long | value, | |
| const std::string & | str | |||
| ) |
| SgLongLongIntVal* SageBuilder::buildLongLongIntVal | ( | long long | value = 0 |
) |
Build a long long integer value expression.
| SgLongLongIntVal* SageBuilder::buildLongLongIntValHex | ( | long long | value = 0 |
) |
| SgLongLongIntVal* SageBuilder::buildLongLongIntVal_nfi | ( | long long | value, | |
| const std::string & | str | |||
| ) |
| SgEnumVal* SageBuilder::buildEnumVal_nfi | ( | int | value, | |
| SgEnumDeclaration * | decl, | |||
| SgName | name | |||
| ) |
| SgLongDoubleVal* SageBuilder::buildLongDoubleVal | ( | long double | value = 0.0 |
) |
| SgLongDoubleVal* SageBuilder::buildLongDoubleVal_nfi | ( | long double | value, | |
| const std::string & | str | |||
| ) |
| SgShortVal* SageBuilder::buildShortVal | ( | short | value = 0 |
) |
| SgShortVal* SageBuilder::buildShortValHex | ( | short | value = 0 |
) |
| SgShortVal* SageBuilder::buildShortVal_nfi | ( | short | value, | |
| const std::string & | str | |||
| ) |
| SgStringVal* SageBuilder::buildStringVal | ( | std::string | value = "" |
) |
| SgStringVal* SageBuilder::buildStringVal_nfi | ( | std::string | value | ) |
| SgUnsignedCharVal* SageBuilder::buildUnsignedCharVal | ( | unsigned char | v = 0 |
) |
Build an unsigned char.
| SgUnsignedCharVal* SageBuilder::buildUnsignedCharValHex | ( | unsigned char | v = 0 |
) |
| SgUnsignedCharVal* SageBuilder::buildUnsignedCharVal_nfi | ( | unsigned char | v, | |
| const std::string & | str | |||
| ) |
| SgUnsignedShortVal* SageBuilder::buildUnsignedShortVal | ( | unsigned short | v = 0 |
) |
Build an unsigned short integer.
| SgUnsignedShortVal* SageBuilder::buildUnsignedShortValHex | ( | unsigned short | v = 0 |
) |
| SgUnsignedShortVal* SageBuilder::buildUnsignedShortVal_nfi | ( | unsigned short | v, | |
| const std::string & | str | |||
| ) |
| SgUnsignedIntVal* SageBuilder::buildUnsignedIntVal | ( | unsigned int | v = 0 |
) |
Build an unsigned integer.
| SgUnsignedIntVal* SageBuilder::buildUnsignedIntValHex | ( | unsigned int | v = 0 |
) |
| SgUnsignedIntVal* SageBuilder::buildUnsignedIntVal_nfi | ( | unsigned int | v, | |
| const std::string & | str | |||
| ) |
| SgUnsignedLongVal* SageBuilder::buildUnsignedLongVal | ( | unsigned long | v = 0 |
) |
Build a unsigned long integer.
| SgUnsignedLongVal* SageBuilder::buildUnsignedLongValHex | ( | unsigned long | v = 0 |
) |
| SgUnsignedLongVal* SageBuilder::buildUnsignedLongVal_nfi | ( | unsigned long | v, | |
| const std::string & | str | |||
| ) |
| SgUnsignedLongLongIntVal* SageBuilder::buildUnsignedLongLongIntVal | ( | unsigned long long | v = 0 |
) |
Build an unsigned long long integer.
| SgUnsignedLongLongIntVal* SageBuilder::buildUnsignedLongLongIntValHex | ( | unsigned long long | v = 0 |
) |
| SgUnsignedLongLongIntVal* SageBuilder::buildUnsignedLongLongIntVal_nfi | ( | unsigned long long | v, | |
| const std::string & | str | |||
| ) |
| SgUpcThreads* SageBuilder::buildUpcThreads | ( | ) |
Build UPC THREADS (integer expression).
| SgUpcThreads* SageBuilder::buildUpcThreads_nfi | ( | ) |
| SgUpcMythread* SageBuilder::buildUpcMythread | ( | ) |
Build UPC MYTHREAD (integer expression).
| SgUpcMythread* SageBuilder::buildUpcMythread_nfi | ( | ) |
| SgThisExp* SageBuilder::buildThisExp | ( | SgClassSymbol * | sym | ) |
Build this pointer.
| SgThisExp* SageBuilder::buildThisExp_nfi | ( | SgClassSymbol * | sym | ) |
| T* SageBuilder::buildUnaryExpression | ( | SgExpression * | operand = NULL |
) |
Template function to build a unary expression of type T. Instantiated functions include:buildAddressOfOp(),buildBitComplementOp(),buildBitComplementOp(),buildMinusOp(),buildNotOp(),buildPointerDerefExp(),buildUnaryAddOp(),buildMinusMinusOp(),buildPlusPlusOp(). They are also used for the unary vararg operators (which are not technically unary operators).
The instantiated functions' prototypes are not shown since they are expanded using macros. Doxygen is not smart enough to handle macro expansion.
| T* SageBuilder::buildUnaryExpression_nfi | ( | SgExpression * | operand | ) |
| SgCastExp* SageBuilder::buildCastExp | ( | SgExpression * | operand_i = NULL, |
|
| SgType * | expression_type = NULL, |
|||
| SgCastExp::cast_type_enum | cast_type = SgCastExp::e_C_style_cast | |||
| ) |
Build a type casting expression.
| SgCastExp* SageBuilder::buildCastExp_nfi | ( | SgExpression * | operand_i, | |
| SgType * | expression_type, | |||
| SgCastExp::cast_type_enum | cast_type | |||
| ) |
| SgVarArgOp* SageBuilder::buildVarArgOp_nfi | ( | SgExpression * | operand_i, | |
| SgType * | expression_type | |||
| ) |
Build vararg op expression.
| SgMinusMinusOp* SageBuilder::buildMinusMinusOp | ( | SgExpression * | operand_i, | |
| SgUnaryOp::Sgop_mode | a_mode | |||
| ) |
Build -- expression, Sgop_mode is a value of either SgUnaryOp::prefix or SgUnaryOp::postfix.
| SgMinusMinusOp* SageBuilder::buildMinusMinusOp_nfi | ( | SgExpression * | operand_i, | |
| SgUnaryOp::Sgop_mode | a_mode | |||
| ) |
| SgPlusPlusOp* SageBuilder::buildPlusPlusOp | ( | SgExpression * | operand_i, | |
| SgUnaryOp::Sgop_mode | a_mode | |||
| ) |
Build ++x or x++ , specify prefix or postfix using either SgUnaryOp::prefix or SgUnaryOp::postfix.
| SgPlusPlusOp* SageBuilder::buildPlusPlusOp_nfi | ( | SgExpression * | operand_i, | |
| SgUnaryOp::Sgop_mode | a_mode | |||
| ) |
| SgNewExp* SageBuilder::buildNewExp | ( | SgType * | type, | |
| SgExprListExp * | exprListExp, | |||
| SgConstructorInitializer * | constInit, | |||
| SgExpression * | expr, | |||
| short int | val, | |||
| SgFunctionDeclaration * | funcDecl | |||
| ) |
| T* SageBuilder::buildBinaryExpression | ( | SgExpression * | lhs = NULL, |
|
| SgExpression * | rhs = NULL | |||
| ) |
Template function to build a binary expression of type T, taking care of parent pointers, file info, lvalue, etc. Available instances include: buildAddOp(), buildAndAssignOp(), buildAndOp(), buildArrowExp(),buildArrowStarOp(), buildAssignOp(),buildBitAndOp(),buildBitOrOp(),buildBitXorOp(),buildCommaOpExp(), buildConcatenationOp(),buildDivAssignOp(),buildDivideOp(),buildDotExp(),buildEqualityOp(),buildExponentiationOp(),buildGreaterOrEqualOp(),buildGreaterThanOp(),buildIntegerDivideOp(),buildIorAssignOp(),buildLessOrEqualOp(),buildLessThanOp(),buildLshiftAssignOp(),buildLshiftOp(),buildMinusAssignOp(),buildModAssignOp(),buildModOp(),buildMultAssignOp(),buildMultiplyOp(),buildNotEqualOp(),buildOrOp(),buildPlusAssignOp(),buildPntrArrRefExp(),buildRshiftAssignOp(),buildRshiftOp(),buildScopeOp(),buildSubtractOp()buildXorAssignOp().
The instantiated functions' prototypes are not shown since they are expanded using macros. Doxygen is not smart enough to handle macro expansion.
| T* SageBuilder::buildBinaryExpression_nfi | ( | SgExpression * | lhs, | |
| SgExpression * | rhs | |||
| ) |
| SgConditionalExp* SageBuilder::buildConditionalExp | ( | SgExpression * | test = NULL, |
|
| SgExpression * | a = NULL, |
|||
| SgExpression * | b = NULL | |||
| ) |
Build a conditional expression ?:.
| SgConditionalExp* SageBuilder::buildConditionalExp_nfi | ( | SgExpression * | test, | |
| SgExpression * | a, | |||
| SgExpression * | b, | |||
| SgType * | t | |||
| ) |
| SgExprListExp* SageBuilder::buildExprListExp | ( | SgExpression * | expr1 = NULL, |
|
| SgExpression * | expr2 = NULL, |
|||
| SgExpression * | expr3 = NULL, |
|||
| SgExpression * | expr4 = NULL, |
|||
| SgExpression * | expr5 = NULL, |
|||
| SgExpression * | expr6 = NULL, |
|||
| SgExpression * | expr7 = NULL, |
|||
| SgExpression * | expr8 = NULL, |
|||
| SgExpression * | expr9 = NULL, |
|||
| SgExpression * | expr10 = NULL | |||
| ) |
Build a SgExprListExp, used for function call parameter list etc.
| SgExprListExp* SageBuilder::buildExprListExp | ( | const std::vector< SgExpression * > & | exprs | ) |
| SgExprListExp* SageBuilder::buildExprListExp_nfi | ( | ) |
| SgExprListExp* SageBuilder::buildExprListExp_nfi | ( | const std::vector< SgExpression * > & | exprs | ) |
| SgVarRefExp* SageBuilder::buildVarRefExp | ( | const SgName & | name, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
Build SgVarRefExp based on a variable's Sage name. It will lookup symbol table internally starting from scope. A variable name is unique so type can be inferred (double check this).
It is possible to build a reference to a variable with known name before the variable is declaration, especially during bottomup construction of AST. In this case, SgTypeUnknown is used to indicate the variable reference needing postprocessing fix using fixVariableReferences() once the AST is complete and all variable declarations exist. But the side effect is some get_type() operation may not recognize the unknown type before the fix. So far, I extended SgPointerDerefExp::get_type() and SgPntrArrRefExp::get_type() for SgTypeUnknown. There may be others needing the same extension.
| SgVarRefExp* SageBuilder::buildVarRefExp | ( | const std::string & | varName, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
Build SgVarRefExp based on a variable's name. It will lookup symbol table internally starting from scope. A variable is unique so type can be inferred.
| SgVarRefExp* SageBuilder::buildVarRefExp | ( | const char * | varName, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a variable reference using a C style char array.
| SgVarRefExp* SageBuilder::buildVarRefExp | ( | SgVariableSymbol * | varSymbol | ) |
Build a variable reference from an existing symbol.
| SgVarRefExp* SageBuilder::buildVarRefExp_nfi | ( | SgVariableSymbol * | varSymbol | ) |
| SgVarRefExp* SageBuilder::buildVarRefExp | ( | SgVariableDeclaration * | vardecl | ) |
Build a variable reference from an existing variable declaration. The assumption is a SgVariableDeclartion only declares one variable in the ROSE AST.
| SgVarRefExp* SageBuilder::buildVarRefExp | ( | SgInitializedName * | initname, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
build a variable reference from an initialized name It first tries to grab the associated symbol, then call buildVarRefExp(const SgName& name, SgScopeStatement*) if symbol does not exist.
| SgVarRefExp* SageBuilder::buildOpaqueVarRefExp | ( | const std::string & | varName, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a variable reference expression at scope to an opaque variable which has unknown information except for its name. Used when referring to an internal variable defined in some headers of runtime libraries.(The headers are not yet inserted into the file during translation). Similar to buildOpaqueType();.
It will declare a hidden int varName at the specified scope to cheat the AST consistence tests.
| SgFunctionRefExp* SageBuilder::buildFunctionRefExp | ( | const SgName & | name, | |
| const SgType * | func_type, | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
Build SgFunctionRefExp based on a C++ function's name and function type. It will lookup symbol table internally starting from scope. A hidden prototype will be created internally to introduce a new function symbol if the function symbol cannot be found.
| SgFunctionRefExp* SageBuilder::buildFunctionRefExp | ( | const char * | name, | |
| const SgType * | func_type, | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
| SgFunctionRefExp* SageBuilder::buildFunctionRefExp | ( | const SgName & | name, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
Build SgFunctionRefExp based on a C function's name. It will lookup symbol table internally starting from scope and return the first matching function.
| SgFunctionRefExp* SageBuilder::buildFunctionRefExp | ( | const char * | name, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
| SgFunctionRefExp* SageBuilder::buildFunctionRefExp | ( | const SgFunctionDeclaration * | func_decl | ) |
Build SgFunctionRefExp based on a function's declaration.
| SgFunctionRefExp* SageBuilder::buildFunctionRefExp | ( | SgFunctionSymbol * | sym | ) |
Build SgFunctionRefExp based on a function's symbol.
| SgFunctionRefExp* SageBuilder::buildFunctionRefExp_nfi | ( | SgFunctionSymbol * | sym | ) |
| SgMemberFunctionRefExp* SageBuilder::buildMemberFunctionRefExp_nfi | ( | SgMemberFunctionSymbol * | sym, | |
| bool | virtual_call, | |||
| bool | need_qualifier | |||
| ) |
| SgMemberFunctionRefExp* SageBuilder::buildMemberFunctionRefExp | ( | SgMemberFunctionSymbol * | sym, | |
| bool | virtual_call, | |||
| bool | need_qualifier | |||
| ) |
| SgClassNameRefExp* SageBuilder::buildClassNameRefExp_nfi | ( | SgClassSymbol * | sym | ) |
| SgClassNameRefExp* SageBuilder::buildClassNameRefExp | ( | SgClassSymbol * | sym | ) |
| SgFunctionCallExp* SageBuilder::buildFunctionCallExp | ( | SgFunctionSymbol * | sym, | |
| SgExprListExp * | parameters = NULL | |||
| ) |
Build a function call expression.
| SgFunctionCallExp* SageBuilder::buildFunctionCallExp_nfi | ( | SgExpression * | f, | |
| SgExprListExp * | parameters = NULL | |||
| ) |
| SgFunctionCallExp* SageBuilder::buildFunctionCallExp | ( | SgExpression * | f, | |
| SgExprListExp * | parameters = NULL | |||
| ) |
| SgFunctionCallExp* SageBuilder::buildFunctionCallExp | ( | const SgName & | name, | |
| SgType * | return_type, | |||
| SgExprListExp * | parameters = NULL, |
|||
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a function call expression,it will automatically search for function symbols internally to build a right function reference etc. It tolerates the lack of the function symbol to support generating calls to library functions whose headers have not yet been inserted.
| SgAssignInitializer* SageBuilder::buildAssignInitializer | ( | SgExpression * | operand_i = NULL, |
|
| SgType * | expression_type = NULL | |||
| ) |
Build the rhs of a variable declaration which includes an assignment.
| SgAssignInitializer* SageBuilder::buildAssignInitializer_nfi | ( | SgExpression * | operand_i = NULL, |
|
| SgType * | expression_type = NULL | |||
| ) |
| SgAggregateInitializer* SageBuilder::buildAggregateInitializer | ( | SgExprListExp * | initializers = NULL, |
|
| SgType * | type = NULL | |||
| ) |
Build an aggregate initializer.
| SgAggregateInitializer* SageBuilder::buildAggregateInitializer_nfi | ( | SgExprListExp * | initializers, | |
| SgType * | type = NULL | |||
| ) |
| SgConstructorInitializer* SageBuilder::buildConstructorInitializer | ( | SgMemberFunctionDeclaration * | declaration, | |
| SgExprListExp * | args, | |||
| SgType * | expression_type, | |||
| bool | need_name, | |||
| bool | need_qualifier, | |||
| bool | need_parenthesis_after_name, | |||
| bool | associated_class_unknown | |||
| ) |
| SgConstructorInitializer* SageBuilder::buildConstructorInitializer_nfi | ( | SgMemberFunctionDeclaration * | declaration, | |
| SgExprListExp * | args, | |||
| SgType * | expression_type, | |||
| bool | need_name, | |||
| bool | need_qualifier, | |||
| bool | need_parenthesis_after_name, | |||
| bool | associated_class_unknown | |||
| ) |
| SgSizeOfOp* SageBuilder::buildSizeOfOp | ( | SgExpression * | exp = NULL |
) |
Build sizeof() expression with an expression parameter.
| SgSizeOfOp* SageBuilder::buildSizeOfOp_nfi | ( | SgExpression * | exp | ) |
| SgSizeOfOp* SageBuilder::buildSizeOfOp | ( | SgType * | type = NULL |
) |
Build sizeof() expression with a type parameter.
| SgSizeOfOp* SageBuilder::buildSizeOfOp_nfi | ( | SgType * | type | ) |
| SgInitializedName* SageBuilder::buildInitializedName | ( | const SgName & | name, | |
| SgType * | type, | |||
| SgInitializer * | init = NULL | |||
| ) |
Initialized names are tricky, their scope vary depending on context, so scope and symbol information are not needed until the initialized name is being actually used somewhere.
e.g the scope of arguments of functions are different for defining and nondefining functions.
| SgInitializedName* SageBuilder::buildInitializedName | ( | const std::string & | name, | |
| SgType * | type | |||
| ) |
| SgInitializedName* SageBuilder::buildInitializedName | ( | const char * | name, | |
| SgType * | type | |||
| ) |
| SgInitializedName* SageBuilder::buildInitializedName_nfi | ( | const SgName & | name, | |
| SgType * | type, | |||
| SgInitializer * | init | |||
| ) |
| SgFunctionParameterTypeList* SageBuilder::buildFunctionParameterTypeList | ( | SgFunctionParameterList * | paralist | ) |
Build SgFunctionParameterTypeList from SgFunctionParameterList.
| SgFunctionParameterTypeList* SageBuilder::buildFunctionParameterTypeList | ( | SgExprListExp * | expList | ) |
Build SgFunctionParameterTypeList from an expression list, useful when building a function call.
| SgFunctionParameterTypeList* SageBuilder::buildFunctionParameterTypeList | ( | ) |
Build an empty SgFunctionParameterTypeList.
| SgVariableDeclaration* SageBuilder::buildVariableDeclaration | ( | const SgName & | name, | |
| SgType * | type, | |||
| SgInitializer * | varInit = NULL, |
|||
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a variable declaration, handle symbol table transparently.
| SgVariableDeclaration* SageBuilder::buildVariableDeclaration | ( | const std::string & | name, | |
| SgType * | type, | |||
| SgInitializer * | varInit = NULL, |
|||
| SgScopeStatement * | scope = NULL | |||
| ) |
| SgVariableDeclaration* SageBuilder::buildVariableDeclaration | ( | const char * | name, | |
| SgType * | type, | |||
| SgInitializer * | varInit = NULL, |
|||
| SgScopeStatement * | scope = NULL | |||
| ) |
| SgVariableDeclaration* SageBuilder::buildVariableDeclaration_nfi | ( | const SgName & | name, | |
| SgType * | type, | |||
| SgInitializer * | varInit, | |||
| SgScopeStatement * | scope | |||
| ) |
| SgTypedefDeclaration* SageBuilder::buildTypedefDeclaration | ( | const std::string & | name, | |
| SgType * | base_type, | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a typedef declaration, such as: typedef int myint;.
| SgTypedefDeclaration* SageBuilder::buildTypedefDeclaration_nfi | ( | const std::string & | name, | |
| SgType * | base_type, | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
| SgFunctionParameterList* SageBuilder::buildFunctionParameterList | ( | SgInitializedName * | in1 = NULL, |
|
| SgInitializedName * | in2 = NULL, |
|||
| SgInitializedName * | in3 = NULL, |
|||
| SgInitializedName * | in4 = NULL, |
|||
| SgInitializedName * | in5 = NULL, |
|||
| SgInitializedName * | in6 = NULL, |
|||
| SgInitializedName * | in7 = NULL, |
|||
| SgInitializedName * | in8 = NULL, |
|||
| SgInitializedName * | in9 = NULL, |
|||
| SgInitializedName * | in10 = NULL | |||
| ) |
Build an empty SgFunctionParameterList, possibly with some initialized names filled in.
| SgFunctionParameterList* SageBuilder::buildFunctionParameterList_nfi | ( | ) |
| SgFunctionParameterList* SageBuilder::buildFunctionParameterList | ( | SgFunctionParameterTypeList * | paraTypeList | ) |
Build an SgFunctionParameterList from SgFunctionParameterTypeList, like (int, float,...), used for parameter list of prototype functions when function type( including parameter type list) is known.
| SgFunctionParameterList* SageBuilder::buildFunctionParameterList_nfi | ( | SgFunctionParameterTypeList * | paraTypeList | ) |
| actualFunction* SageBuilder::buildNondefiningFunctionDeclaration_T | ( | const SgName & | name, | |
| SgType * | return_type, | |||
| SgFunctionParameterList * | paralist, | |||
| bool | isMemberFunction, | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
A template function for function prototype declaration builders.
| SgFunctionDeclaration* SageBuilder::buildNondefiningFunctionDeclaration | ( | const SgName & | name, | |
| SgType * | return_type, | |||
| SgFunctionParameterList * | parlist, | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a prototype for a function, handle function type, symbol etc transparently.
| SgFunctionDeclaration* SageBuilder::buildNondefiningFunctionDeclaration | ( | const SgFunctionDeclaration * | funcdecl, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a prototype for an existing function declaration (defining or nondefining is fine).
| SgMemberFunctionDeclaration* SageBuilder::buildNondefiningMemberFunctionDeclaration | ( | const SgName & | name, | |
| SgType * | return_type, | |||
| SgFunctionParameterList * | parlist, | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a prototype member function declaration.
| SgMemberFunctionDeclaration* SageBuilder::buildDefiningMemberFunctionDeclaration | ( | const SgName & | name, | |
| SgType * | return_type, | |||
| SgFunctionParameterList * | parlist, | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a defining ( non-prototype) member function declaration.
| SgMemberFunctionDeclaration* SageBuilder::buildNondefiningMemberFunctionDeclaration | ( | const SgMemberFunctionDeclaration * | funcdecl, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a prototype for an existing member function declaration (defining or nondefining is fine).
| actualFunction* SageBuilder::buildDefiningFunctionDeclaration_T | ( | const SgName & | name, | |
| SgType * | return_type, | |||
| SgFunctionParameterList * | parlist, | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
A template function for function declaration builders.
| SgFunctionDeclaration* SageBuilder::buildDefiningFunctionDeclaration | ( | const SgName & | name, | |
| SgType * | return_type, | |||
| SgFunctionParameterList * | parlist, | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a function declaration with a function body.
| SgFunctionDeclaration* SageBuilder::buildDefiningFunctionDeclaration | ( | const std::string & | name, | |
| SgType * | return_type, | |||
| SgFunctionParameterList * | parlist, | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
| SgFunctionDeclaration* SageBuilder::buildDefiningFunctionDeclaration | ( | const char * | name, | |
| SgType * | return_type, | |||
| SgFunctionParameterList * | parlist, | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
| SgProcedureHeaderStatement* SageBuilder::buildProcedureHeaderStatement | ( | const char * | name, | |
| SgType * | return_type, | |||
| SgFunctionParameterList * | parlist, | |||
| SgProcedureHeaderStatement::subprogram_kind_enum | , | |||
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a Fortran subroutine or procedure.
| SgExprStatement* SageBuilder::buildFunctionCallStmt | ( | const SgName & | name, | |
| SgType * | return_type, | |||
| SgExprListExp * | parameters = NULL, |
|||
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a regular function call statement.
| SgExprStatement* SageBuilder::buildFunctionCallStmt | ( | SgExpression * | function, | |
| SgExprListExp * | parameters = NULL | |||
| ) |
Build a function call statement using function expression and argument list only, like (*funcPtr)(args);.
| SgLabelStatement* SageBuilder::buildLabelStatement | ( | const SgName & | name, | |
| SgStatement * | stmt = NULL, |
|||
| SgScopeStatement * | scope = NULL | |||
| ) |
Note that the scope of a label statement is special.
It is SgFunctionDefinition, not the closest scope statement such as SgBasicBlock.
| SgLabelStatement* SageBuilder::buildLabelStatement_nfi | ( | const SgName & | name, | |
| SgStatement * | stmt, | |||
| SgScopeStatement * | scope | |||
| ) |
| SgGotoStatement* SageBuilder::buildGotoStatement | ( | SgLabelStatement * | label = NULL |
) |
Build a goto statement.
| SgGotoStatement* SageBuilder::buildGotoStatement_nfi | ( | SgLabelStatement * | label | ) |
| SgCaseOptionStmt* SageBuilder::buildCaseOptionStmt | ( | SgExpression * | key = NULL, |
|
| SgStatement * | body = NULL | |||
| ) |
Build a case option statement.
| SgCaseOptionStmt* SageBuilder::buildCaseOptionStmt_nfi | ( | SgExpression * | key, | |
| SgStatement * | body | |||
| ) |
| SgDefaultOptionStmt* SageBuilder::buildDefaultOptionStmt | ( | SgStatement * | body = NULL |
) |
Build a default option statement.
| SgDefaultOptionStmt* SageBuilder::buildDefaultOptionStmt_nfi | ( | SgStatement * | body | ) |
| SgExprStatement* SageBuilder::buildExprStatement | ( | SgExpression * | exp = NULL |
) |
Build a SgExprStatement, set File_Info automatically.
| SgExprStatement* SageBuilder::buildExprStatement_nfi | ( | SgExpression * | exp | ) |
| SgSwitchStatement* SageBuilder::buildSwitchStatement | ( | SgStatement * | item_selector = NULL, |
|
| SgStatement * | body = NULL | |||
| ) |
Build a switch statement.
| SgSwitchStatement* SageBuilder::buildSwitchStatement | ( | SgExpression * | item_selector, | |
| SgStatement * | body = NULL | |||
| ) | [inline] |
| SgSwitchStatement* SageBuilder::buildSwitchStatement_nfi | ( | SgStatement * | item_selector, | |
| SgStatement * | body | |||
| ) |
| SgIfStmt* SageBuilder::buildIfStmt | ( | SgStatement * | conditional, | |
| SgStatement * | true_body, | |||
| SgStatement * | false_body | |||
| ) |
Build if statement.
| SgIfStmt* SageBuilder::buildIfStmt | ( | SgExpression * | conditional, | |
| SgStatement * | true_body, | |||
| SgStatement * | false_body | |||
| ) | [inline] |
| SgIfStmt* SageBuilder::buildIfStmt_nfi | ( | SgStatement * | conditional, | |
| SgStatement * | true_body, | |||
| SgStatement * | false_body | |||
| ) |
| SgForStatement* SageBuilder::buildForStatement | ( | SgStatement * | initialize_stmt, | |
| SgStatement * | test, | |||
| SgExpression * | increment, | |||
| SgStatement * | loop_body | |||
| ) |
Build a for statement, assume none of the arguments is NULL.
| SgForStatement* SageBuilder::buildForStatement_nfi | ( | SgStatement * | initialize_stmt, | |
| SgStatement * | test, | |||
| SgExpression * | increment, | |||
| SgStatement * | loop_body | |||
| ) |
| SgUpcForAllStatement* SageBuilder::buildUpcForAllStatement_nfi | ( | SgStatement * | initialize_stmt, | |
| SgStatement * | test, | |||
| SgExpression * | increment, | |||
| SgExpression * | affinity, | |||
| SgStatement * | loop_body | |||
| ) |
Build a UPC forall statement.
| SgWhileStmt* SageBuilder::buildWhileStmt | ( | SgStatement * | condition, | |
| SgStatement * | body | |||
| ) |
Build while statement.
| SgWhileStmt* SageBuilder::buildWhileStmt | ( | SgExpression * | condition, | |
| SgStatement * | body | |||
| ) | [inline] |
| SgWhileStmt* SageBuilder::buildWhileStmt_nfi | ( | SgStatement * | condition, | |
| SgStatement * | body | |||
| ) |
| SgDoWhileStmt* SageBuilder::buildDoWhileStmt | ( | SgStatement * | body, | |
| SgStatement * | condition | |||
| ) |
Build do-while statement.
| SgDoWhileStmt* SageBuilder::buildDoWhileStmt | ( | SgStatement * | body, | |
| SgExpression * | condition | |||
| ) | [inline] |
| SgDoWhileStmt* SageBuilder::buildDoWhileStmt_nfi | ( | SgStatement * | body, | |
| SgStatement * | condition | |||
| ) |
| SgPragmaDeclaration* SageBuilder::buildPragmaDeclaration | ( | const std::string & | name, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
Build pragma declaration, handle SgPragma and defining/nondefining pointers internally.
| SgPragmaDeclaration* SageBuilder::buildPragmaDeclaration_nfi | ( | const std::string & | name, | |
| SgScopeStatement * | scope | |||
| ) |
| SgBasicBlock* SageBuilder::buildBasicBlock | ( | SgStatement * | stmt1 = NULL, |
|
| SgStatement * | stmt2 = NULL, |
|||
| SgStatement * | stmt3 = NULL, |
|||
| SgStatement * | stmt4 = NULL, |
|||
| SgStatement * | stmt5 = NULL, |
|||
| SgStatement * | stmt6 = NULL, |
|||
| SgStatement * | stmt7 = NULL, |
|||
| SgStatement * | stmt8 = NULL, |
|||
| SgStatement * | stmt9 = NULL, |
|||
| SgStatement * | stmt10 = NULL | |||
| ) |
Build a SgBasicBlock, setting file info internally.
| SgBasicBlock* SageBuilder::buildBasicBlock_nfi | ( | ) |
| SgBasicBlock* SageBuilder::buildBasicBlock_nfi | ( | const std::vector< SgStatement * > & | ) |
| SgExprStatement* SageBuilder::buildAssignStatement | ( | SgExpression * | lhs, | |
| SgExpression * | rhs | |||
| ) |
Build an assignment statement from lefthand operand and right hand operand.
| SgBreakStmt* SageBuilder::buildBreakStmt | ( | ) |
Build a break statement.
| SgBreakStmt* SageBuilder::buildBreakStmt_nfi | ( | ) |
| SgContinueStmt* SageBuilder::buildContinueStmt | ( | ) |
Build a continue statement.
| SgContinueStmt* SageBuilder::buildContinueStmt_nfi | ( | ) |
| SgClassDefinition* SageBuilder::buildClassDefinition | ( | SgClassDeclaration * | d = NULL |
) |
Build a class definition scope statement.
| SgClassDefinition* SageBuilder::buildClassDefinition_nfi | ( | SgClassDeclaration * | d = NULL |
) |
Build a class definition scope statement.
| SgClassDeclaration* SageBuilder::buildNondefiningClassDeclaration_nfi | ( | const SgName & | name, | |
| SgClassDeclaration::class_types | kind, | |||
| SgScopeStatement * | scope | |||
| ) |
Build a structure first nondefining declaration, without file info.
| SgClassDeclaration* SageBuilder::buildNondefiningClassDeclaration | ( | SgName | name, | |
| SgScopeStatement * | scope | |||
| ) |
| SgClassDeclaration* SageBuilder::buildDefiningClassDeclaration | ( | SgName | name, | |
| SgScopeStatement * | scope | |||
| ) |
| SgClassDeclaration* SageBuilder::buildClassDeclaration | ( | SgName | name, | |
| SgScopeStatement * | scope | |||
| ) |
| SgEnumDeclaration* SageBuilder::buildNondefiningEnumDeclaration_nfi | ( | const SgName & | name, | |
| SgScopeStatement * | scope | |||
| ) |
Build an enum first nondefining declaration, without file info.
| SgClassDeclaration* SageBuilder::buildStructDeclaration | ( | const SgName & | name, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
Build a structure, It is also a declaration statement in SAGE III.
| SgClassDeclaration* SageBuilder::buildStructDeclaration | ( | const std::string & | name, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
| SgClassDeclaration* SageBuilder::buildStructDeclaration | ( | const char * | name, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
| SgNamespaceDeclarationStatement* SageBuilder::buildNamespaceDeclaration | ( | const SgName & | name, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
| SgNamespaceDeclarationStatement* SageBuilder::buildNamespaceDeclaration_nfi | ( | const SgName & | name, | |
| bool | unnamednamespace, | |||
| SgScopeStatement * | scope | |||
| ) |
| SgNamespaceDefinitionStatement* SageBuilder::buildNamespaceDefinition | ( | SgNamespaceDeclarationStatement * | d = NULL |
) |
| SgClassDeclaration* SageBuilder::buildClassDeclaration_nfi | ( | const SgName & | name, | |
| SgClassDeclaration::class_types | kind, | |||
| SgScopeStatement * | scope, | |||
| SgClassDeclaration * | nonDefiningDecl | |||
| ) |
| SgEnumDeclaration* SageBuilder::buildEnumDeclaration | ( | const SgName & | name, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
Build an enum, It is also a declaration statement in SAGE III.
| SgEnumDeclaration* SageBuilder::buildEnumDeclaration_nfi | ( | const SgName & | name, | |
| SgScopeStatement * | scope = NULL | |||
| ) |
Build an enum, It is also a declaration statement in SAGE III.
| SgReturnStmt* SageBuilder::buildReturnStmt | ( | SgExpression * | expression = NULL |
) |
Build a return statement.
| SgReturnStmt* SageBuilder::buildReturnStmt_nfi | ( | SgExpression * | expression | ) |
| SgNullStatement* SageBuilder::buildNullStatement | ( | ) |
Build a NULL statement.
| SgNullStatement* SageBuilder::buildNullStatement_nfi | ( | ) |
| SgAsmStmt* SageBuilder::buildAsmStatement | ( | std::string | s | ) |
Build a NULL statement.
| SgAsmStmt* SageBuilder::buildAsmStatement_nfi | ( | std::string | s | ) |
| SgAsmStmt* SageBuilder::buildMultibyteNopStatement | ( | int | n | ) |
| SgFile* SageBuilder::buildFile | ( | const std::string & | inputFileName, | |
| const std::string & | outputFileName, | |||
| SgProject * | project = NULL | |||
| ) |
Build a SgFile node and attach it to SgProject.
The input file will be loaded if exists, or an empty one will be generated from scratch transparently. Output file name is used to specify the output file name of unparsing. The final SgFile will be inserted to project automatically. If not provided, a new SgProject will be generated internally. Using SgFile->get_project() to retrieve it in this case.
| PreprocessingInfo* SageBuilder::buildComment | ( | SgLocatedNode * | target, | |
| const std::string & | content, | |||
| PreprocessingInfo::RelativePositionType | position = PreprocessingInfo::before, |
|||
| PreprocessingInfo::DirectiveType | dtype = PreprocessingInfo::CpreprocessorUnknownDeclaration | |||
| ) |
Build and attach a comment, comment style is inferred from the language type of the target node if not provided. It is indeed a wrapper of SageInterface::attachComment().
| PreprocessingInfo* SageBuilder::buildCpreprocessorDefineDeclaration | ( | SgLocatedNode * | target, | |
| const std::string & | content, | |||
| PreprocessingInfo::RelativePositionType | position = PreprocessingInfo::before | |||
| ) |
Build and attach define XX directives, pass "#define xxx xxx" as content.
| AbstractHandle::abstract_handle* SageBuilder::buildAbstractHandle | ( | SgNode * | n | ) |
Build an abstract handle from a SgNode.
| std::list<SgScopeStatement*> SageBuilder::ScopeStack |
intended to be a private member, don't access it directly. could be changed any time
1.4.7