ROSE 0.11.145.354
sageBuilder.h
1#ifndef ROSE_SAGE_BUILDER_INTERFACE
2#define ROSE_SAGE_BUILDER_INTERFACE
3
4#include <string>
5
20#include "sageInterface.h"
21
22#include <Rose/Diagnostics.h>
23
24// forward declarations required for templated functions using those functions
25namespace SageInterface {
26 ROSE_DLL_API void setOneSourcePositionForTransformation (SgNode * root);
27 ROSE_DLL_API void setSourcePosition(SgNode* node);
28}
29
31namespace SageBuilder
32{
33
34// DQ (3/24/2016): Adding Robb's meageage mechanism (data member and function).
35 extern Sawyer::Message::Facility mlog;
36 void initDiagnostics();
37
38
39#if 0
40//---------------------AST creation/building/construction-----------------
41 SgExpression* buildConst(SgType* t, const string & val);
42 SgExpression* buildConstInt(int val);
43
44 // build sth in languages, but not in SAGE AST
45 // how to specify position info? then
46
48 // or
49 SgClassDeclaration* buildStruct(...);
50 SgClassDeclaration* buildClass(...);
51 SgClassDeclaration* buildUnion(...);
52
53 // build B from dependent A
54 SgTemplateInstantiationMemberFunctionDecl* buildForwardFunctionDeclaration
55 (SgTemplateInstantiationMemberFunctionDecl * memberFunctionInstantiation);
56
57 //previous attempt: src/midend/astUtil/astInterface
58 // AstNodePtr AstInterface::CreateConst( const string& val, const string& valtype) const
59 // AstNodePtr AstInterfaceBase::CreateConstInt( int val)
60#endif
61
62//----------------------------------------------------------
64
79extern std::list<SgScopeStatement*> ScopeStack;
80
81// DQ (11/30/2010): Added support for building Fortran case insensitive symbol table handling.
84
86ROSE_DLL_API void pushScopeStack (SgScopeStatement* stmt);
87
88// DQ (3/20/2017): This function is not called (the function above is the more useful one that is used).
89// ROSE_DLL_API void pushScopeStack (SgNode* node);
90
91ROSE_DLL_API void popScopeStack();
92ROSE_DLL_API SgScopeStatement* topScopeStack();
93ROSE_DLL_API bool emptyScopeStack();
94ROSE_DLL_API void clearScopeStack();
95
96// DQ (3/11/2012): Added new function to the API for the internal scope stack.
99
100// DQ (3/20/2017): This function is not used.
101// bool isInScopeStack(SgScopeStatement * scope);
102
103bool inSwitchScope();
104
105// DQ (3/20/2017): This function is not used.
106// TV: for debug purpose
107// std::string stringFromScopeStack();
108
109
111
112#if 0
113// DQ (3/20/2017): These functions are not used (suggest using the API in the symbol table initialization).
114//----------------------------------------------------------
116
123ROSE_DLL_API void setCaseInsensitive();
125ROSE_DLL_API void setCaseSensitive();
127ROSE_DLL_API void setCaseFromScope(SgScopeStatement* scope);
128
130#endif
131
132
133// *************************************************************************************************************
134// DQ (5/1/2012): This is another possible interface: supporting how we set the source code position and mark is
135// as either a transformation or as actual code to be assigned a source position as part of the AST construction.
136// *************************************************************************************************************
137
148
151
154
156ROSE_DLL_API std::string display(SourcePositionClassification & scp);
157
160
162ROSE_DLL_API SgName appendTemplateArgumentsToName( const SgName & name, const SgTemplateArgumentPtrList & templateArgumentsList);
163
166
167// *************************************************************************************************************
168
169
170
171//--------------------------------------------------------------
173
180ROSE_DLL_API SgTypeBool * buildBoolType();
181ROSE_DLL_API SgTypeNullptr* buildNullptrType();
182ROSE_DLL_API SgTypeChar * buildCharType();
183ROSE_DLL_API SgTypeDouble* buildDoubleType();
184ROSE_DLL_API SgTypeFloat* buildFloatType();
185ROSE_DLL_API SgTypeInt * buildIntType();
186ROSE_DLL_API SgTypeLong* buildLongType();
188ROSE_DLL_API SgTypeLongLong * buildLongLongType();
189ROSE_DLL_API SgTypeShort* buildShortType();
190ROSE_DLL_API SgTypeFloat80* buildFloat80Type();
191ROSE_DLL_API SgTypeFloat128* buildFloat128Type();
192ROSE_DLL_API SgTypeFloat16* buildFloat16Type();
193ROSE_DLL_API SgTypeFp16* buildFp16Type();
194ROSE_DLL_API SgTypeBFloat16* buildBFloat16Type();
195ROSE_DLL_API SgTypeFloat32x* buildFloat32xType();
196ROSE_DLL_API SgTypeFloat64x* buildFloat64xType();
197ROSE_DLL_API SgTypeFloat32* buildFloat32Type();
198ROSE_DLL_API SgTypeFloat64* buildFloat64Type();
199
200// CR (2/20/2020): Added builder for Jovial fixed type
202ROSE_DLL_API SgTypeFixed* buildFixedType(SgExpression* fraction, SgExpression* scale);
203
204// CR (5/5/2020): Added builder for Jovial bit type
207
209ROSE_DLL_API SgTypeString* buildStringType();
210// SgTypeString* buildStringType( SgExpression* stringLengthExpression, size_t stringLengthLiteral );
211ROSE_DLL_API SgTypeString* buildStringType( SgExpression* stringLengthExpression );
212
213ROSE_DLL_API SgTypeVoid * buildVoidType();
214ROSE_DLL_API SgTypeWchar* buildWcharType();
215
216// DQ (2/16/2018): Adding support for char16_t and char32_t (C99 and C++11 specific types).
217ROSE_DLL_API SgTypeChar16* buildChar16Type();
218ROSE_DLL_API SgTypeChar32* buildChar32Type();
219
221ROSE_DLL_API SgTypeSignedInt* buildSignedIntType();
225
226#if 1
229#endif
230
236ROSE_DLL_API SgTypeUnknown * buildUnknownType();
237
238ROSE_DLL_API SgAutoType * buildAutoType();
239
240// CR (2/20/2020): Added builder functions for type size (kind) expressions for Fortran and Jovial
242ROSE_DLL_API SgTypeBool * buildBoolType(SgExpression* kind_expr);
243ROSE_DLL_API SgTypeInt * buildIntType(SgExpression* kind_expr);
244ROSE_DLL_API SgTypeFloat * buildFloatType(SgExpression* kind_expr);
245ROSE_DLL_API SgTypeUnsignedInt* buildUnsignedIntType(SgExpression* kind_expr);
246
251
253ROSE_DLL_API SgPointerType* buildPointerType(SgType *base_type = nullptr);
254
256ROSE_DLL_API SgReferenceType* buildReferenceType(SgType *base_type = nullptr);
257
260
262ROSE_DLL_API SgDeclType* buildDeclType(SgExpression *base_expression, SgType* base_type);
263
265ROSE_DLL_API SgTypeOfType* buildTypeOfType(SgExpression *base_expression, SgType* base_type);
266
268ROSE_DLL_API SgModifierType* buildModifierType(SgType* base_type = nullptr);
269
271ROSE_DLL_API SgModifierType* buildConstType(SgType* base_type = nullptr);
272
276ROSE_DLL_API SgModifierType* buildAliasedType(SgType* base_type);
277
281ROSE_DLL_API SgModifierType* buildNotNullType(SgType* base_type);
282
284ROSE_DLL_API SgModifierType* buildVolatileType(SgType* base_type = nullptr);
285
287ROSE_DLL_API SgModifierType* buildConstVolatileType(SgType* base_type = nullptr);
288
290ROSE_DLL_API SgModifierType* buildRestrictType(SgType* base_type);
291
293ROSE_DLL_API SgArrayType* buildArrayType(SgType* base_type=nullptr, SgExpression* index=nullptr);
294
295// RASMUSSEN (1/25/2018)
303ROSE_DLL_API SgArrayType* buildArrayType(SgType* base_type, SgExprListExp* dim_info);
304
305// DQ (8/27/2010): Added Fortran specific support for types based on kind expressions.
307ROSE_DLL_API SgModifierType* buildFortranKindType(SgType* base_type, SgExpression* kindExpression );
308
310ROSE_DLL_API SgFunctionType* buildFunctionType(SgType* return_type, SgFunctionParameterTypeList * typeList=nullptr);
311
313ROSE_DLL_API SgFunctionType* buildFunctionType(SgType* return_type, SgFunctionParameterList * argList=nullptr);
314
315// DQ (1/10/2020): removed the default argument since we need to make sure it is used.
316ROSE_DLL_API SgMemberFunctionType* buildMemberFunctionType(SgType* return_type, SgFunctionParameterTypeList * typeList, SgScopeStatement *struct_name, unsigned int mfunc_specifier);
317
319ROSE_DLL_API SgMemberFunctionType* buildMemberFunctionType(SgType* return_type, SgFunctionParameterTypeList* typeList, SgType *classType, unsigned int mfunc_specifier);
320
322ROSE_DLL_API SgPointerMemberType* buildPointerMemberType(SgType* base_type, SgType* classType);
323
324// PP (07/14/2016):
338ROSE_DLL_API
340buildClassTemplateType(SgTemplateClassDeclaration* template_decl, Rose_STL_Container<SgNode *>& template_args);
341
343ROSE_DLL_API
345buildTemplateClassType(SgTemplateClassDeclaration* template_decl, Rose_STL_Container<SgNode *>& template_args);
346
348
354ROSE_DLL_API SgType* buildOpaqueType(std::string const type_name, SgScopeStatement * scope);
355
356// DQ (7/29/2010): Changed return type from SgType to SgModifierType for a number of the functions below.
358ROSE_DLL_API SgModifierType* buildUpcStrictType(SgType *base_type = nullptr);
359
361ROSE_DLL_API SgModifierType* buildUpcRelaxedType(SgType *base_type = nullptr);
362
364ROSE_DLL_API SgModifierType* buildUpcSharedType(SgType *base_type = nullptr, long layout = -1);
365
367ROSE_DLL_API SgModifierType* buildUpcBlockIndefiniteType(SgType *base_type = nullptr);
368
370ROSE_DLL_API SgModifierType* buildUpcBlockStarType(SgType *base_type = nullptr);
371
373ROSE_DLL_API SgModifierType* buildUpcBlockNumberType(SgType *base_type, long block_factor);
374
376ROSE_DLL_API SgTypeComplex* buildComplexType(SgType *base_type = nullptr);
377
379ROSE_DLL_API SgTypeImaginary* buildImaginaryType(SgType *base_type = nullptr);
380
383
385ROSE_DLL_API SgTypeMatrix* buildMatrixType();
386
388ROSE_DLL_API SgTypeTuple* buildTupleType(SgType *t1 = NULL, SgType *t2 = NULL, SgType *t3 = NULL, SgType *t4 = NULL, SgType *t5 = NULL, SgType *t6 = NULL, SgType *t7 = NULL, SgType *t8 = NULL, SgType *t9 = NULL, SgType *t10 = NULL);
389
391ROSE_DLL_API SgNonrealType* buildNonrealType(const SgName & name, SgDeclarationScope* scope);
392
394
395//--------------------------------------------------------------
397
409// JJW (11/19/2008): _nfi versions of functions set file info objects to NULL (used in frontend)
410
412
417
419ROSE_DLL_API SgColonShapeExp* buildColonShapeExp();
422
424ROSE_DLL_API SgBoolValExp* buildBoolValExp(int value = 0);
425ROSE_DLL_API SgBoolValExp* buildBoolValExp(bool value = 0);
426ROSE_DLL_API SgBoolValExp* buildBoolValExp_nfi(int value);
427
428ROSE_DLL_API SgCharVal* buildCharVal(char value = 0);
429ROSE_DLL_API SgCharVal* buildCharVal_nfi(char value, const std::string& str);
430
432ROSE_DLL_API SgNullptrValExp* buildNullptrValExp();
434
436ROSE_DLL_API SgVoidVal* buildVoidVal();
437ROSE_DLL_API SgVoidVal* buildVoidVal_nfi();
438
439ROSE_DLL_API SgWcharVal* buildWcharVal(wchar_t value = 0);
440ROSE_DLL_API SgWcharVal* buildWcharVal_nfi(wchar_t value, const std::string& str);
441
442// DQ (2/16/2018): Adding support for char16_t and char32_t (C99 and C++11 specific types).
443ROSE_DLL_API SgChar16Val* buildChar16Val(unsigned short value = 0);
444ROSE_DLL_API SgChar16Val* buildChar16Val_nfi(unsigned short value, const std::string& str);
445ROSE_DLL_API SgChar32Val* buildChar32Val(unsigned int value = 0);
446ROSE_DLL_API SgChar32Val* buildChar32Val_nfi(unsigned int value, const std::string& str);
447
448// DQ (3/20/2017): This function has never existed (inputs must be SgValueExp pointers).
449// ROSE_DLL_API SgComplexVal* buildComplexVal(long double real_value = 0.0, long double imaginary_value = 0.0 );
450ROSE_DLL_API SgComplexVal* buildComplexVal(SgValueExp* real_value, SgValueExp* imaginary_value);
451ROSE_DLL_API SgComplexVal* buildComplexVal_nfi(SgValueExp* real_value, SgValueExp* imaginary_value, const std::string& str);
452ROSE_DLL_API SgComplexVal* buildImaginaryVal(long double imaginary_value);
453ROSE_DLL_API SgComplexVal* buildImaginaryVal(SgValueExp* imaginary_value);
454ROSE_DLL_API SgComplexVal* buildImaginaryVal_nfi(SgValueExp* imaginary_value, const std::string& str);
455
457ROSE_DLL_API SgDoubleVal* buildDoubleVal(double value = 0.0);
458ROSE_DLL_API SgDoubleVal* buildDoubleVal_nfi(double value, const std::string& str);
459
460ROSE_DLL_API SgFloatVal* buildFloatVal(float value = 0.0);
461ROSE_DLL_API SgFloatVal* buildFloatVal_nfi(float value = 0.0);
462ROSE_DLL_API SgFloatVal* buildFloatVal_nfi(float value, const std::string& str);
464ROSE_DLL_API SgFloatVal* buildFloatVal_nfi(const std::string& str);
465
467ROSE_DLL_API SgIntVal* buildIntVal(int value = 0);
468ROSE_DLL_API SgIntVal* buildIntValHex(int value = 0);
469ROSE_DLL_API SgIntVal* buildIntVal_nfi(int value = 0);
470ROSE_DLL_API SgIntVal* buildIntVal_nfi(int value, const std::string& str);
472ROSE_DLL_API SgIntVal* buildIntVal_nfi(const std::string& str);
473
475ROSE_DLL_API SgLongIntVal* buildLongIntVal(long value = 0);
476ROSE_DLL_API SgLongIntVal* buildLongIntValHex(long value = 0);
477ROSE_DLL_API SgLongIntVal* buildLongIntVal_nfi(long value, const std::string& str);
478
480ROSE_DLL_API SgLongLongIntVal* buildLongLongIntVal(long long value = 0);
481ROSE_DLL_API SgLongLongIntVal* buildLongLongIntValHex(long long value = 0);
482ROSE_DLL_API SgLongLongIntVal* buildLongLongIntVal_nfi(long long value, const std::string& str);
483// !Build enum val without file info: nfi
484ROSE_DLL_API SgEnumVal* buildEnumVal_nfi(long long int value, SgEnumDeclaration* decl, SgName name);
485// !Build enum val with transformation file info
486ROSE_DLL_API SgEnumVal* buildEnumVal(long long int value, SgEnumDeclaration* decl, SgName name);
487ROSE_DLL_API SgEnumVal* buildEnumVal(SgEnumFieldSymbol * sym);
488
489ROSE_DLL_API SgLongDoubleVal* buildLongDoubleVal(long double value = 0.0);
490ROSE_DLL_API SgLongDoubleVal* buildLongDoubleVal_nfi(long double value, const std::string& str);
491
492ROSE_DLL_API SgFloat80Val* buildFloat80Val(long double value = 0.0);
493ROSE_DLL_API SgFloat80Val* buildFloat80Val_nfi(long double value, const std::string& str);
494
495ROSE_DLL_API SgFloat128Val* buildFloat128Val(long double value = 0.0);
496ROSE_DLL_API SgFloat128Val* buildFloat128Val_nfi(long double value, const std::string& str);
497
499ROSE_DLL_API SgBFloat16Val* buildBFloat16Val(float v = 0);
500ROSE_DLL_API SgBFloat16Val* buildBFloat16Val_nfi(float v, const std::string& str);
501
503ROSE_DLL_API SgFloat16Val* buildFloat16Val(float v = 0);
504ROSE_DLL_API SgFloat16Val* buildFloat16Val_nfi(float v, const std::string& str);
505
507ROSE_DLL_API SgFloat32Val* buildFloat32Val(float v = 0);
508ROSE_DLL_API SgFloat32Val* buildFloat32Val_nfi(float v, const std::string& str);
509
511ROSE_DLL_API SgFloat64Val* buildFloat64Val(double v = 0);
512ROSE_DLL_API SgFloat64Val* buildFloat64Val_nfi(double v, const std::string& str);
513
514ROSE_DLL_API SgShortVal* buildShortVal(short value = 0);
515ROSE_DLL_API SgShortVal* buildShortValHex(short value = 0);
516ROSE_DLL_API SgShortVal* buildShortVal_nfi(short value, const std::string& str);
517
518ROSE_DLL_API SgStringVal* buildStringVal(std::string value="");
519ROSE_DLL_API SgStringVal* buildStringVal_nfi(std::string value);
520
522ROSE_DLL_API SgUnsignedCharVal* buildUnsignedCharVal(unsigned char v = 0);
523ROSE_DLL_API SgUnsignedCharVal* buildUnsignedCharValHex(unsigned char v = 0);
524ROSE_DLL_API SgUnsignedCharVal* buildUnsignedCharVal_nfi(unsigned char v, const std::string& str);
525
527ROSE_DLL_API SgSignedCharVal* buildSignedCharVal(signed char v = 0);
528ROSE_DLL_API SgSignedCharVal* buildSignedCharValHex(signed char v = 0);
529ROSE_DLL_API SgSignedCharVal* buildSignedCharVal_nfi(signed char v, const std::string& str);
530
532ROSE_DLL_API SgUnsignedShortVal* buildUnsignedShortVal(unsigned short v = 0);
533ROSE_DLL_API SgUnsignedShortVal* buildUnsignedShortValHex(unsigned short v = 0);
534ROSE_DLL_API SgUnsignedShortVal* buildUnsignedShortVal_nfi(unsigned short v, const std::string& str);
535
537ROSE_DLL_API SgUnsignedIntVal* buildUnsignedIntVal(unsigned int v = 0);
538ROSE_DLL_API SgUnsignedIntVal* buildUnsignedIntValHex(unsigned int v = 0);
539ROSE_DLL_API SgUnsignedIntVal* buildUnsignedIntVal_nfi(unsigned int v, const std::string& str);
540
542ROSE_DLL_API SgUnsignedLongVal* buildUnsignedLongVal(unsigned long v = 0);
543ROSE_DLL_API SgUnsignedLongVal* buildUnsignedLongValHex(unsigned long v = 0);
544ROSE_DLL_API SgUnsignedLongVal* buildUnsignedLongVal_nfi(unsigned long v, const std::string& str);
545
547ROSE_DLL_API SgUnsignedLongLongIntVal* buildUnsignedLongLongIntVal(unsigned long long v = 0);
548ROSE_DLL_API SgUnsignedLongLongIntVal* buildUnsignedLongLongIntValHex(unsigned long long v = 0);
549ROSE_DLL_API SgUnsignedLongLongIntVal* buildUnsignedLongLongIntVal_nfi(unsigned long long v, const std::string& str);
550
552ROSE_DLL_API SgJovialBitVal* buildJovialBitVal_nfi(const std::string& str);
553
555ROSE_DLL_API SgTemplateParameterVal* buildTemplateParameterVal(int template_parameter_position = -1);
556ROSE_DLL_API SgTemplateParameterVal* buildTemplateParameterVal_nfi(int template_parameter_position, const std::string& str);
557
559ROSE_DLL_API SgTemplateType* buildTemplateType(SgName name="");
560
564
566ROSE_DLL_API SgNonrealDecl * buildNonrealDecl(const SgName & name, SgDeclarationScope * scope, SgDeclarationScope * child_scope = NULL);
567
570
572ROSE_DLL_API SgUpcThreads* buildUpcThreads();
573ROSE_DLL_API SgUpcThreads* buildUpcThreads_nfi();
574
576ROSE_DLL_API SgUpcMythread* buildUpcMythread();
577ROSE_DLL_API SgUpcMythread* buildUpcMythread_nfi();
578
580ROSE_DLL_API SgThisExp* buildThisExp(SgSymbol* sym);
581ROSE_DLL_API SgThisExp* buildThisExp_nfi(SgSymbol* sym);
582
584ROSE_DLL_API SgSuperExp* buildSuperExp(SgClassSymbol* sym);
585ROSE_DLL_API SgSuperExp* buildSuperExp_nfi(SgClassSymbol* sym);
586
588ROSE_DLL_API SgClassExp* buildClassExp(SgClassSymbol* sym);
589ROSE_DLL_API SgClassExp* buildClassExp_nfi(SgClassSymbol* sym);
590
592ROSE_DLL_API SgLambdaRefExp* buildLambdaRefExp(SgType* return_type, SgFunctionParameterList* params, SgScopeStatement* scope);
593
594#define BUILD_UNARY_PROTO(suffix) \
595ROSE_DLL_API Sg##suffix * build##suffix(SgExpression* op =NULL); \
596ROSE_DLL_API Sg##suffix * build##suffix##_nfi(SgExpression* op);
597
598BUILD_UNARY_PROTO(AddressOfOp)
599BUILD_UNARY_PROTO(BitComplementOp)
600BUILD_UNARY_PROTO(MinusOp)
601BUILD_UNARY_PROTO(NotOp)
602BUILD_UNARY_PROTO(PointerDerefExp)
603BUILD_UNARY_PROTO(UnaryAddOp)
604BUILD_UNARY_PROTO(MinusMinusOp)
605BUILD_UNARY_PROTO(PlusPlusOp)
606BUILD_UNARY_PROTO(RealPartOp)
607BUILD_UNARY_PROTO(ImagPartOp)
608BUILD_UNARY_PROTO(ConjugateOp)
609BUILD_UNARY_PROTO(VarArgStartOneOperandOp)
610BUILD_UNARY_PROTO(VarArgEndOp)
611BUILD_UNARY_PROTO(AbsOp)
612
613//Matlab transpose op
614BUILD_UNARY_PROTO(MatrixTransposeOp)
615
616
617ROSE_DLL_API SgCastExp * buildCastExp(SgExpression * operand_i = NULL,
618 SgType * expression_type = NULL,
620ROSE_DLL_API SgCastExp * buildCastExp_nfi(SgExpression * operand_i,
621 SgType * expression_type,
622 SgCastExp::cast_type_enum cast_type);
623
625ROSE_DLL_API SgVarArgOp * buildVarArgOp_nfi(SgExpression * operand_i, SgType * expression_type);
626
628ROSE_DLL_API SgMinusOp *buildMinusOp(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode);
629ROSE_DLL_API SgMinusOp *buildMinusOp_nfi(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode);
630ROSE_DLL_API SgMinusMinusOp *buildMinusMinusOp(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode);
632
634ROSE_DLL_API SgPlusPlusOp* buildPlusPlusOp(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode);
635ROSE_DLL_API SgPlusPlusOp* buildPlusPlusOp_nfi(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode);
636
639
640ROSE_DLL_API SgNewExp * buildNewExp(SgType* type,
641 SgExprListExp* exprListExp,
642 SgConstructorInitializer* constInit,
643 SgExpression* expr,
644 short int val,
645 SgFunctionDeclaration* funcDecl);
646
648 short is_array,
649 short need_global_specifier,
650 SgFunctionDeclaration* deleteOperatorDeclaration);
651
653ROSE_DLL_API SgTypeIdOp* buildTypeIdOp(SgExpression *operand_expr, SgType *operand_type);
654
655
656#undef BUILD_UNARY_PROTO
657
662#define BUILD_BINARY_PROTO(suffix) \
663ROSE_DLL_API Sg##suffix * build##suffix(SgExpression* lhs =NULL, SgExpression* rhs =NULL); \
664ROSE_DLL_API Sg##suffix * build##suffix##_nfi(SgExpression* lhs, SgExpression* rhs);
665
666BUILD_BINARY_PROTO(AddOp)
667BUILD_BINARY_PROTO(AndAssignOp)
668BUILD_BINARY_PROTO(AndOp)
669BUILD_BINARY_PROTO(ArrowExp)
670BUILD_BINARY_PROTO(ArrowStarOp)
671BUILD_BINARY_PROTO(AssignOp)
672BUILD_BINARY_PROTO(AtOp)
673BUILD_BINARY_PROTO(BitAndOp)
674BUILD_BINARY_PROTO(BitOrOp)
675BUILD_BINARY_PROTO(BitXorOp)
676
677BUILD_BINARY_PROTO(CommaOpExp)
678BUILD_BINARY_PROTO(ConcatenationOp)
679BUILD_BINARY_PROTO(DivAssignOp)
680BUILD_BINARY_PROTO(DivideOp)
681BUILD_BINARY_PROTO(DotExp)
682BUILD_BINARY_PROTO(DotStarOp)
683BUILD_BINARY_PROTO(EqualityOp)
684
685BUILD_BINARY_PROTO(ExponentiationOp)
686BUILD_BINARY_PROTO(ExponentiationAssignOp)
687BUILD_BINARY_PROTO(GreaterOrEqualOp)
688BUILD_BINARY_PROTO(GreaterThanOp)
689BUILD_BINARY_PROTO(IntegerDivideOp)
690BUILD_BINARY_PROTO(IntegerDivideAssignOp)
691BUILD_BINARY_PROTO(IorAssignOp)
692BUILD_BINARY_PROTO(IsOp)
693BUILD_BINARY_PROTO(IsNotOp)
694
695BUILD_BINARY_PROTO(LessOrEqualOp)
696BUILD_BINARY_PROTO(LessThanOp)
697BUILD_BINARY_PROTO(LshiftAssignOp)
698BUILD_BINARY_PROTO(LshiftOp)
699
700BUILD_BINARY_PROTO(MembershipOp)
701BUILD_BINARY_PROTO(MinusAssignOp)
702BUILD_BINARY_PROTO(ModAssignOp)
703BUILD_BINARY_PROTO(ModOp)
704BUILD_BINARY_PROTO(MultAssignOp)
705BUILD_BINARY_PROTO(MultiplyOp)
706
707BUILD_BINARY_PROTO(NonMembershipOp)
708BUILD_BINARY_PROTO(NotEqualOp)
709BUILD_BINARY_PROTO(OrOp)
710BUILD_BINARY_PROTO(PlusAssignOp)
711BUILD_BINARY_PROTO(PntrArrRefExp)
712BUILD_BINARY_PROTO(RemOp)
713BUILD_BINARY_PROTO(RshiftAssignOp)
714BUILD_BINARY_PROTO(JavaUnsignedRshiftAssignOp)
715
716BUILD_BINARY_PROTO(ReplicationOp)
717BUILD_BINARY_PROTO(RshiftOp)
718BUILD_BINARY_PROTO(JavaUnsignedRshiftOp)
719BUILD_BINARY_PROTO(ScopeOp)
720BUILD_BINARY_PROTO(SubtractOp)
721BUILD_BINARY_PROTO(XorAssignOp)
722
723BUILD_BINARY_PROTO(VarArgCopyOp)
724BUILD_BINARY_PROTO(VarArgStartOp)
725
726BUILD_BINARY_PROTO(PowerOp);
727BUILD_BINARY_PROTO(ElementwisePowerOp);
728BUILD_BINARY_PROTO(ElementwiseMultiplyOp);
729BUILD_BINARY_PROTO(ElementwiseDivideOp);
730BUILD_BINARY_PROTO(LeftDivideOp);
731BUILD_BINARY_PROTO(ElementwiseLeftDivideOp);
732BUILD_BINARY_PROTO(ElementwiseAddOp);
733BUILD_BINARY_PROTO(ElementwiseSubtractOp);
734
735// DQ (7/25/2020): Adding C++20 support
736BUILD_BINARY_PROTO(SpaceshipOp)
737
738#undef BUILD_BINARY_PROTO
739
741ROSE_DLL_API SgConditionalExp * buildConditionalExp(SgExpression* test =NULL, SgExpression* a =NULL, SgExpression* b =NULL);
743
745ROSE_DLL_API SgExprListExp * 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);
746ROSE_DLL_API SgExprListExp * buildExprListExp(const std::vector<SgExpression*>& exprs);
748SgExprListExp * buildExprListExp_nfi(const std::vector<SgExpression*>& exprs);
749
752
754ROSE_DLL_API SgTupleExp * buildTupleExp(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);
755ROSE_DLL_API SgTupleExp * buildTupleExp(const std::vector<SgExpression*>& exprs);
757SgTupleExp * buildTupleExp_nfi(const std::vector<SgExpression*>& exprs);
758
760ROSE_DLL_API SgListExp * buildListExp(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);
761ROSE_DLL_API SgListExp * buildListExp(const std::vector<SgExpression*>& exprs);
763SgListExp * buildListExp_nfi(const std::vector<SgExpression*>& exprs);
764
767
770
773
776
778
782ROSE_DLL_API SgVarRefExp * buildVarRefExp(const SgName& name, SgScopeStatement* scope=NULL);
783
785ROSE_DLL_API SgVarRefExp * buildVarRefExp(const std::string& varName, SgScopeStatement* scope=NULL);
786
788ROSE_DLL_API SgVarRefExp * buildVarRefExp(const char* varName, SgScopeStatement* scope=NULL);
789
791ROSE_DLL_API SgVarRefExp * buildVarRefExp(SgVariableSymbol* varSymbol);
792ROSE_DLL_API SgVarRefExp * buildVarRefExp_nfi(SgVariableSymbol* varSymbol);
793
795ROSE_DLL_API SgVarRefExp * buildVarRefExp(SgVariableDeclaration* vardecl);
796
799ROSE_DLL_API SgVarRefExp * buildVarRefExp(SgInitializedName* initname, SgScopeStatement* scope=NULL);
800
802
804ROSE_DLL_API SgVarRefExp* buildOpaqueVarRefExp(const std::string& varName,SgScopeStatement* scope=NULL);
805
806// DQ (9/4/2013): Added support for building compound literals (similar to a SgVarRefExp).
810
813
815ROSE_DLL_API SgFunctionRefExp * buildFunctionRefExp(const SgName& name, const SgType* func_type, SgScopeStatement* scope=NULL);
816
817ROSE_DLL_API SgFunctionRefExp * buildFunctionRefExp(const char* name, const SgType* func_type, SgScopeStatement* scope=NULL);
818
820ROSE_DLL_API SgFunctionRefExp * buildFunctionRefExp(const SgName& name,SgScopeStatement* scope=NULL);
821
822ROSE_DLL_API SgFunctionRefExp * buildFunctionRefExp(const char* name,SgScopeStatement* scope=NULL);
823
825ROSE_DLL_API SgFunctionRefExp * buildFunctionRefExp(const SgFunctionDeclaration* func_decl);
826
829
831
834
837
838SgMemberFunctionRefExp * buildMemberFunctionRefExp_nfi(SgMemberFunctionSymbol* sym, bool virtual_call, bool need_qualifier);
839ROSE_DLL_API SgMemberFunctionRefExp * buildMemberFunctionRefExp(SgMemberFunctionSymbol* sym, bool virtual_call, bool need_qualifier);
842
844ROSE_DLL_API SgFunctionCallExp* buildFunctionCallExp(SgFunctionSymbol* sym, SgExprListExp* parameters=NULL);
846ROSE_DLL_API SgFunctionCallExp* buildFunctionCallExp(SgExpression* f, SgExprListExp* parameters=NULL);
847
849ROSE_DLL_API SgFunctionCallExp*
850buildFunctionCallExp(const SgName& name, SgType* return_type, SgExprListExp* parameters=NULL, SgScopeStatement* scope=NULL);
851
852
854
869ROSE_DLL_API SgFunctionCallExp*
870buildMemberFunctionCall (std::string className, SgExpression *objectExpression, std::string functionName, SgExprListExp *params, SgScopeStatement *scope);
871
873ROSE_DLL_API SgFunctionCallExp* buildMemberFunctionCall (SgExpression* objectExpression, SgMemberFunctionSymbol* functionSymbol,
874 SgExprListExp* params);
875
877buildTypeTraitBuiltinOperator(SgName functionName, SgNodePtrList parameters);
878
881 SgExpression * kernel,
882 SgExprListExp* parameters = NULL,
883 SgCudaKernelExecConfig * config = NULL
884);
885
888 SgExpression *grid = NULL,
889 SgExpression *blocks = NULL,
890 SgExpression *shared = NULL,
891 SgExpression *stream = NULL
892);
893
895ROSE_DLL_API SgAssignInitializer * buildAssignInitializer(SgExpression * operand_i = NULL, SgType * expression_type = NULL);
896ROSE_DLL_API SgAssignInitializer * buildAssignInitializer_nfi(SgExpression * operand_i = NULL, SgType * expression_type = NULL);
897
899ROSE_DLL_API SgAggregateInitializer * buildAggregateInitializer(SgExprListExp * initializers = NULL, SgType * type = NULL);
900ROSE_DLL_API SgAggregateInitializer * buildAggregateInitializer_nfi(SgExprListExp * initializers, SgType * type = NULL);
901
903ROSE_DLL_API SgCompoundInitializer * buildCompoundInitializer(SgExprListExp * initializers = NULL, SgType * type = NULL);
904ROSE_DLL_API SgCompoundInitializer * buildCompoundInitializer_nfi(SgExprListExp * initializers, SgType * type = NULL);
905
906// DQ (!/4/2009): Added support for building SgConstructorInitializer
907ROSE_DLL_API SgConstructorInitializer * buildConstructorInitializer( SgMemberFunctionDeclaration *declaration,SgExprListExp *args,SgType *expression_type,bool need_name,bool need_qualifier,bool need_parenthesis_after_name,bool associated_class_unknown);
908ROSE_DLL_API SgConstructorInitializer * buildConstructorInitializer_nfi( SgMemberFunctionDeclaration *declaration,SgExprListExp *args,SgType *expression_type,bool need_name,bool need_qualifier,bool need_parenthesis_after_name,bool associated_class_unknown);
909
911ROSE_DLL_API SgBracedInitializer * buildBracedInitializer(SgExprListExp * initializers = NULL, SgType * expression_type = NULL);
912ROSE_DLL_API SgBracedInitializer * buildBracedInitializer_nfi(SgExprListExp * initializers = NULL, SgType * expression_type = NULL);
913
915ROSE_DLL_API SgSizeOfOp* buildSizeOfOp(SgExpression* exp = NULL);
916ROSE_DLL_API SgSizeOfOp* buildSizeOfOp_nfi(SgExpression* exp);
917
919ROSE_DLL_API SgSizeOfOp* buildSizeOfOp(SgType* type = NULL);
920ROSE_DLL_API SgSizeOfOp* buildSizeOfOp_nfi(SgType* type);
921
923ROSE_DLL_API SgAlignOfOp* buildAlignOfOp(SgExpression* exp = NULL);
925
927ROSE_DLL_API SgAlignOfOp* buildAlignOfOp(SgType* type = NULL);
928ROSE_DLL_API SgAlignOfOp* buildAlignOfOp_nfi(SgType* type);
929
931ROSE_DLL_API SgNoexceptOp* buildNoexceptOp(SgExpression* exp = NULL);
933
934// DQ (7/18/2011): Added support for SgJavaInstanceOfOp
936ROSE_DLL_API SgJavaInstanceOfOp* buildJavaInstanceOfOp(SgExpression* exp = NULL, SgType* type = NULL);
937
939ROSE_DLL_API SgTypeExpression *buildTypeExpression(SgType* type);
940
941// DQ (8/11/2014): Added support for C++11 decltype used in new function return syntax.
942ROSE_DLL_API SgFunctionParameterRefExp *buildFunctionParameterRefExp(int parameter_number, int parameter_level );
943ROSE_DLL_API SgFunctionParameterRefExp *buildFunctionParameterRefExp_nfi(int parameter_number, int parameter_level );
944
945
947ROSE_DLL_API SgLambdaExp* buildLambdaExp (SgLambdaCaptureList* lambda_capture_list, SgClassDeclaration* lambda_closure_class, SgFunctionDeclaration* lambda_function);
948ROSE_DLL_API SgLambdaExp* buildLambdaExp_nfi(SgLambdaCaptureList* lambda_capture_list, SgClassDeclaration* lambda_closure_class, SgFunctionDeclaration* lambda_function);
949
950#if 0
951ROSE_DLL_API SgLambdaCapture* buildLambdaCapture (SgInitializedName* capture_variable, SgInitializedName* source_closure_variable, SgInitializedName* closure_variable);
952ROSE_DLL_API SgLambdaCapture* buildLambdaCapture_nfi(SgInitializedName* capture_variable, SgInitializedName* source_closure_variable, SgInitializedName* closure_variable);
953#else
954ROSE_DLL_API SgLambdaCapture* buildLambdaCapture (SgExpression* capture_variable, SgExpression* source_closure_variable, SgExpression* closure_variable);
955ROSE_DLL_API SgLambdaCapture* buildLambdaCapture_nfi(SgExpression* capture_variable, SgExpression* source_closure_variable, SgExpression* closure_variable);
956#endif
957
960
961// DQ (7/25/2020): Adding C++17 support
962 ROSE_DLL_API SgFoldExpression * buildFoldExpression(SgExpression* operands, std::string operator_token_string, bool is_left_associative);
963ROSE_DLL_API SgFoldExpression * buildFoldExpression_nfi(SgExpression* operands, std::string operator_token_string, bool is_left_associative);
964
965// DQ (7/25/2020): Adding C++20 support
968
969// DQ (7/25/2020): Adding C++20 support
972
973
975
977
980 ROSE_DLL_API SgRangeExp* buildRangeExp(SgExpression *start);
981
982
984 ROSE_DLL_API SgMatrixExp* buildMatrixExp(SgExprListExp *firstRow);
985
987 ROSE_DLL_API SgMagicColonExp* buildMagicColonExp();
988
990 ROSE_DLL_API SgMatlabForStatement* buildMatlabForStatement(SgExpression* loop_index, SgExpression* loop_range, SgBasicBlock* loop_body);
992
994
997// ! Build a range expression using start:end:stride for Ada
998 ROSE_DLL_API SgRangeExp* buildRangeExp(SgExpression *start, SgExpression *end, SgExpression *stride);
999
1001//
1002//--------------------------------------------------------------
1004
1009
1012ROSE_DLL_API SgInitializedName* buildInitializedName(const SgName & name, SgType* type, SgInitializer* init = NULL);
1013ROSE_DLL_API SgInitializedName* buildInitializedName(const std::string &name, SgType* type);
1014ROSE_DLL_API SgInitializedName* buildInitializedName(const char* name, SgType* type);
1015ROSE_DLL_API SgInitializedName* buildInitializedName_nfi(const SgName & name, SgType* type, SgInitializer* init, SgVariableDeclaration* declptr=NULL);
1016
1018ROSE_DLL_API SgFunctionParameterTypeList *
1020
1022ROSE_DLL_API SgFunctionParameterTypeList *
1024
1026ROSE_DLL_API SgFunctionParameterTypeList *
1027buildFunctionParameterTypeList(SgType* type0 = NULL, SgType* type1 = NULL,
1028 SgType* type2 = NULL, SgType* type3 = NULL,
1029 SgType* type4 = NULL, SgType* type5 = NULL,
1030 SgType* type6 = NULL, SgType* type7 = NULL);
1031
1032
1033//--------------------------------------------------------------
1035
1042ROSE_DLL_API SgVariableDeclaration*
1043buildVariableDeclaration(const SgName & name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement* scope=NULL);
1044
1045ROSE_DLL_API SgVariableDeclaration*
1046buildVariableDeclaration(const std::string & name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement* scope=NULL);
1047
1048ROSE_DLL_API SgVariableDeclaration*
1049buildVariableDeclaration(const char* name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement* scope=NULL);
1050
1051// DQ (6/25/2019): Added support to force building the varialbe declaration from the variable use (e.g. within a class)
1052// instead of from a declaration. Variable declaration built from a use are reused when the declaration is seen (later
1053// in processing of the class members).
1054// ROSE_DLL_API SgVariableDeclaration*
1055// buildVariableDeclaration_nfi(const SgName & name, SgType *type, SgInitializer *varInit, SgScopeStatement* scope);
1056ROSE_DLL_API SgVariableDeclaration*
1058
1060ROSE_DLL_API SgVariableDefinition*
1062
1063
1064// DQ (8/31/2012): Note that this macro can't be used in header files since it can only be set
1065// after sage3.h has been read. The reason is that this is a portability problem when "rose_config.h"
1066// appears in header files of applications using ROSE's header files.
1067// DQ (12/6/2011): Adding support for template declarations into the AST.
1068// SgTemplateDeclaration*
1070
1073
1075 const SgName & name, SgType *type, SgInitializer *varInit, SgScopeStatement* scope,
1077 SgTemplateArgumentPtrList & tpl_args
1078);
1079
1082 const SgName & name, SgType *type, SgInitializer *varInit, SgScopeStatement* scope,
1084 SgTemplateArgumentPtrList &tpl_args
1085);
1086
1088ROSE_DLL_API SgTypedefDeclaration*
1089buildTypedefDeclaration(const std::string& name, SgType* base_type, SgScopeStatement* scope = NULL, bool has_defining_base=false);
1090
1091ROSE_DLL_API SgTypedefDeclaration*
1092buildTypedefDeclaration_nfi(const std::string& name, SgType* base_type, SgScopeStatement* scope = NULL, bool has_defining_base=false);
1093
1094ROSE_DLL_API SgTemplateTypedefDeclaration*
1095buildTemplateTypedefDeclaration_nfi(const SgName & name, SgType* base_type, SgScopeStatement* scope = NULL, bool has_defining_base=false);
1096
1097
1099 SgName & name, SgType* base_type, SgScopeStatement* scope, bool has_defining_base,
1100 SgTemplateTypedefDeclaration * templateTypedefDeclaration,
1101 SgTemplateArgumentPtrList & templateArgumentsList
1102);
1103
1105ROSE_DLL_API SgFunctionParameterList * 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);
1107
1109ROSE_DLL_API SgFunctionParameterList*
1111
1112ROSE_DLL_API SgFunctionParameterList*
1114
1117ROSE_DLL_API void setTemplateNameInTemplateInstantiations( SgFunctionDeclaration* func, const SgName & name );
1118
1119// DQ (9/13/2012): Need to set the parents of SgTemplateArgument IR nodes now that they are passed in as part of the SageBuilder API.
1120ROSE_DLL_API void setTemplateArgumentParents( SgDeclarationStatement* decl );
1121ROSE_DLL_API void testTemplateArgumentParents( SgDeclarationStatement* decl );
1122ROSE_DLL_API SgTemplateArgumentPtrList* getTemplateArgumentList( SgDeclarationStatement* decl );
1123
1125ROSE_DLL_API void testTemplateParameterParents( SgDeclarationStatement* decl );
1126ROSE_DLL_API void setTemplateParameterParents( SgDeclarationStatement* decl );
1127ROSE_DLL_API SgTemplateParameterPtrList* getTemplateParameterList( SgDeclarationStatement* decl );
1128
1130ROSE_DLL_API void setTemplateArgumentsInDeclaration ( SgDeclarationStatement* decl, SgTemplateArgumentPtrList* templateArgumentsList_input );
1131ROSE_DLL_API void setTemplateSpecializationArgumentsInDeclaration ( SgDeclarationStatement* decl, SgTemplateArgumentPtrList* templateSpecializationArgumentsList_input );
1132ROSE_DLL_API void setTemplateParametersInDeclaration ( SgDeclarationStatement* decl, SgTemplateParameterPtrList* templateParametersList_input );
1133
1134
1136// DQ (7/26/2012): Changing the API to include template arguments so that we can generate names with and without template arguments (to support name mangiling).
1138 const SgName & name,
1139 SgType * return_type,
1140 SgFunctionParameterList *parlist,
1141 SgScopeStatement* scope = NULL,
1142 SgExprListExp* decoratorList = NULL,
1143 bool buildTemplateInstantiation = false,
1144 SgTemplateArgumentPtrList * templateArgumentsList = NULL,
1146);
1147
1150 const SgFunctionDeclaration * funcdecl,
1151 SgScopeStatement * scope = NULL,
1152 SgExprListExp * decoratorList = NULL
1153);
1154
1155// DQ (8/11/2013): Even though template functions can't use partial specialization, they can be specialized,
1156// however the specialization does not define a template and instead defines a template instantiation, so we
1157// don't need the SgTemplateArgumentPtrList in this function.
1158// SgTemplateFunctionDeclaration* buildNondefiningTemplateFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL);
1160buildNondefiningTemplateFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL, SgTemplateParameterPtrList* templateParameterList = NULL);
1161
1162// DQ (8/11/2013): Note that access to the SgTemplateParameterPtrList should be handled through the first_nondefining_declaration (which is a required parameter).
1163// DQ (12/1/2011): Adding support for template declarations into the AST.
1165buildDefiningTemplateFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope, SgExprListExp* decoratorList, SgTemplateFunctionDeclaration* first_nondefining_declaration);
1166
1167// DQ (11/8/2020): Define a function to build a default constructor for a class.
1168// ROSE_DLL_API SgMemberFunctionDeclaration* buildConstructor ( const SgName & typeName, SgClassType* initializedName_classType, SgClassDefinition* classDefinition);
1170
1172// SgMemberFunctionDeclaration * buildNondefiningMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL);
1173// SgMemberFunctionDeclaration * buildNondefiningMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL, unsigned int functionConstVolatileFlags = 0);
1174// SgMemberFunctionDeclaration* buildNondefiningMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL, unsigned int functionConstVolatileFlags = 0, bool buildTemplateInstantiation = false);
1175ROSE_DLL_API SgMemberFunctionDeclaration*
1176buildNondefiningMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope, SgExprListExp* decoratorList, unsigned int functionConstVolatileFlags, bool buildTemplateInstantiation, SgTemplateArgumentPtrList* templateArgumentsList);
1177
1178// DQ (8/12/2013): This function needs to supporte SgTemplateParameterPtrList and SgTemplateArgumentPtrList parameters.
1179// SgTemplateMemberFunctionDeclaration* buildNondefiningTemplateMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope = NULL, SgExprListExp* decoratorList = NULL, unsigned int functionConstVolatileFlags = 0);
1181buildNondefiningTemplateMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope, SgExprListExp* decoratorList, unsigned int functionConstVolatileFlags, SgTemplateParameterPtrList* templateParameterList );
1182
1183// DQ (12/1/2011): Adding support for template declarations in the AST.
1185buildDefiningTemplateMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope, SgExprListExp* decoratorList, unsigned int functionConstVolatileFlags, SgTemplateMemberFunctionDeclaration* first_nondefing_declaration );
1186
1188// SgMemberFunctionDeclaration* buildNondefiningMemberFunctionDeclaration (const SgName & name, SgMemberFunctionType* func_type, SgFunctionParameterList* paralist, SgScopeStatement* scope=NULL);
1189
1190// DQ (8/11/2013): Note that the specification of the SgTemplateArgumentPtrList is somewhat redundant with the required parameter first_nondefinng_declaration (I think).
1192// SgMemberFunctionDeclaration* buildDefiningMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope, SgExprListExp* decoratorList, bool buildTemplateInstantiation, unsigned int functionConstVolatileFlags, SgMemberFunctionDeclaration* first_nondefinng_declaration);
1193ROSE_DLL_API SgMemberFunctionDeclaration*
1194buildDefiningMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope, SgExprListExp* decoratorList, bool buildTemplateInstantiation, unsigned int functionConstVolatileFlags, SgMemberFunctionDeclaration* first_nondefinng_declaration, SgTemplateArgumentPtrList* templateArgumentsList);
1195
1196// DQ (8/28/2012): This preserves the original API with a simpler function (however for C++ at least, it is frequently not sufficent).
1197// We need to decide if the SageBuilder API should include these sorts of functions.
1198ROSE_DLL_API SgMemberFunctionDeclaration* buildNondefiningMemberFunctionDeclaration(const SgName& name, SgType* return_type, SgFunctionParameterList* parameter_list, SgScopeStatement* scope = NULL);
1199
1200// DQ (8/28/2012): This preserves the original API with a simpler function (however for C++ at least, it is frequently not sufficent).
1201// We need to decide if the SageBuilder API should include these sorts of functions.
1202ROSE_DLL_API SgMemberFunctionDeclaration* buildDefiningMemberFunctionDeclaration(const SgName& name, SgType* return_type, SgFunctionParameterList* parameter_list, SgScopeStatement* scope = NULL);
1203
1204// DQ (8/11/2013): Note that the specification of the SgTemplateArgumentPtrList is somewhat redundant with the required parameter first_nondefinng_declaration (I think).
1206ROSE_DLL_API SgFunctionDeclaration*
1207buildDefiningFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList * parlist, SgScopeStatement* scope, SgExprListExp* decoratorList, bool buildTemplateInstantiation = false, SgFunctionDeclaration* first_nondefinng_declaration = NULL, SgTemplateArgumentPtrList* templateArgumentsList = NULL);
1208
1209// DQ (8/28/2012): This preserves the original API with a simpler function (however for C++ at least, it is frequently not sufficient).
1210// We need to decide if the SageBuilder API should include these sorts of functions.
1211ROSE_DLL_API SgFunctionDeclaration* buildDefiningFunctionDeclaration(const SgName& name, SgType* return_type, SgFunctionParameterList* parameter_list, SgScopeStatement* scope = NULL);
1212
1213// DQ (8/28/2012): This preserves the original API with a simpler function (however for C++ at least, it is frequently not sufficient).
1214// We need to decide if the SageBuilder API should include these sorts of functions.
1216
1218ROSE_DLL_API SgProcedureHeaderStatement*
1220
1221// Rasmussen (9/24/2020)
1223ROSE_DLL_API SgProcedureHeaderStatement*
1226
1228ROSE_DLL_API SgExprStatement*
1229buildFunctionCallStmt(const SgName& name, SgType* return_type, SgExprListExp* parameters=NULL, SgScopeStatement* scope=NULL);
1230
1232ROSE_DLL_API SgExprStatement*
1233buildFunctionCallStmt(SgExpression* function, SgExprListExp* parameters=NULL);
1234
1235
1237
1240ROSE_DLL_API SgLabelStatement * buildLabelStatement(const SgName& name, SgStatement * stmt = NULL, SgScopeStatement* scope=NULL);
1242
1244ROSE_DLL_API SgGotoStatement * buildGotoStatement(SgLabelStatement * label=NULL);
1246
1248ROSE_DLL_API SgGotoStatement * buildGotoStatement(SgLabelSymbol* symbol);
1249
1250// DQ (11/22/2017): Added support for computed code goto as defined by GNU C/C++ extension.
1253
1255ROSE_DLL_API SgCaseOptionStmt * buildCaseOptionStmt( SgExpression * key = NULL,SgStatement *body = NULL);
1257
1259ROSE_DLL_API SgDefaultOptionStmt * buildDefaultOptionStmt( SgStatement *body = NULL);
1261
1263ROSE_DLL_API SgExprStatement* buildExprStatement(SgExpression* exp = NULL);
1265
1266// DQ (3/27/2015): Added support for SgStatementExpression.
1270
1272ROSE_DLL_API SgSwitchStatement* buildSwitchStatement(SgStatement *item_selector = NULL,SgStatement *body = NULL);
1274 return buildSwitchStatement(buildExprStatement(item_selector), body);
1275}
1276ROSE_DLL_API SgSwitchStatement* buildSwitchStatement_nfi(SgStatement *item_selector,SgStatement *body);
1277
1279ROSE_DLL_API SgIfStmt * buildIfStmt(SgStatement* conditional, SgStatement * true_body, SgStatement * false_body);
1280inline SgIfStmt * buildIfStmt(SgExpression* conditional, SgStatement * true_body, SgStatement * false_body) {
1281 return buildIfStmt(buildExprStatement(conditional), true_body, false_body);
1282}
1283
1284ROSE_DLL_API SgIfStmt* buildIfStmt_nfi(SgStatement* conditional, SgStatement * true_body, SgStatement * false_body);
1285
1286// Rasmussen (9/3/2018)
1288ROSE_DLL_API SgFortranDo* buildFortranDo(SgExpression* initialization, SgExpression* bound, SgExpression* increment, SgBasicBlock*);
1289ROSE_DLL_API SgFortranDo* buildFortranDo_nfi(SgExpression* initialization, SgExpression* bound, SgExpression* increment, SgBasicBlock*);
1290
1293ROSE_DLL_API SgForInitStatement* buildForInitStatement(const SgStatementPtrList & statements);
1294ROSE_DLL_API SgForInitStatement* buildForInitStatement_nfi(SgStatementPtrList & statements);
1295
1296// DQ (10/12/2012): Added new function for a single statement.
1297ROSE_DLL_API SgForInitStatement* buildForInitStatement( SgStatement* statement );
1298
1300ROSE_DLL_API SgForStatement * buildForStatement(SgStatement* initialize_stmt, SgStatement * test, SgExpression * increment, SgStatement * loop_body, SgStatement * else_body = NULL);
1301ROSE_DLL_API SgForStatement * buildForStatement_nfi(SgStatement* initialize_stmt, SgStatement * test, SgExpression * increment, SgStatement * loop_body, SgStatement * else_body = NULL);
1302ROSE_DLL_API SgForStatement * buildForStatement_nfi(SgForInitStatement * init_stmt, SgStatement * test, SgExpression * increment, SgStatement * loop_body, SgStatement * else_body = NULL);
1303ROSE_DLL_API void buildForStatement_nfi(SgForStatement* result, SgForInitStatement * init_stmt, SgStatement * test, SgExpression * increment, SgStatement * loop_body, SgStatement * else_body = NULL);
1304
1305// DQ (3/26/2018): Adding support for range based for statement.
1306// ROSE_DLL_API SgRangeBasedForStatement* buildRangeBasedForStatement_nfi(SgVariableDeclaration* initializer, SgExpression* range, SgStatement* body);
1308 SgVariableDeclaration* initializer, SgVariableDeclaration* range,
1309 SgVariableDeclaration* begin_declaration, SgVariableDeclaration* end_declaration,
1310 SgExpression* not_equal_expression, SgExpression* increment_expression,
1311 SgStatement* body);
1312
1313// EDG 4.8 handled the do-while statement differently (more similar to a block scope than before in EDG 4.7 (i.e. with an end-of-construct statement).
1314// So we need an builder function that can use the existing SgDoWhileStatement scope already on the stack.
1315ROSE_DLL_API void buildDoWhileStatement_nfi(SgDoWhileStmt* result, SgStatement * body, SgStatement * condition);
1316
1318ROSE_DLL_API SgUpcForAllStatement * buildUpcForAllStatement_nfi(SgStatement* initialize_stmt, SgStatement * test, SgExpression * increment, SgExpression* affinity, SgStatement * loop_body);
1319ROSE_DLL_API SgUpcForAllStatement * buildUpcForAllStatement_nfi(SgForInitStatement * init_stmt, SgStatement * test, SgExpression * increment, SgExpression* affinity, SgStatement * loop_body);
1320
1321// DQ (3/3/2013): Added UPC specific build functions.
1324
1327
1330
1333
1334
1336ROSE_DLL_API SgWhileStmt * buildWhileStmt(SgStatement * condition, SgStatement *body, SgStatement *else_body = NULL);
1337inline SgWhileStmt * buildWhileStmt(SgExpression * condition, SgStatement *body, SgStatement* else_body = NULL) {
1338 return buildWhileStmt(buildExprStatement(condition), body, else_body);
1339}
1340SgWhileStmt * buildWhileStmt_nfi(SgStatement * condition, SgStatement *body, SgStatement *else_body = NULL);
1341
1345
1347ROSE_DLL_API SgDoWhileStmt * buildDoWhileStmt(SgStatement * body, SgStatement *condition);
1349 return buildDoWhileStmt(body, buildExprStatement(condition));
1350}
1352
1354ROSE_DLL_API SgPragmaDeclaration * buildPragmaDeclaration(const std::string & name, SgScopeStatement* scope=NULL);
1356
1358ROSE_DLL_API SgPragma* buildPragma(const std::string & name);
1359
1362
1364ROSE_DLL_API SgBasicBlock * 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);
1365ROSE_DLL_API SgBasicBlock * buildBasicBlock_nfi();
1366SgBasicBlock * buildBasicBlock_nfi(const std::vector<SgStatement*>&);
1367
1368// CR (7/24/2020): Added additional functionality
1371
1373ROSE_DLL_API SgExprStatement*
1375
1376// DQ (8/16/2011): Generated a new version of this function to define consistant semantics.
1379
1381ROSE_DLL_API SgBreakStmt* buildBreakStmt();
1383
1385ROSE_DLL_API SgContinueStmt* buildContinueStmt();
1387
1391
1393ROSE_DLL_API SgPassStatement* buildPassStatement();
1395
1397ROSE_DLL_API SgAssertStmt* buildAssertStmt(SgExpression* test);
1398ROSE_DLL_API SgAssertStmt* buildAssertStmt(SgExpression *test, SgExpression *exceptionArgument);
1400
1404
1406ROSE_DLL_API SgKeyDatumPair* buildKeyDatumPair (SgExpression* key, SgExpression* datum);
1408
1410ROSE_DLL_API SgDictionaryExp* buildDictionaryExp (std::vector<SgKeyDatumPair*> pairs);
1411SgDictionaryExp* buildDictionaryExp_nfi(std::vector<SgKeyDatumPair*> pairs);
1412
1416
1418ROSE_DLL_API SgDeleteExp* buildDeleteExp(SgExpression *target, bool is_array = false, bool need_global_specifier = false, SgFunctionDeclaration *deleteOperatorDeclaration = NULL);
1419SgDeleteExp* buildDeleteExp_nfi(SgExpression *target, bool is_array = false, bool need_global_specifier = false, SgFunctionDeclaration *deleteOperatorDeclaration = NULL);
1420
1423
1425// SgClassDefinition* buildClassDefinition(SgClassDeclaration *d = NULL);
1426ROSE_DLL_API SgClassDefinition* buildClassDefinition(SgClassDeclaration *d = NULL, bool buildTemplateInstantiation = false);
1427
1429// SgClassDefinition* buildClassDefinition_nfi(SgClassDeclaration *d = NULL);
1430SgClassDefinition* buildClassDefinition_nfi(SgClassDeclaration *d = NULL, bool buildTemplateInstantiation = false);
1431
1432// DQ (11/19/2011): Added more template declaration support.
1435
1437// DQ (6/6/2012): Added support to get the template arguments into place before computing the type.
1438// SgClassDeclaration* buildNondefiningClassDeclaration_nfi(const SgName& name, SgClassDeclaration::class_types kind, SgScopeStatement* scope);
1439// SgClassDeclaration* buildNondefiningClassDeclaration_nfi(const SgName& name, SgClassDeclaration::class_types kind, SgScopeStatement* scope, bool buildTemplateInstantiation = false);
1440ROSE_DLL_API SgClassDeclaration* buildNondefiningClassDeclaration_nfi(const SgName& name, SgClassDeclaration::class_types kind, SgScopeStatement* scope, bool buildTemplateInstantiation, SgTemplateArgumentPtrList* templateArgumentsList);
1441
1442// DQ (8/11/2013): We need to hand in both the SgTemplateParameterPtrList and the SgTemplateArgumentPtrList because class templates can be partially specialized.
1444ROSE_DLL_API SgTemplateClassDeclaration* buildNondefiningTemplateClassDeclaration_nfi(const SgName& name, SgClassDeclaration::class_types kind, SgScopeStatement* scope, SgTemplateParameterPtrList* templateParameterList, SgTemplateArgumentPtrList* templateSpecializationArgumentList);
1445
1447ROSE_DLL_API SgTemplateClassDeclaration* buildNondefiningTemplateClassDeclaration(const SgName& name, SgClassDeclaration::class_types kind, SgScopeStatement* scope, SgTemplateParameterPtrList* templateParameterList, SgTemplateArgumentPtrList* templateSpecializationArgumentList);
1448
1452
1455
1458
1460ROSE_DLL_API SgClassDeclaration * buildStructDeclaration(const SgName& name, SgScopeStatement* scope=NULL);
1461ROSE_DLL_API SgClassDeclaration * buildStructDeclaration(const std::string& name, SgScopeStatement* scope=NULL);
1462ROSE_DLL_API SgClassDeclaration * buildStructDeclaration(const char* name, SgScopeStatement* scope=NULL);
1463
1467
1470ROSE_DLL_API SgNamespaceDeclarationStatement * buildNamespaceDeclaration_nfi(const SgName& name, bool unnamednamespace, SgScopeStatement* scope );
1472
1473// Pei-Hung (09/14/2023) :added support for building namespace alias
1475
1481
1484
1485ROSE_DLL_API SgClassDeclaration* buildClassDeclaration_nfi(const SgName& name, SgClassDeclaration::class_types kind, SgScopeStatement* scope, SgClassDeclaration* nonDefiningDecl, bool buildTemplateInstantiation, SgTemplateArgumentPtrList* templateArgumentsList);
1486
1487// DQ (8/11/2013): I think that the specification of both SgTemplateParameterPtrList and SgTemplateArgumentPtrList is redundant with the nonDefiningDecl (which is a required parameter).
1488// DQ (11/19/2011): Added to support template class declaration using EDG 4.x support (to support the template declarations directly in the AST).
1490 SgTemplateParameterPtrList* templateParameterList, SgTemplateArgumentPtrList* templateSpecializationArgumentList );
1493 SgTemplateParameterPtrList* templateParameterList, SgTemplateArgumentPtrList* templateSpecializationArgumentList );
1494
1496ROSE_DLL_API SgJovialDefineDeclaration * buildJovialDefineDeclaration_nfi (const SgName& name, const std::string& params,
1497 const std::string& def_string, SgScopeStatement* scope=NULL);
1498
1502
1505ROSE_DLL_API SgDerivedTypeStatement * buildDerivedTypeStatement (const SgName& name, SgScopeStatement* scope=NULL);
1506
1508ROSE_DLL_API SgModuleStatement * buildModuleStatement(const SgName& name, SgScopeStatement* scope /*=NULL*/);
1509
1511ROSE_DLL_API SgJovialTableStatement * buildJovialTableStatement (const SgName& name,
1513
1515 ROSE_DLL_API SgJovialTableType * buildJovialTableType (const SgName& name, SgType* base_type, SgExprListExp* dim_info, SgScopeStatement* scope=NULL);
1516
1519template <class DeclClass> ROSE_DLL_API
1521 SgScopeStatement* scope=NULL, SgClassDeclaration* nonDefiningDecl=NULL);
1522
1524ROSE_DLL_API SgEnumDeclaration * buildEnumDeclaration(const SgName& name, SgScopeStatement* scope=NULL);
1525
1527ROSE_DLL_API SgEnumDeclaration * buildEnumDeclaration_nfi(const SgName& name, SgScopeStatement* scope=NULL);
1528
1530ROSE_DLL_API SgReturnStmt* buildReturnStmt(SgExpression* expression = NULL);
1531ROSE_DLL_API SgReturnStmt* buildReturnStmt_nfi(SgExpression* expression);
1532
1534ROSE_DLL_API SgNullStatement* buildNullStatement();
1536
1539
1541ROSE_DLL_API SgFortranIncludeLine* buildFortranIncludeLine(std::string filename);
1542
1544ROSE_DLL_API SgCommonBlockObject* buildCommonBlockObject(std::string name="", SgExprListExp* exp_list=NULL);
1545
1547ROSE_DLL_API SgCommonBlock* buildCommonBlock(SgCommonBlockObject* first_block=NULL);
1548
1549// driscoll6 (6/9/2011): Adding support for try stmts.
1551ROSE_DLL_API SgCatchOptionStmt* buildCatchOptionStmt(SgVariableDeclaration* condition=NULL, SgStatement* body=NULL);
1552
1554ROSE_DLL_API SgAsyncStmt* buildAsyncStmt(SgBasicBlock *body);
1555
1557ROSE_DLL_API SgFinishStmt* buildFinishStmt(SgBasicBlock *body);
1558
1560ROSE_DLL_API SgAtStmt* buildAtStmt(SgExpression *expression, SgBasicBlock *body);
1561
1562// MH (11/12/2014): Added atomic support
1563ROSE_DLL_API SgAtomicStmt* buildAtomicStmt(SgBasicBlock *body);
1564
1565ROSE_DLL_API SgWhenStmt* buildWhenStmt(SgExpression *expression, SgBasicBlock *body);
1566
1567// MH (9/16/2014): Added at support
1568ROSE_DLL_API SgAtExp* buildAtExp(SgExpression *expression, SgBasicBlock *body);
1569
1570// MH (11/7/2014): Added finish expression support
1571ROSE_DLL_API SgFinishExp* buildFinishExp(SgExpression *expression, SgBasicBlock *body);
1572
1573ROSE_DLL_API SgHereExp* buildHereExpression();
1574
1575ROSE_DLL_API SgDotDotExp* buildDotDotExp();
1576
1577
1578// driscoll6 (6/9/2011): Adding support for try stmts.
1580ROSE_DLL_API SgTryStmt* buildTryStmt(SgStatement* body,
1581 SgCatchOptionStmt* catch0=NULL,
1582 SgCatchOptionStmt* catch1=NULL,
1583 SgCatchOptionStmt* catch2=NULL,
1584 SgCatchOptionStmt* catch3=NULL,
1585 SgCatchOptionStmt* catch4=NULL);
1586
1587// charles4 (9/16/2011): Adding support for try stmts.
1589//SgTryStmt* buildTryStmt(SgStatement *try_body, SgCatchStatementSeq *catches, SgStatement *finally_body = NULL);
1590
1591// charles4 (9/16/2011): Adding support for try stmts.
1593ROSE_DLL_API SgTryStmt* buildTryStmt(SgBasicBlock *try_body, SgBasicBlock *finally_body = NULL);
1594
1595// charles4 (9/16/2011): Adding support for Catch Blocks.
1598
1599// charles4 (8/25/2011): Adding support for Java Synchronized stmts.
1602
1603// charles4 (8/25/2011): Adding support for Java Throw stmts.
1606
1607// charles4 (8/25/2011): Adding support for Java Foreach stmts.
1609// SgJavaForEachStatement *buildJavaForEachStatement(SgInitializedName * = NULL, SgExpression * = NULL, SgStatement * = NULL);
1611
1612// charles4 (8/25/2011): Adding support for Java Label stmts.
1614ROSE_DLL_API SgJavaLabelStatement *buildJavaLabelStatement(const SgName &, SgStatement * = NULL);
1615
1617ROSE_DLL_API SgExecStatement* buildExecStatement(SgExpression* executable, SgExpression* globals = NULL, SgExpression* locals = NULL);
1618SgExecStatement* buildExecStatement_nfi(SgExpression* executable, SgExpression* globals = NULL, SgExpression* locals = NULL);
1619
1621ROSE_DLL_API SgPythonPrintStmt* buildPythonPrintStmt(SgExpression* dest = NULL, SgExprListExp* values = NULL);
1623
1625ROSE_DLL_API SgPythonGlobalStmt* buildPythonGlobalStmt(SgInitializedNamePtrList& names);
1626SgPythonGlobalStmt* buildPythonGlobalStmt_nfi(SgInitializedNamePtrList& names);
1627
1628// DQ (4/30/2010): Added support for building asm statements.
1630ROSE_DLL_API SgAsmStmt* buildAsmStatement(std::string s);
1631SgAsmStmt* buildAsmStatement_nfi(std::string s);
1632
1635ROSE_DLL_API SgAsmStmt* buildMultibyteNopStatement( int n );
1636
1638ROSE_DLL_API SgBaseClass* buildBaseClass ( SgClassDeclaration* classDeclaration, SgClassDefinition* classDefinition, bool isVirtual, bool isDirect );
1639
1640ROSE_DLL_API SgNonrealBaseClass* buildNonrealBaseClass ( SgNonrealDecl* classDeclaration, SgClassDefinition* classDefinition, bool isVirtual, bool isDirect );
1641
1642// SgAccessModifier buildAccessModifier ( unsigned int access );
1643
1645ROSE_DLL_API SgStaticAssertionDeclaration* buildStaticAssertionDeclaration(SgExpression* condition, const SgName & string_literal);
1646
1649
1651ROSE_DLL_API SgStatement* buildStatementFromString(const std::string & stmt_str, SgScopeStatement* scope);
1652
1656
1657//--------------------------------------------------------------
1659
1664
1666ROSE_DLL_API SgFile* buildFile(const std::string& inputFileName,const std::string& outputFileName, SgProject* project = NULL, bool clear_globalScopeAcrossFiles = false);
1667
1669
1671ROSE_DLL_API SgSourceFile* buildSourceFile(const std::string& outputFileName, SgProject* project=NULL, bool clear_globalScopeAcrossFiles = false);
1672
1674
1676ROSE_DLL_API SgSourceFile* buildSourceFile(const std::string& inputFileName, const std::string& outputFileName, SgProject* project, bool clear_globalScopeAcrossFiles = false);
1677
1678// DQ (11/8/2019): Support function for the new file (to support changing the file names in the source position info objects of each AST subtree node.
1680// ROSE_DLL_API void fixupSourcePositionFileSpecification(SgNode* subtreeRoot, const std::string& newFileName);
1681ROSE_DLL_API void fixupSourcePositionFileSpecification(SgNode* subtreeRoot, const std::string& newFileName);
1682
1683// DQ (11/10/2019): Support for sharing IR nodes when buildFile() is applied to an existing file.
1685ROSE_DLL_API void fixupSharingSourcePosition(SgNode* subtreeRoot, int new_file_id);
1686
1688ROSE_DLL_API PreprocessingInfo* buildComment(SgLocatedNode* target, const std::string & content,
1689 PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before,
1690 PreprocessingInfo::DirectiveType dtype= PreprocessingInfo::CpreprocessorUnknownDeclaration);
1691
1694 const std::string & content,
1695 PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before);
1696
1698ROSE_DLL_API PreprocessingInfo* buildHeader(const std::string& header_filename,
1699 PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before,
1700 bool isSystemHeader =false);
1701
1702
1703#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
1706#endif
1707
1708// 03/17/2014 PHL
1709// //! Build an equivalence statement from two expression operands
1710ROSE_DLL_API SgEquivalenceStatement*
1712
1713
1715ROSE_DLL_API void fixupCopyOfAstFromSeparateFileInNewTargetAst(SgStatement *insertionPoint, bool insertionPointIsScope,
1716 SgStatement *toInsert, SgStatement* original_before_copy);
1717ROSE_DLL_API void fixupCopyOfNodeFromSeparateFileInNewTargetAst(SgStatement* insertionPoint, bool insertionPointIsScope,
1718 SgNode* node_copy, SgNode* node_original);
1719ROSE_DLL_API SgType* getTargetFileTypeSupport(SgType* snippet_type, SgScopeStatement* targetScope);
1720ROSE_DLL_API SgType* getTargetFileType(SgType* snippet_type, SgScopeStatement* targetScope);
1721
1722// DQ (12/6/2020): This is the original function (modified slightly, but mostly I have defined a new function that
1723// will not effect the AST snippet support that is used by this function.
1724ROSE_DLL_API SgSymbol* findAssociatedSymbolInTargetAST(SgDeclarationStatement* snippet_declaration, SgScopeStatement* targetScope);
1725
1726// DQ (12/6/2020): This is the new function (modified in API and made suitable for the codeSegregation support).
1728
1730ROSE_DLL_API void errorCheckingTargetAST (SgNode* node_copy, SgNode* node_original, SgFile* targetFile, bool failOnWarning);
1731
1732//-----------------------------------------------------------------------------
1733//#ifdef ROSE_BUILD_JAVA_LANGUAGE_SUPPORT
1734//-----------------------------------------------------------------------------
1742ROSE_DLL_API SgJavaNormalAnnotation *buildJavaNormalAnnotation(SgType *, std::list<SgJavaMemberValuePair *>&);
1743ROSE_DLL_API SgInitializedName *buildJavaFormalParameter(SgType *, const SgName &, bool is_var_args = false, bool is_final = false);
1744
1746ROSE_DLL_API SgJavaImportStatement *buildJavaImportStatement(std::string, bool);
1748ROSE_DLL_API SgSourceFile *buildJavaSourceFile(SgProject *, std::string, SgClassDefinition *, std::string);
1750ROSE_DLL_API SgJavaParameterizedType *getUniqueJavaParameterizedType(SgNamedType *, SgTemplateParameterPtrList *);
1755
1757
1758
1759//----------------------------------------------------------
1761
1775
1776
1777
1778 //----------------------build unary expressions----------------------
1780
1784template <class T>
1786 SgExpression* myoperand=operand;
1787 T* result = new T(myoperand, NULL);
1788 ROSE_ASSERT(result);
1789 if (myoperand!=NULL) {
1790 myoperand->set_parent(result);
1791 // set lvalue, it asserts operand!=NULL
1792 markLhsValues(result);
1793 }
1795 return result;
1796 }
1797
1799
1802template <class T>
1804 SgExpression* myoperand = operand;
1805 T* result = new T(myoperand, NULL);
1806 ROSE_ASSERT(result);
1807
1808 if (myoperand != NULL) {
1809 myoperand->set_parent(result);
1810 // set lvalue, it asserts operand!=NULL
1811 markLhsValues(result);
1812 }
1814
1815 result->set_need_paren(false);
1816 return result;
1817 }
1818
1819//---------------------binary expressions-----------------------
1820
1822
1825 template <class T>
1827 SgExpression* mylhs, *myrhs;
1828 mylhs = lhs;
1829 myrhs = rhs;
1830 T* result = new T(mylhs,myrhs, NULL);
1831 ROSE_ASSERT(result);
1832 if (mylhs!=NULL) {
1833 mylhs->set_parent(result);
1834 // set lvalue
1835 markLhsValues(result);
1836 }
1837 if (myrhs!=NULL) myrhs->set_parent(result);
1839 return result;
1840 }
1841
1843
1846 template <class T>
1848 SgExpression* mylhs, *myrhs;
1849 mylhs = lhs;
1850 myrhs = rhs;
1851 T* result = new T(mylhs,myrhs, NULL);
1852 ROSE_ASSERT(result);
1853 if (mylhs!=NULL) {
1854 mylhs->set_parent(result);
1855 // set lvalue
1856 markLhsValues(result);
1857 }
1858 if (myrhs!=NULL) myrhs->set_parent(result);
1860 result->set_need_paren(false);
1861
1862 return result;
1863 }
1864
1865} // end of namespace
1866
1867namespace Rose {
1868 namespace Frontend {
1869 namespace Java {
1870
1871 extern ROSE_DLL_API SgClassDefinition *javaLangPackageDefinition;
1872 extern ROSE_DLL_API SgClassType *ObjectClassType;
1873 extern ROSE_DLL_API SgClassType *StringClassType;
1874 extern ROSE_DLL_API SgClassType *ClassClassType;
1875 extern ROSE_DLL_API SgVariableSymbol *lengthSymbol;
1876
1877 }// ::Rose::frontend::java
1878 }// ::Rose::frontend
1879}// ::Rose
1880
1881namespace Rose {
1882 namespace Builder {
1883 namespace Templates {
1884
1885 SgTemplateArgument * buildTemplateArgument(SgType * t);
1886 SgTemplateArgument * buildTemplateArgument(SgExpression * e);
1887 SgTemplateArgument * buildTemplateArgument(int v);
1888 SgTemplateArgument * buildTemplateArgument(bool v);
1889
1890 std::string strTemplateArgument(int v);
1891 std::string strTemplateArgument(bool v);
1892 std::string strTemplateArgument(SgType * t);
1893 std::string strTemplateArgument(SgNamedType * nt);
1894 std::string strTemplateArgument(SgExpression * e);
1895
1896 template <typename... Args>
1898 static std::string str() { return ""; }
1899 static void fill(std::vector<SgTemplateArgument *> & /*tpl_args*/) {}
1900 };
1901
1902 template <typename T>
1904 static std::string str(T v) {
1905 return strTemplateArgument(v);
1906 }
1907 static void fill(std::vector<SgTemplateArgument *> & tpl_args, T v) {
1908 SgTemplateArgument * arg = buildTemplateArgument(v);
1909 if (arg != nullptr) tpl_args.push_back(arg);
1910 }
1911 };
1912
1913 template <typename T, typename... Args>
1914 struct TemplateArgumentList<T, Args...> {
1915 static std::string str(T v, Args... args) {
1916 return strTemplateArgument(v) + ", " + TemplateArgumentList<Args...>::str(args...);
1917 }
1918 static void fill(std::vector<SgTemplateArgument *> & tpl_args, T v, Args... args) {
1919 SgTemplateArgument * arg = buildTemplateArgument(v);
1920 if (arg != nullptr) {
1921 tpl_args.push_back(arg);
1922 TemplateArgumentList<Args...>::fill(tpl_args, args...);
1923 }
1924 }
1925 };
1926
1927 template <typename... Args>
1928 std::string strTemplateArgumentList(Args... args) {
1929 return TemplateArgumentList<Args...>::str(args...);
1930 }
1931
1932 template <typename... Args>
1933 void fillTemplateArgumentList(std::vector<SgTemplateArgument *> & tpl_args, Args... args) {
1934 TemplateArgumentList<Args...>::fill(tpl_args, args...);
1935 }
1936
1937 template <typename... Args>
1938 std::vector<SgTemplateArgument *> buildTemplateArgumentList(Args... args) {
1939 std::vector<SgTemplateArgument *> tpl_args;
1940 TemplateArgumentList<Args...>::fill(tpl_args, args...);
1941 return tpl_args;
1942 }
1943
1944 SgExpression * instantiateNonrealRefExps(SgExpression * expr, std::vector<SgTemplateParameter *> & tpl_params, std::vector<SgTemplateArgument *> & tpl_args);
1945 SgType * instantiateNonrealTypes(SgType * type, std::vector<SgTemplateParameter *> & tpl_params, std::vector<SgTemplateArgument *> & tpl_args);
1946
1947 SgExpression * instantiateNonrealRefExps(SgExpression * expr, std::vector<std::vector<SgTemplateParameter *>> & tpl_params, std::vector<std::vector<SgTemplateArgument *>> & tpl_args);
1948 SgType * instantiateNonrealTypes(SgType * type, std::vector<std::vector<SgTemplateParameter *>> & tpl_params, std::vector<std::vector<SgTemplateArgument *>> & tpl_args);
1949
1950} } }
1951
1952namespace SageBuilder {
1953 using namespace Rose::Builder::Templates;
1954}
1955
1956//-----------------------------------------------------------------------------
1957//#endif // ROSE_BUILD_JAVA_LANGUAGE_SUPPORT
1958//-----------------------------------------------------------------------------
1959
1960#endif //ROSE_SAGE_BUILDER_INTERFACE
to specify a construct using a specifier Can be used alone or with parent handles when relative speci...
For preprocessing information including source comments, include , if, define, etc.
RelativePositionType
MK: Enum type to store if the directive goes before or after the corresponding line of source code.
Collection of streams.
Definition Message.h:1606
This class represents the concept of a C Assembler statement.
This class represents the rhs of a variable declaration which includes an optional assignment (e....
attribute_spec_enum
Fortran specific classification of attribute statements (each corresponds to a declaration attribute)...
This class represents the concept of a block (not a basic block from control flow analysis).
This class represents a boolean value (expression value).
This class represents the notion of a break statement (typically used in a switch statment).
This class represents the concept of a C and C++ case option (used within a switch statement).
This class represents a cast of one type to another.
cast_type_enum
Classification of Casts.
This class represents the concept of a catch within a try-catch construct used in C++ exception handl...
This class represents the concept of a C++ sequence of catch statements.
This class represents the concept of a class declaration statement. It includes the concept of an ins...
This class represents the concept of a class definition in C++.
This class represents the concept of a C++ expression built from a class name.
This class represents the concept of a class name within the compiler.
This class represents the concept of a C trinary conditional expression (e.g. "test ?...
cv_modifier_enum
Const Volatile Modifier.
This class represents the call of a class constructor to initialize a variable. For example "Foo foo;...
This class represents the concept of a C or C++ continue statement.
This class represents the concept of a contructor initializer list (used in constructor (member funct...
This class represents the concept of a declaration statement.
This class represents the concept of a C or C++ default case within a switch statement.
This class represents the concept of a C++ call to the delete operator.
This class represents the concept of a do-while statement.
This class represents the notion of an value (expression value).
This class represents the concept of an enum declaration.
This class represents the concept of the dynamic execution of a string, file, or code object....
This class represents the concept of a C and C++ expression list.
This class represents the concept of a C or C++ statement which contains a expression.
This class represents the notion of an expression. Expressions are derived from SgLocatedNodes,...
This class represents a source file for a project (which may contian many source files and or directo...
This class represents the notion of an value (expression value).
This class represents the variable declaration or variable initialization withn a for loop.
This class represents the concept of a for loop.
This class represents the concept of a C++ function call (which is an expression).
This class represents the concept of a function declaration statement.
This class represents the concept of a declaration list.
This class represents the function being called and must be assembled in the SgFunctionCall with the ...
This class represents a type for all functions.
This class represents the concept of a C or C++ goto statement.
This class represents the concept of an "if" construct.
This class represents the notion of a declared variable.
This class represents the notion of an initializer for a variable declaration or expression in a func...
This class represents the concept of a C or C++ label statement.
This class represents a lambda expression.
This class represents a list display.
This class represents the notion of an expression or statement which has a position within the source...
This class represents the notion of an value (expression value).
This class represents the concept of a member function declaration statement.
This class represents the member function being called and must be assembled in the SgFunctionCall wi...
This class represents the numeric negation of a value. Not to be confused with SgSubtractOp.
This class represents strings within the IR nodes.
This class represents the concept of a C++ namespace alias declaration statement.
This class represents the concept of a C++ namespace declaration.
This class represents the concept of a namespace definition.
This class represents the notion of an n-ary boolean operation. This node is intended for use with Py...
This class represents the notion of an n-ary comparison operation. This node is intended for use with...
This class represents the concept of a C++ call to the new operator.
This class represents the base class for all IR nodes within Sage III.
void set_parent(SgNode *parent)
All nodes in the AST contain a reference to a parent node.
This class represents the concept of a C Assembler statement (untested).
subprogram_kind_enum
Classification for different types of Fortran subprograms.
This class represents a source project, with a list of SgFile objects and global information about th...
This class represents the concept of a 'global' stmt in Python.
This class represents the concept of a C Assembler statement (untested).
This class represents the concept of a scope in C++ (e.g. global scope, fuction scope,...
This class represents the "sizeof()" operator (applied to any type).
This class represents the GNU extension "statement expression" (thus is non-standard C and C++).
This class represents the notion of a statement.
This class is intended to be a wrapper around SgStatements, allowing them to exist in scopes that onl...
storage_modifier_enum
Storage Modifiers (only one value can be specified)
This class represents the conversion of an arbitrary expression to a string. This node is intended fo...
This class represents the concept of a switch.
This class represents the concept of a name within the compiler.
This class represents template argument within the use of a template to build an instantiation.
This class represents the concept of an instantiation of member function template or a member functio...
This class represents the "this" operator (can be applied to any member data).
This class represents the C++ throw expression (handled as a unary operator).
e_throw_kind
Throw IR node can be used in three different ways.
This class represents the concept of try statement within the try-catch support for exception handlin...
This class represents a tuple display.
This class represents a C99 complex type.
This class represents a C99 complex type.
This class represents a string type used for SgStringVal IR node.
This class represents the base class for all types.
This class represents the notion of a typedef declaration.
Sgop_mode
Enum value defines operators as prefix or postfix, as appropriate, e.g. operator++().
This class represents the concept of a C++ using directive.
This class represents the notion of an value (expression value).
This class represents the variable refernece in expressions.
This class represents the concept of a C or C++ variable declaration.
This class represents the definition (initialization) of a variable.
This class represents the concept of a variable name within the compiler (a shared container for the ...
This class represents the concept of a do-while statement.
The ROSE library.
Functions that build an AST.
Definition sageBuilder.h:32
ROSE_DLL_API SgTypeFloat16 * buildFloat16Type()
Built in simple types.
ROSE_DLL_API SgTemplateInstantiationTypedefDeclaration * buildTemplateInstantiationTypedefDeclaration_nfi(SgName &name, SgType *base_type, SgScopeStatement *scope, bool has_defining_base, SgTemplateTypedefDeclaration *templateTypedefDeclaration, SgTemplateArgumentPtrList &templateArgumentsList)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgJavaMemberValuePair * buildJavaMemberValuePair(const SgName &, SgExpression *)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgCastExp * buildCastExp_nfi(SgExpression *operand_i, SgType *expression_type, SgCastExp::cast_type_enum cast_type)
ROSE_DLL_API SgUpcBarrierStatement * buildUpcBarrierStatement_nfi(SgExpression *exp)
Build a UPC barrier statement.
ROSE_DLL_API SgAtomicStmt * buildAtomicStmt(SgBasicBlock *body)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgAtStmt * buildAtStmt(SgExpression *expression, SgBasicBlock *body)
MH (6/11/2014): Added at support.
ROSE_DLL_API SgJovialBitType * buildJovialBitType(SgExpression *size)
Build a Jovial bit type of a given size.
ROSE_DLL_API SgColonShapeExp * buildColonShapeExp()
Build a Fortran colon-shape expression, set file info as the default one.
ROSE_DLL_API SgJovialTableType * buildJovialTableType(const SgName &name, SgType *base_type, SgExprListExp *dim_info, SgScopeStatement *scope=NULL)
Build a Jovial table type with required class definition and defining and nondefining declarations.
ROSE_DLL_API SgFunctionDeclaration * buildNondefiningFunctionDeclaration(const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL, SgExprListExp *decoratorList=NULL, bool buildTemplateInstantiation=false, SgTemplateArgumentPtrList *templateArgumentsList=NULL, SgStorageModifier::storage_modifier_enum sm=SgStorageModifier::e_default)
Build a prototype for a function, handle function type, symbol etc transparently.
ROSE_DLL_API SgFloat32Val * buildFloat32Val(float v=0)
Build a float32.
T * buildBinaryExpression_nfi(SgExpression *lhs, SgExpression *rhs)
Template function to build a binary expression of type T, taking care of parent pointers,...
ROSE_DLL_API SgTemplateArgumentPtrList * getTemplateArgumentList(SgDeclarationStatement *decl)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgSwitchStatement * buildSwitchStatement_nfi(SgStatement *item_selector, SgStatement *body)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgBaseClass * buildBaseClass(SgClassDeclaration *classDeclaration, SgClassDefinition *classDefinition, bool isVirtual, bool isDirect)
DQ (5/6/2013): Added build functions to support SgBaseClass construction.
SourcePositionClassification
intended to be a private member, don't access it directly. could be changed any time
@ e_sourcePosition_last
Specify as source position to be filled in as part of AST construction in the front-end.
@ e_sourcePositionNullPointers
Classify as compiler generated code (e.g. template instantiation).
@ e_sourcePositionCompilerGenerated
Classify as a transformation.
@ e_sourcePositionFrontendConstruction
Set pointers to Sg_File_Info objects to NULL.
@ e_sourcePositionDefault
Error value for enum.
@ e_sourcePositionTransformation
Default source position.
ROSE_DLL_API SgFunctionParameterRefExp * buildFunctionParameterRefExp_nfi(int parameter_number, int parameter_level)
ROSE_DLL_API SgThrowOp * buildThrowOp(SgExpression *, SgThrowOp::e_throw_kind)
Build a ThrowOp expression.
ROSE_DLL_API SgPointerMemberType * buildPointerMemberType(SgType *base_type, SgType *classType)
Pei-Hung (06/30/2023): support for SgPointerMemberType.
ROSE_DLL_API SgPragma * buildPragma(const std::string &name)
Build SgPragma.
ROSE_DLL_API void testTemplateParameterParents(SgDeclarationStatement *decl)
DQ (9/16/2012): Added function to support setting the template parameters and setting their parents (...
ROSE_DLL_API SgStringConversion * buildStringConversion(SgExpression *exp)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgChooseExpression * buildChooseExpression_nfi()
ROSE_DLL_API SgJavaWildcardType * getUniqueJavaWildcardExtends(SgType *)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgUpcForAllStatement * buildUpcForAllStatement_nfi(SgStatement *initialize_stmt, SgStatement *test, SgExpression *increment, SgExpression *affinity, SgStatement *loop_body)
Build a UPC forall statement.
ROSE_DLL_API SgBFloat16Val * buildBFloat16Val_nfi(float v, const std::string &str)
ROSE_DLL_API SgUnsignedLongVal * buildUnsignedLongValHex(unsigned long v=0)
ROSE_DLL_API SgClassType * buildClassTemplateType(SgTemplateClassDeclaration *template_decl, std::vector< SgNode * > &template_args)
Some support for building class template instantiation declarations.
SgPragmaDeclaration * buildPragmaDeclaration_nfi(const std::string &name, SgScopeStatement *scope)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgNullptrValExp * buildNullptrValExp_nfi()
ROSE_DLL_API SgDerivedTypeStatement * buildDerivedTypeStatement(const SgName &name, SgScopeStatement *scope=NULL)
Build an SgDerivedTypeStatement Fortran derived type declaration with a class declaration and definit...
ROSE_DLL_API SgExprStatement * buildFunctionCallStmt(const SgName &name, SgType *return_type, SgExprListExp *parameters=NULL, SgScopeStatement *scope=NULL)
Build a regular function call statement.
ROSE_DLL_API SgExecStatement * buildExecStatement(SgExpression *executable, SgExpression *globals=NULL, SgExpression *locals=NULL)
Build an exec statement.
ROSE_DLL_API SgShortVal * buildShortValHex(short value=0)
ROSE_DLL_API SgClassDeclaration * buildClassDeclaration_nfi(const SgName &name, SgClassDeclaration::class_types kind, SgScopeStatement *scope, SgClassDeclaration *nonDefiningDecl, bool buildTemplateInstantiation, SgTemplateArgumentPtrList *templateArgumentsList)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgTypeSignedLongLong * buildSignedLongLongType()
Built in simple types.
ROSE_DLL_API SgNewExp * buildNewExp(SgType *type, SgExprListExp *exprListExp, SgConstructorInitializer *constInit, SgExpression *expr, short int val, SgFunctionDeclaration *funcDecl)
SgPythonGlobalStmt * buildPythonGlobalStmt_nfi(SgInitializedNamePtrList &names)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SourcePositionClassification getSourcePositionClassificationMode()
Get the current source position classification (defines how IR nodes built by the SageBuilder interfa...
SgNullStatement * buildNullStatement_nfi()
Build a NULL statement.
ROSE_DLL_API SgForStatement * buildForStatement_nfi(SgStatement *initialize_stmt, SgStatement *test, SgExpression *increment, SgStatement *loop_body, SgStatement *else_body=NULL)
Based on the contribution from Pradeep Srinivasa@ LANL.
ROSE_DLL_API SgTypeUnsignedLongLong * buildUnsignedLongLongType()
Built in simple types.
ROSE_DLL_API SgCompoundInitializer * buildCompoundInitializer(SgExprListExp *initializers=NULL, SgType *type=NULL)
Build a compound initializer, for vector type initialization.
ROSE_DLL_API SgTypeString * buildStringType()
DQ (8/21/2010): We want to move to the new buildStringType( SgExpression*,size_t) function over the o...
ROSE_DLL_API SgUpcThreads * buildUpcThreads_nfi()
Build UPC THREADS (integer expression)
ROSE_DLL_API SgModifierType * buildModifierType(SgType *base_type=nullptr)
Build a modifier type.
ROSE_DLL_API SgCaseOptionStmt * buildCaseOptionStmt(SgExpression *key=NULL, SgStatement *body=NULL)
Build a case option statement.
ROSE_DLL_API SgTemplateFunctionDeclaration * buildDefiningTemplateFunctionDeclaration(const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope, SgExprListExp *decoratorList, SgTemplateFunctionDeclaration *first_nondefining_declaration)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgCatchOptionStmt * buildCatchOptionStmt(SgVariableDeclaration *condition=NULL, SgStatement *body=NULL)
Build a catch statement.
ROSE_DLL_API SgLongLongIntVal * buildLongLongIntVal_nfi(long long value, const std::string &str)
ROSE_DLL_API SgClassType * buildTemplateClassType(SgTemplateClassDeclaration *template_decl, std::vector< SgNode * > &template_args)
Same as buildClassTemplateType(), just better name.
SgFortranContinueStmt * buildFortranContinueStmt_nfi()
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgTemplateMemberFunctionDeclaration * buildNondefiningTemplateMemberFunctionDeclaration(const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope, SgExprListExp *decoratorList, unsigned int functionConstVolatileFlags, SgTemplateParameterPtrList *templateParameterList)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgLabelStatement * buildLabelStatement(const SgName &name, SgStatement *stmt=NULL, SgScopeStatement *scope=NULL)
Build a label statement, name is the label's name. Handling label symbol and scope internally.
ROSE_DLL_API SgFortranDo * buildFortranDo_nfi(SgExpression *initialization, SgExpression *bound, SgExpression *increment, SgBasicBlock *)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgUpcThreads * buildUpcThreads()
Build UPC THREADS (integer expression)
ROSE_DLL_API SgModifierType * buildRestrictType(SgType *base_type)
Build a restrict type.
ROSE_DLL_API SgIntVal * buildIntVal_nfi(int value=0)
ROSE_DLL_API SgLongDoubleVal * buildLongDoubleVal(long double value=0.0)
SgFunctionParameterList * buildFunctionParameterList_nfi()
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API AbstractHandle::abstract_handle * buildAbstractHandle(SgNode *n)
Build an abstract handle from a SgNode.
ROSE_DLL_API SgClassDeclaration * buildClassDeclaration(SgName name, SgScopeStatement *scope)
Build C++ class (builds both the non-defining and defining declarations; in that order).
ROSE_DLL_API SgMinusOp * buildMinusOp_nfi(SgExpression *op)
ROSE_DLL_API SgTemplateFunctionDeclaration * buildNondefiningTemplateFunctionDeclaration(const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope=NULL, SgExprListExp *decoratorList=NULL, SgTemplateParameterPtrList *templateParameterList=NULL)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgAsmStmt * buildMultibyteNopStatement(int n)
DQ (4/30/2010): Added support for building nop statement using asm statement Building nop statement u...
ROSE_DLL_API SgKeyDatumPair * buildKeyDatumPair(SgExpression *key, SgExpression *datum)
Build a key-datum pair.
ROSE_DLL_API SgComprehension * buildComprehension(SgExpression *target, SgExpression *iter, SgExprListExp *ifs)
ROSE_DLL_API SgJavaParameterizedType * getUniqueJavaParameterizedType(SgNamedType *, SgTemplateParameterPtrList *)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgComplexVal * buildImaginaryVal_nfi(SgValueExp *imaginary_value, const std::string &str)
ROSE_DLL_API SgFunctionCallExp * buildFunctionCallExp(SgFunctionSymbol *sym, SgExprListExp *parameters=NULL)
Build a function call expression.
ROSE_DLL_API SgType * getTargetFileType(SgType *snippet_type, SgScopeStatement *targetScope)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgTemplateParameter * buildTemplateParameter(SgTemplateParameter::template_parameter_enum parameterType, SgType *)
Build a template parameter, passing enum kind and SgTemplateType template_parameter_enum { parameter_...
ROSE_DLL_API SgNoexceptOp * buildNoexceptOp(SgExpression *exp=NULL)
Build noexcept operator expression with an expression parameter.
ROSE_DLL_API SgSignedCharVal * buildSignedCharVal_nfi(signed char v, const std::string &str)
ROSE_DLL_API SgClassDeclaration * buildNondefiningClassDeclaration(SgName name, SgScopeStatement *scope)
DQ (11/7/2009): Added functions to build C++ class.
SgMemberFunctionRefExp * buildMemberFunctionRefExp_nfi(SgMemberFunctionSymbol *sym, bool virtual_call, bool need_qualifier)
ROSE_DLL_API SgFunctionDeclaration * buildDefiningFunctionDeclaration(const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope, SgExprListExp *decoratorList, bool buildTemplateInstantiation=false, SgFunctionDeclaration *first_nondefinng_declaration=NULL, SgTemplateArgumentPtrList *templateArgumentsList=NULL)
Build a function declaration with a function body.
ROSE_DLL_API SgModifierType * buildUpcSharedType(SgType *base_type=nullptr, long layout=-1)
Build a UPC shared type.
ROSE_DLL_API SgGotoStatement * buildGotoStatement(SgLabelStatement *label=NULL)
Build a goto statement.
ROSE_DLL_API std::string display(SourcePositionClassification &scp)
display function for debugging
ROSE_DLL_API SgUnsignedLongVal * buildUnsignedLongVal_nfi(unsigned long v, const std::string &str)
ROSE_DLL_API SgLabelRefExp * buildLabelRefExp(SgLabelSymbol *s)
Build a Fortran numeric label ref exp.
ROSE_DLL_API SgCompoundInitializer * buildCompoundInitializer_nfi(SgExprListExp *initializers, SgType *type=NULL)
Build a compound initializer, for vector type initialization.
ROSE_DLL_API SgSourceFile * buildJavaSourceFile(SgProject *, std::string, SgClassDefinition *, std::string)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgCatchStatementSeq * buildCatchStatementSeq(SgCatchOptionStmt *=NULL)
Build an initial sequence of Catch blocks containing 0 or 1 element.
ROSE_DLL_API SgInitializedName * buildInitializedName(const SgName &name, SgType *type, SgInitializer *init=NULL)
Initialized names are tricky, their scope vary depending on context, so scope and symbol information ...
ROSE_DLL_API SgTryStmt * buildTryStmt(SgStatement *body, SgCatchOptionStmt *catch0=NULL, SgCatchOptionStmt *catch1=NULL, SgCatchOptionStmt *catch2=NULL, SgCatchOptionStmt *catch3=NULL, SgCatchOptionStmt *catch4=NULL)
Build a try statement.
ROSE_DLL_API SgJavaImportStatement * buildJavaImportStatement(std::string, bool)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgThisExp * buildThisExp_nfi(SgSymbol *sym)
ROSE_DLL_API SgEnumDeclaration * buildEnumDeclaration_nfi(const SgName &name, SgScopeStatement *scope=NULL)
Build an enum, It is also a declaration statement in SAGE III.
ROSE_DLL_API SgNonrealDecl * buildNonrealDecl(const SgName &name, SgDeclarationScope *scope, SgDeclarationScope *child_scope=NULL)
Build a declaration of a non-real class or class-member representing template parameters and their me...
SgAssertStmt * buildAssertStmt_nfi(SgExpression *test)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgThisExp * buildThisExp(SgSymbol *sym)
Build this pointer.
ROSE_DLL_API SgSymbol * findAssociatedSymbolInTargetAST(SgDeclarationStatement *snippet_declaration, SgScopeStatement *targetScope)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgListComprehension * buildListComprehension(SgExpression *elt, SgExprListExp *generators)
ROSE_DLL_API SgMinusMinusOp * buildMinusMinusOp_nfi(SgExpression *op)
ROSE_DLL_API SgModifierType * buildUpcBlockStarType(SgType *base_type=nullptr)
Build a UPC shared[*] type.
ROSE_DLL_API SgStringConversion * buildStringConversion_nfi(SgExpression *exp)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgFloat16Val * buildFloat16Val_nfi(float v, const std::string &str)
SgTupleExp * buildTupleExp_nfi()
ROSE_DLL_API SgIntVal * buildIntValHex(int value=0)
ROSE_DLL_API SgTemplateClassDeclaration * buildNondefiningTemplateClassDeclaration_nfi(const SgName &name, SgClassDeclaration::class_types kind, SgScopeStatement *scope, SgTemplateParameterPtrList *templateParameterList, SgTemplateArgumentPtrList *templateSpecializationArgumentList)
DQ (11/29/2011): Adding template declaration support to the AST.
ROSE_DLL_API void setTemplateParametersInDeclaration(SgDeclarationStatement *decl, SgTemplateParameterPtrList *templateParametersList_input)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgDeclType * buildDeclType(SgExpression *base_expression, SgType *base_type)
Build a decltype reference type.
ROSE_DLL_API SgUnsignedShortVal * buildUnsignedShortVal_nfi(unsigned short v, const std::string &str)
ROSE_DLL_API SgJavaWildcardType * getUniqueJavaWildcardUnbound()
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgIfStmt * buildIfStmt_nfi(SgStatement *conditional, SgStatement *true_body, SgStatement *false_body)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgDictionaryComprehension * buildDictionaryComprehension(SgKeyDatumPair *kd_pair, SgExprListExp *generators)
ROSE_DLL_API SgShortVal * buildShortVal_nfi(short value, const std::string &str)
ROSE_DLL_API void clearScopeStack()
intended to be a private member, don't access it directly. could be changed any time
ROSE_DLL_API SgLongIntVal * buildLongIntVal(long value=0)
Build a long integer value expression.
ROSE_DLL_API SgJavaTypeExpression * buildJavaTypeExpression(SgType *)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgChar16Val * buildChar16Val(unsigned short value=0)
ROSE_DLL_API SgAwaitExpression * buildAwaitExpression()
SgDeleteExp * buildDeleteExp_nfi(SgExpression *target, bool is_array=false, bool need_global_specifier=false, SgFunctionDeclaration *deleteOperatorDeclaration=NULL)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgFoldExpression * buildFoldExpression_nfi(SgExpression *operands, std::string operator_token_string, bool is_left_associative)
ROSE_DLL_API SgBracedInitializer * buildBracedInitializer_nfi(SgExprListExp *initializers=NULL, SgType *expression_type=NULL)
ROSE_DLL_API SgMemberFunctionType * buildMemberFunctionType(SgType *return_type, SgFunctionParameterTypeList *typeList, SgScopeStatement *struct_name, unsigned int mfunc_specifier)
Built in simple types.
ROSE_DLL_API SgVariableDefinition * buildVariableDefinition_nfi(SgVariableDeclaration *decl, SgInitializedName *init_name, SgInitializer *init)
Build variable definition.
ROSE_DLL_API SgBasicBlock * buildBasicBlock_nfi()
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgUpcMythread * buildUpcMythread_nfi()
Build UPC MYTHREAD (integer expression)
ROSE_DLL_API SgWhileStmt * buildWhileStmt(SgStatement *condition, SgStatement *body, SgStatement *else_body=NULL)
Build while statement.
ROSE_DLL_API SgType * buildFortranImplicitType(SgName name)
Build a type based on Fortran's implicit typing rules.
ROSE_DLL_API SgTypeFloat32 * buildFloat32Type()
Built in simple types.
ROSE_DLL_API SgTemplateClassDeclaration * buildNondefiningTemplateClassDeclaration(const SgName &name, SgClassDeclaration::class_types kind, SgScopeStatement *scope, SgTemplateParameterPtrList *templateParameterList, SgTemplateArgumentPtrList *templateSpecializationArgumentList)
buildNondefiningTemplateClassDeclaration()
ROSE_DLL_API void setSourcePositionClassificationMode(SourcePositionClassification X)
Set the current source position classification (defines how IR nodes built by the SageBuilder interfa...
ROSE_DLL_API SgClassDeclaration * buildStructDeclaration(const SgName &name, SgScopeStatement *scope=NULL)
Build a structure, It is also a declaration statement in SAGE III.
SgCtorInitializerList * buildCtorInitializerList_nfi()
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgNamespaceAliasDeclarationStatement * buildNamespaceAliasDeclarationStatement(const SgName &name, SgNamespaceDeclarationStatement *namespaceDeclaration)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgClassDefinition * buildClassDefinition(SgClassDeclaration *d=NULL, bool buildTemplateInstantiation=false)
Build a class definition scope statement.
ROSE_DLL_API SgJovialBitVal * buildJovialBitVal_nfi(const std::string &str)
Build a Jovial bit value expression.
ROSE_DLL_API SgCharVal * buildCharVal_nfi(char value, const std::string &str)
ROSE_DLL_API SgJavaThrowStatement * buildJavaThrowStatement(SgThrowOp *)
Build a Java Throw statement.
ROSE_DLL_API SgJavaSynchronizedStatement * buildJavaSynchronizedStatement(SgExpression *, SgBasicBlock *)
Build a Java Synchronized statement.
ROSE_DLL_API PreprocessingInfo * 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 no...
SgConditionalExp * buildConditionalExp_nfi(SgExpression *test, SgExpression *a, SgExpression *b, SgType *t)
ROSE_DLL_API SgNamespaceDefinitionStatement * buildNamespaceDefinition(SgNamespaceDeclarationStatement *d=NULL)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgDefaultOptionStmt * buildDefaultOptionStmt(SgStatement *body=NULL)
Build a default option statement.
SgCudaKernelExecConfig * buildCudaKernelExecConfig_nfi(SgExpression *grid=NULL, SgExpression *blocks=NULL, SgExpression *shared=NULL, SgExpression *stream=NULL)
Build a CUDA kernel execution configuration (<<<grid, blocks, shared, stream>>>)
ROSE_DLL_API SgJavaSingleMemberAnnotation * buildJavaSingleMemberAnnotation(SgType *, SgExpression *)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgForStatement * buildForStatement(SgStatement *initialize_stmt, SgStatement *test, SgExpression *increment, SgStatement *loop_body, SgStatement *else_body=NULL)
Build a for statement, assume none of the arguments is NULL.
ROSE_DLL_API SgTypeMatrix * buildMatrixType()
Build a Matlab Matrix Type.
ROSE_DLL_API SgModuleStatement * buildModuleStatement(const SgName &name, SgScopeStatement *scope)
Build a Fortran module declaration.
ROSE_DLL_API SgContinueStmt * buildContinueStmt()
Build a continue statement.
ROSE_DLL_API SgEmptyDeclaration * buildEmptyDeclaration()
Build an empty declaration (useful for adding precission to comments and CPP handling under token-bas...
ROSE_DLL_API SgUnsignedIntVal * buildUnsignedIntValHex(unsigned int v=0)
ROSE_DLL_API SgTemplateType * buildTemplateType(SgName name="")
Build a template type, used for template parameter and later argument.
ROSE_DLL_API SgLambdaRefExp * buildLambdaRefExp(SgType *return_type, SgFunctionParameterList *params, SgScopeStatement *scope)
Build lambda expression.
ROSE_DLL_API SgFloatVal * buildFloatVal_nfi(float value=0.0)
ROSE_DLL_API SgConditionalExp * buildConditionalExp(SgExpression *test=NULL, SgExpression *a=NULL, SgExpression *b=NULL)
Build a conditional expression ?:
ROSE_DLL_API SgUnsignedLongVal * buildUnsignedLongVal(unsigned long v=0)
Build a unsigned long integer.
ROSE_DLL_API SgCommonBlock * buildCommonBlock(SgCommonBlockObject *first_block=NULL)
Build a Fortran Common statement.
ROSE_DLL_API SgTypeInt * buildIntType()
Built in simple types.
SgDictionaryComprehension * buildDictionaryComprehension_nfi(SgKeyDatumPair *kd_pair, SgExprListExp *generators)
ROSE_DLL_API SgTemplateClassDeclaration * buildTemplateClassDeclaration_nfi(const SgName &name, SgClassDeclaration::class_types kind, SgScopeStatement *scope, SgTemplateClassDeclaration *nonDefiningDecl, SgTemplateParameterPtrList *templateParameterList, SgTemplateArgumentPtrList *templateSpecializationArgumentList)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgTypeUnsignedInt * buildUnsignedIntType()
Built in simple types.
ROSE_DLL_API SgFloat80Val * buildFloat80Val(long double value=0.0)
SgSubscriptExpression * buildSubscriptExpression_nfi(SgExpression *lower_bound, SgExpression *upper_bound, SgExpression *stride)
Build a SgSubscriptExpression, used for array shape expressions. The lower bound and stride may be nu...
ROSE_DLL_API SgDotDotExp * buildDotDotExp()
Build a variable declaration, handle symbol table transparently.
SourcePositionClassification SourcePositionClassificationMode
C++ SageBuilder namespace specific state for storage of the source code position state (used to contr...
ROSE_DLL_API SgTypeBFloat16 * buildBFloat16Type()
Built in simple types.
ROSE_DLL_API SgMinusOp * buildMinusOp(SgExpression *op=NULL)
std::list< SgScopeStatement * > ScopeStack
intended to be a private member, don't access it directly. could be changed any time
ROSE_DLL_API SgModifierType * buildUpcBlockIndefiniteType(SgType *base_type=nullptr)
Build a UPC shared[] type.
SgSetComprehension * buildSetComprehension_nfi(SgExpression *elt, SgExprListExp *generators)
ROSE_DLL_API SgTypeFp16 * buildFp16Type()
Built in simple types.
SgName unparseTemplateArgumentToString(SgTemplateArgument *templateArgument)
DQ (3/9/2018): Added to support debugging.
ROSE_DLL_API SgSuperExp * buildSuperExp(SgClassSymbol *sym)
Build super pointer.
ROSE_DLL_API SgExprListExp * 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.
ROSE_DLL_API SgRangeBasedForStatement * buildRangeBasedForStatement_nfi(SgVariableDeclaration *initializer, SgVariableDeclaration *range, SgVariableDeclaration *begin_declaration, SgVariableDeclaration *end_declaration, SgExpression *not_equal_expression, SgExpression *increment_expression, SgStatement *body)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgJavaPackageStatement * buildJavaPackageStatement(std::string)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgJavaLabelStatement * buildJavaLabelStatement(const SgName &, SgStatement *=NULL)
Build a Java Label statement.
ROSE_DLL_API SgEquivalenceStatement * buildEquivalenceStatement(SgExpression *lhs, SgExpression *rhs)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgListExp * buildListExp(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 SgListExp.
ROSE_DLL_API SgUnsignedCharVal * buildUnsignedCharValHex(unsigned char v=0)
ROSE_DLL_API SgModifierType * buildNotNullType(SgType *base_type)
Build a not null type for Ada.
ROSE_DLL_API SgLambdaExp * buildLambdaExp_nfi(SgLambdaCaptureList *lambda_capture_list, SgClassDeclaration *lambda_closure_class, SgFunctionDeclaration *lambda_function)
ROSE_DLL_API SgTemplateClassDeclaration * buildTemplateClassDeclaration(const SgName &name, SgClassDeclaration::class_types kind, SgScopeStatement *scope, SgTemplateClassDeclaration *nonDefiningDecl, SgTemplateParameterPtrList *templateParameterList, SgTemplateArgumentPtrList *templateSpecializationArgumentList)
Build tempplate class declaration.
ROSE_DLL_API SgSourceFile * buildSourceFile(const std::string &outputFileName, SgProject *project=NULL, bool clear_globalScopeAcrossFiles=false)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API void setTemplateSpecializationArgumentsInDeclaration(SgDeclarationStatement *decl, SgTemplateArgumentPtrList *templateSpecializationArgumentsList_input)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgArrayType * buildArrayType(SgType *base_type=nullptr, SgExpression *index=nullptr)
Build ArrayType.
ROSE_DLL_API SgTypeFloat32x * buildFloat32xType()
Built in simple types.
ROSE_DLL_API SgEnumDeclaration * buildNondefiningEnumDeclaration_nfi(const SgName &name, SgScopeStatement *scope)
Build an enum first nondefining declaration, without file info.
ROSE_DLL_API SgComplexVal * buildImaginaryVal(long double imaginary_value)
ROSE_DLL_API SgLambdaCapture * buildLambdaCapture_nfi(SgExpression *capture_variable, SgExpression *source_closure_variable, SgExpression *closure_variable)
ROSE_DLL_API SgNullptrValExp * buildNullptrValExp()
DQ (7/31/2014): Adding support for C++11 nullptr const value expressions.
ROSE_DLL_API void fixupCopyOfAstFromSeparateFileInNewTargetAst(SgStatement *insertionPoint, bool insertionPointIsScope, SgStatement *toInsert, SgStatement *original_before_copy)
Fixup any AST moved from one file two another (references to symbols, types, etc.).
SgExprStatement * buildExprStatement_nfi(SgExpression *exp)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgTypeExpression * buildTypeExpression(SgType *type)
DQ (7/24/2014): Adding support for c11 generic operands.
ROSE_DLL_API SgTypeFixed * buildFixedType(SgExpression *fraction, SgExpression *scale)
Build a Jovial fixed type with a fraction specifier and a scale specifier.
SgPythonPrintStmt * buildPythonPrintStmt_nfi(SgExpression *dest=NULL, SgExprListExp *values=NULL)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgTemplateVariableDeclaration * buildTemplateVariableDeclaration_nfi(const SgName &name, SgType *type, SgInitializer *varInit, SgScopeStatement *scope)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgNaryComparisonOp * buildNaryComparisonOp_nfi(SgExpression *lhs)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgReturnStmt * buildReturnStmt(SgExpression *expression=NULL)
Build a return statement.
SgCaseOptionStmt * buildCaseOptionStmt_nfi(SgExpression *key, SgStatement *body)
Build a variable declaration, handle symbol table transparently.
SgWithStatement * buildWithStatement_nfi(SgExpression *expr, SgStatement *body)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgUpcFenceStatement * buildUpcFenceStatement_nfi()
Build a UPC fence statement.
ROSE_DLL_API SgComplexVal * buildComplexVal_nfi(SgValueExp *real_value, SgValueExp *imaginary_value, const std::string &str)
SgCudaKernelCallExp * buildCudaKernelCallExp_nfi(SgExpression *kernel, SgExprListExp *parameters=NULL, SgCudaKernelExecConfig *config=NULL)
Build a CUDA kernel call expression (kernel<<<config>>>(parameters))
ROSE_DLL_API SgTypeFloat64x * buildFloat64xType()
Built in simple types.
SgCompoundLiteralExp * buildCompoundLiteralExp_nfi(SgVariableSymbol *varSymbol)
Build function for compound literals (uses a SgVariableSymbol and is similar to buildVarRefExp_nfi())...
ROSE_DLL_API SgChar16Val * buildChar16Val_nfi(unsigned short value, const std::string &str)
ROSE_DLL_API SgTypeLongLong * buildLongLongType()
Built in simple types.
ROSE_DLL_API SgTypeFloat128 * buildFloat128Type()
Built in simple types.
ROSE_DLL_API SgProcedureHeaderStatement * buildNondefiningProcedureHeaderStatement(const SgName &name, SgType *return_type, SgFunctionParameterList *param_list, SgProcedureHeaderStatement::subprogram_kind_enum, SgScopeStatement *scope=NULL)
Build a nondefining SgProcedureHeaderStatement, handle function type, symbol etc transparently.
ROSE_DLL_API SgFloat32Val * buildFloat32Val_nfi(float v, const std::string &str)
ROSE_DLL_API SgVarRefExp * buildVarRefExp(const SgName &name, SgScopeStatement *scope=NULL)
Build SgVarRefExp based on a variable's Sage name. It will lookup the name in the symbol table intern...
SgComprehension * buildComprehension_nfi(SgExpression *target, SgExpression *iter, SgExprListExp *ifs)
ROSE_DLL_API SgJovialTableStatement * buildJovialTableStatement(const SgName &name, SgClassDeclaration::class_types kind, SgScopeStatement *scope=NULL)
Build a Jovial table declaration statement.
ROSE_DLL_API SgLongLongIntVal * buildLongLongIntVal(long long value=0)
Build a long long integer value expression.
ROSE_DLL_API SgUnsignedLongLongIntVal * buildUnsignedLongLongIntVal(unsigned long long v=0)
Build an unsigned long long integer.
ROSE_DLL_API SgVarRefExp * buildJavaArrayLengthVarRefExp()
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgSuperExp * buildSuperExp_nfi(SgClassSymbol *sym)
SgKeyDatumPair * buildKeyDatumPair_nfi(SgExpression *key, SgExpression *datum)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgNamespaceDeclarationStatement * buildNamespaceDeclaration(const SgName &name, SgScopeStatement *scope=NULL)
tps (09/02/2009) : Added support for building namespaces
ROSE_DLL_API SgAggregateInitializer * buildAggregateInitializer_nfi(SgExprListExp *initializers, SgType *type=NULL)
Build an aggregate initializer.
ROSE_DLL_API SgTypeUnsignedShort * buildUnsignedShortType()
Built in simple types.
ROSE_DLL_API SgTypedefDeclaration * buildTypedefDeclaration_nfi(const std::string &name, SgType *base_type, SgScopeStatement *scope=NULL, bool has_defining_base=false)
Build a typedef declaration, such as: typedef int myint;.
ROSE_DLL_API SgTemplateVariableDeclaration * buildTemplateVariableDeclaration(const SgName &name, SgType *type, SgInitializer *varInit, SgScopeStatement *scope)
Build template variable declarations.
ROSE_DLL_API SgMinusMinusOp * buildMinusMinusOp(SgExpression *op=NULL)
ROSE_DLL_API void buildDoWhileStatement_nfi(SgDoWhileStmt *result, SgStatement *body, SgStatement *condition)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgTypeSigned128bitInteger * buildSigned128bitIntegerType()
Built in simple types.
ROSE_DLL_API SgUnsignedCharVal * buildUnsignedCharVal_nfi(unsigned char v, const std::string &str)
bool symbol_table_case_insensitive_semantics
Support for construction of case sensitive/insensitive symbol table handling in scopes.
SgListExp * buildListExp_nfi()
ROSE_DLL_API SgFortranIncludeLine * buildFortranIncludeLine(std::string filename)
Build Fortran include line.
ROSE_DLL_API SgPythonPrintStmt * buildPythonPrintStmt(SgExpression *dest=NULL, SgExprListExp *values=NULL)
Build a python print statement.
T * buildBinaryExpression(SgExpression *lhs, SgExpression *rhs)
Template function to build a binary expression of type T, taking care of parent pointers,...
ROSE_DLL_API SgConstructorInitializer * buildConstructorInitializer(SgMemberFunctionDeclaration *declaration, SgExprListExp *args, SgType *expression_type, bool need_name, bool need_qualifier, bool need_parenthesis_after_name, bool associated_class_unknown)
ROSE_DLL_API SgDoWhileStmt * buildDoWhileStmt(SgStatement *body, SgStatement *condition)
Build do-while statement.
ROSE_DLL_API void errorCheckingTargetAST(SgNode *node_copy, SgNode *node_original, SgFile *targetFile, bool failOnWarning)
Error checking the inserted snippet AST.
ROSE_DLL_API SgFortranDo * buildFortranDo(SgExpression *initialization, SgExpression *bound, SgExpression *increment, SgBasicBlock *)
Build a Fortran do construct.
ROSE_DLL_API SgPythonGlobalStmt * buildPythonGlobalStmt(SgInitializedNamePtrList &names)
Build a python global statement.
ROSE_DLL_API SgUnsignedLongLongIntVal * buildUnsignedLongLongIntValHex(unsigned long long v=0)
ROSE_DLL_API SgBoolValExp * buildBoolValExp_nfi(int value)
ROSE_DLL_API SgReturnStmt * buildReturnStmt_nfi(SgExpression *expression)
Build a return statement.
ROSE_DLL_API SgClassExp * buildClassExp(SgClassSymbol *sym)
Build class pointer.
ROSE_DLL_API SgTypeChar16 * buildChar16Type()
Built in simple types.
ROSE_DLL_API SgLambdaExp * buildLambdaExp(SgLambdaCaptureList *lambda_capture_list, SgClassDeclaration *lambda_closure_class, SgFunctionDeclaration *lambda_function)
DQ (9/3/2014): Adding support for C++11 Lambda expressions.
ROSE_DLL_API SgWhenStmt * buildWhenStmt(SgExpression *expression, SgBasicBlock *body)
Build a variable declaration, handle symbol table transparently.
SgAsmStmt * buildAsmStatement_nfi(std::string s)
Build an asm statement.
SgListComprehension * buildListComprehension_nfi(SgExpression *elt, SgExprListExp *generators)
ROSE_DLL_API SgClassDeclaration * buildJavaDefiningClassDeclaration(SgScopeStatement *, std::string, SgClassDeclaration::class_types kind=SgClassDeclaration::e_class)
Build a SgFile node and attach it to SgProject.
SgContinueStmt * buildContinueStmt_nfi()
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgAssignInitializer * buildAssignInitializer(SgExpression *operand_i=NULL, SgType *expression_type=NULL)
Build the rhs of a variable declaration which includes an assignment.
ROSE_DLL_API SgArrayType * getUniqueJavaArrayType(SgType *, int)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgLambdaCapture * buildLambdaCapture(SgExpression *capture_variable, SgExpression *source_closure_variable, SgExpression *closure_variable)
ROSE_DLL_API SgRangeExp * buildRangeExp(SgExpression *start)
Build a Matlab range expression like start:end or start:stride:end.
ROSE_DLL_API SgEnumDeclaration * buildEnumDeclaration(const SgName &name, SgScopeStatement *scope=NULL)
Build an enum, It is also a declaration statement in SAGE III.
ROSE_DLL_API SgModifierType * buildConstVolatileType(SgType *base_type=nullptr)
Build a const volatile type.
ROSE_DLL_API SgEnumVal * buildEnumVal(long long int value, SgEnumDeclaration *decl, SgName name)
ROSE_DLL_API SgEnumVal * buildEnumVal_nfi(long long int value, SgEnumDeclaration *decl, SgName name)
ROSE_DLL_API void setTemplateNameInTemplateInstantiations(SgFunctionDeclaration *func, const SgName &name)
DQ (2/11/2012): Added support to set the template name in function template instantiations (member an...
ROSE_DLL_API SgVariableDeclaration * buildVariableDeclaration(const SgName &name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement *scope=NULL)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgFloat128Val * buildFloat128Val(long double value=0.0)
ROSE_DLL_API SgJovialDefineDeclaration * buildJovialDefineDeclaration_nfi(const SgName &name, const std::string &params, const std::string &def_string, SgScopeStatement *scope=NULL)
Build a Jovial define directive declaration statement.
ROSE_DLL_API SgTypeFloat80 * buildFloat80Type()
Built in simple types.
SgBreakStmt * buildBreakStmt_nfi()
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgWcharVal * buildWcharVal_nfi(wchar_t value, const std::string &str)
ROSE_DLL_API SgFloatVal * buildFloatVal(float value=0.0)
ROSE_DLL_API SgFinishStmt * buildFinishStmt(SgBasicBlock *body)
MH (6/11/2014): Added finish support.
ROSE_DLL_API SgScopeStatement * topScopeStack()
intended to be a private member, don't access it directly. could be changed any time
ROSE_DLL_API SgLongIntVal * buildLongIntValHex(long value=0)
ROSE_DLL_API SgModifierType * buildUpcRelaxedType(SgType *base_type=nullptr)
Build a UPC relaxed type.
SgScopeStatement * getGlobalScopeFromScopeStack()
Support to retrive the SgGlobal from the internal scope stack (error if not present in a non-empty li...
ROSE_DLL_API SgChooseExpression * buildChooseExpression()
SgClassDefinition * buildClassDefinition_nfi(SgClassDeclaration *d=NULL, bool buildTemplateInstantiation=false)
Build a class definition scope statement.
ROSE_DLL_API SgClassNameRefExp * buildClassNameRefExp(SgClassSymbol *sym)
ROSE_DLL_API SgWithStatement * buildWithStatement(SgExpression *expr, SgStatement *body)
Build a with statement.
SgTemplateClassDefinition * buildTemplateClassDefinition(SgTemplateClassDeclaration *d=NULL)
Build a template class definition statement.
ROSE_DLL_API SgNullExpression * buildNullExpression()
Build a null expression, set file info as the default one.
ROSE_DLL_API SgNaryBooleanOp * buildNaryBooleanOp_nfi(SgExpression *lhs)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgModifierType * buildAliasedType(SgType *base_type)
Build an aliased type for Ada.
ROSE_DLL_API SgTupleExp * buildTupleExp(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 SgTupleExp.
ROSE_DLL_API SgTypeImaginary * buildImaginaryType(SgType *base_type=nullptr)
Build an imaginary type.
ROSE_DLL_API SgStringVal * buildStringVal_nfi(std::string value)
ROSE_DLL_API SgStatementExpression * buildStatementExpression_nfi(SgStatement *exp)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API void setTemplateArgumentParents(SgDeclarationStatement *decl)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgStmtDeclarationStatement * buildStmtDeclarationStatement(SgStatement *stmt)
Build a StmtDeclarationStmt.
ROSE_DLL_API SgAwaitExpression * buildAwaitExpression_nfi()
ROSE_DLL_API SgTemplateParameterVal * buildTemplateParameterVal_nfi(int template_parameter_position, const std::string &str)
ROSE_DLL_API SgJavaQualifiedType * getUniqueJavaQualifiedType(SgClassDeclaration *, SgNamedType *, SgNamedType *)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgFinishExp * buildFinishExp(SgExpression *expression, SgBasicBlock *body)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgYieldExpression * buildYieldExpression(SgExpression *value)
Build a yield statement.
ROSE_DLL_API SgJavaInstanceOfOp * buildJavaInstanceOfOp(SgExpression *exp=NULL, SgType *type=NULL)
This is part of Java specific operator support.
ROSE_DLL_API SgLambdaCaptureList * buildLambdaCaptureList_nfi()
ROSE_DLL_API SgShortVal * buildShortVal(short value=0)
ROSE_DLL_API SgAsmStmt * buildAsmStatement(std::string s)
Build a NULL statement.
ROSE_DLL_API SgModifierType * buildConstType(SgType *base_type=nullptr)
Build a const type.
ROSE_DLL_API void setTemplateArgumentsInDeclaration(SgDeclarationStatement *decl, SgTemplateArgumentPtrList *templateArgumentsList_input)
DQ (9/16/2012): Added function to support setting the template arguments and setting their parents (a...
ROSE_DLL_API SgJavaNormalAnnotation * buildJavaNormalAnnotation(SgType *)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgDoubleVal * buildDoubleVal_nfi(double value, const std::string &str)
ROSE_DLL_API SgUnsignedShortVal * buildUnsignedShortVal(unsigned short v=0)
Build an unsigned short integer.
ROSE_DLL_API SgInitializedName * buildInitializedName_nfi(const SgName &name, SgType *type, SgInitializer *init, SgVariableDeclaration *declptr=NULL)
Initialized names are tricky, their scope vary depending on context, so scope and symbol information ...
ROSE_DLL_API PreprocessingInfo * buildCpreprocessorDefineDeclaration(SgLocatedNode *target, const std::string &content, PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before)
Build and attach #define XX directives, pass "#define xxx xxx" as content.
ROSE_DLL_API SgTypeDouble * buildDoubleType()
Built in simple types.
ROSE_DLL_API SgReferenceType * buildReferenceType(SgType *base_type=nullptr)
Build a reference type.
SgExecStatement * buildExecStatement_nfi(SgExpression *executable, SgExpression *globals=NULL, SgExpression *locals=NULL)
Build an exec stmt.
ROSE_DLL_API SgTypeLongDouble * buildLongDoubleType()
Built in simple types.
ROSE_DLL_API SgTypeLong * buildLongType()
Built in simple types.
ROSE_DLL_API SgExprStatement * buildExprStatement(SgExpression *exp=NULL)
Build a SgExprStatement, set File_Info automatically.
ROSE_DLL_API SgLongIntVal * buildLongIntVal_nfi(long value, const std::string &str)
ROSE_DLL_API SgFunctionParameterRefExp * buildFunctionParameterRefExp(int parameter_number, int parameter_level)
ROSE_DLL_API SgTemplateTypedefDeclaration * buildTemplateTypedefDeclaration_nfi(const SgName &name, SgType *base_type, SgScopeStatement *scope=NULL, bool has_defining_base=false)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API void fixupSourcePositionFileSpecification(SgNode *subtreeRoot, const std::string &newFileName)
Change the source file associated with the source position information in the AST.
ROSE_DLL_API SgAssertStmt * buildAssertStmt(SgExpression *test)
Build a Assert statement.
ROSE_DLL_API SgAtExp * buildAtExp(SgExpression *expression, SgBasicBlock *body)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgChar32Val * buildChar32Val(unsigned int value=0)
ROSE_DLL_API SgSizeOfOp * buildSizeOfOp_nfi(SgExpression *exp)
Build sizeof() expression with an expression parameter.
ROSE_DLL_API SgIfStmt * buildIfStmt(SgStatement *conditional, SgStatement *true_body, SgStatement *false_body)
Build if statement.
ROSE_DLL_API SgAsyncStmt * buildAsyncStmt(SgBasicBlock *body)
MH (6/10/2014): Added async support.
ROSE_DLL_API SgFunctionParameterList * 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.
ROSE_DLL_API SgModifierType * buildFortranKindType(SgType *base_type, SgExpression *kindExpression)
Build a type based on the Fortran kind mechanism.
ROSE_DLL_API SgPragmaDeclaration * buildPragmaDeclaration(const std::string &name, SgScopeStatement *scope=NULL)
Build pragma declaration, handle SgPragma and defining/nondefining pointers internally.
ROSE_DLL_API SgUnsignedCharVal * buildUnsignedCharVal(unsigned char v=0)
Build an unsigned char.
SgLabelStatement * buildLabelStatement_nfi(const SgName &name, SgStatement *stmt, SgScopeStatement *scope)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgLongLongIntVal * buildLongLongIntValHex(long long value=0)
ROSE_DLL_API SgAlignOfOp * buildAlignOfOp(SgExpression *exp=NULL)
Build alignof() expression with an expression parameter.
ROSE_DLL_API SgMatlabForStatement * buildMatlabForStatement(SgExpression *loop_index, SgExpression *loop_range, SgBasicBlock *loop_body)
Build a For-loop statement for matlab.
bool inSwitchScope()
intended to be a private member, don't access it directly. could be changed any time
ROSE_DLL_API SgFloat64Val * buildFloat64Val_nfi(double v, const std::string &str)
ROSE_DLL_API SgUpcMythread * buildUpcMythread()
Build UPC MYTHREAD (integer expression)
ROSE_DLL_API SgTypeUnsignedLong * buildUnsignedLongType()
Built in simple types.
ROSE_DLL_API SgPlusPlusOp * buildPlusPlusOp_nfi(SgExpression *op)
ROSE_DLL_API SgSignedCharVal * buildSignedCharValHex(signed char v=0)
ROSE_DLL_API SgTypeShort * buildShortType()
Built in simple types.
ROSE_DLL_API SgNonrealRefExp * buildNonrealRefExp_nfi(SgNonrealSymbol *sym)
Build a reference to the non-real declaration of a member of a non-real class.
SgFunctionCallExp * buildFunctionCallExp_nfi(SgExpression *f, SgExprListExp *parameters=NULL)
ROSE_DLL_API SgTypeVoid * buildVoidType()
Built in simple types.
ROSE_DLL_API void fixupSharingSourcePosition(SgNode *subtreeRoot, int new_file_id)
Sharing IR nodes requires that the file id be added to the fileIDsToUnparse held in the Sg_File_Info ...
ROSE_DLL_API SgAssignInitializer * buildAssignInitializer_nfi(SgExpression *operand_i=NULL, SgType *expression_type=NULL)
ROSE_DLL_API SgTypeBool * buildBoolType()
Built in simple types.
ROSE_DLL_API SgMicrosoftAttributeDeclaration * buildMicrosoftAttributeDeclaration(const SgName &name)
DQ (8/17/2014): Adding support for Microsoft MSVC specific attributes.
ROSE_DLL_API SgStatement * buildStatementFromString(const std::string &stmt_str, SgScopeStatement *scope)
Liao (9/18/2015): experimental support of building a statement from a string.
ROSE_DLL_API SgFile * buildFile(const std::string &inputFileName, const std::string &outputFileName, SgProject *project=NULL, bool clear_globalScopeAcrossFiles=false)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgMemberFunctionDeclaration * buildDefiningMemberFunctionDeclaration(const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope, SgExprListExp *decoratorList, bool buildTemplateInstantiation, unsigned int functionConstVolatileFlags, SgMemberFunctionDeclaration *first_nondefinng_declaration, SgTemplateArgumentPtrList *templateArgumentsList)
Build a defining ( non-prototype) member function declaration.
ROSE_DLL_API SgVarRefExp * buildVarRefExp_nfi(SgVariableSymbol *varSymbol)
ROSE_DLL_API SgPointerType * buildPointerType(SgType *base_type=nullptr)
Build a pointer type.
ROSE_DLL_API SgLongDoubleVal * buildLongDoubleVal_nfi(long double value, const std::string &str)
ROSE_DLL_API SgMagicColonExp * buildMagicColonExp()
Build a Matlab colon expression :
ROSE_DLL_API SgTypedefDeclaration * buildTypedefDeclaration(const std::string &name, SgType *base_type, SgScopeStatement *scope=NULL, bool has_defining_base=false)
Build a typedef declaration, such as: typedef int myint; typedef struct A {..} s_A;.
ROSE_DLL_API SgTemplateParameterVal * buildTemplateParameterVal(int template_parameter_position=-1)
Build an template parameter value expression.
ROSE_DLL_API SgFortranContinueStmt * buildFortranContinueStmt()
Build a Fortran continue statement.
ROSE_DLL_API SgFloat128Val * buildFloat128Val_nfi(long double value, const std::string &str)
ROSE_DLL_API SgBoolValExp * buildBoolValExp(int value=0)
Build a bool value expression, the name convention of SgBoolValExp is little different from others fo...
ROSE_DLL_API SgSwitchStatement * buildSwitchStatement(SgStatement *item_selector=NULL, SgStatement *body=NULL)
Build a switch statement.
ROSE_DLL_API SgType * 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,...
T * buildUnaryExpression(SgExpression *operand)
Template function to build a unary expression of type T. Instantiated functions include:buildAddressO...
ROSE_DLL_API SgTypeChar32 * buildChar32Type()
Built in simple types.
ROSE_DLL_API SgConstructorInitializer * buildConstructorInitializer_nfi(SgMemberFunctionDeclaration *declaration, SgExprListExp *args, SgType *expression_type, bool need_name, bool need_qualifier, bool need_parenthesis_after_name, bool associated_class_unknown)
ROSE_DLL_API SgMatrixExp * buildMatrixExp(SgExprListExp *firstRow)
Build a Matlab Matrix.
ROSE_DLL_API SgPassStatement * buildPassStatement()
Build a pass statement.
ROSE_DLL_API SgTypeComplex * buildComplexType(SgType *base_type=nullptr)
Build a complex type.
ROSE_DLL_API SgAttributeSpecificationStatement * buildAttributeSpecificationStatement(SgAttributeSpecificationStatement::attribute_spec_enum kind)
Build Fortran attribute specification statement.
ROSE_DLL_API SgProcedureHeaderStatement * buildProcedureHeaderStatement(const SgName &name, SgType *return_type, SgFunctionParameterList *parameter_list, SgProcedureHeaderStatement::subprogram_kind_enum, SgScopeStatement *scope=NULL)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgDeclarationStatement * findAssociatedDeclarationInTargetAST(SgDeclarationStatement *snippet_declaration, SgScopeStatement *targetScope)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgTypeTuple * buildTupleType(SgType *t1=NULL, SgType *t2=NULL, SgType *t3=NULL, SgType *t4=NULL, SgType *t5=NULL, SgType *t6=NULL, SgType *t7=NULL, SgType *t8=NULL, SgType *t9=NULL, SgType *t10=NULL)
Build a tuple of types. Useful for a function returning multiple variables of different types.
ROSE_DLL_API SgNaryComparisonOp * buildNaryComparisonOp(SgExpression *lhs)
driscoll6 (7/20/11) : Support n-ary operators for python
ROSE_DLL_API SgNonrealType * buildNonrealType(const SgName &name, SgDeclarationScope *scope)
Build a non real type used for template parameter. Internally a SgNorealDecl is also built.
ROSE_DLL_API SgDeclarationScope * buildDeclarationScope()
Build a scope statement. Used to build SgNonrealDecl and SgNonrealType.
ROSE_DLL_API SgName appendTemplateArgumentsToName(const SgName &name, const SgTemplateArgumentPtrList &templateArgumentsList)
DQ (7/27/2012): changed semantics from removing the template arguments in names to adding the templat...
ROSE_DLL_API SgStaticAssertionDeclaration * buildStaticAssertionDeclaration(SgExpression *condition, const SgName &string_literal)
DQ (7/25/2014): Adding support for C11 static assertions.
ROSE_DLL_API SgNullExpression * buildNullExpression_nfi()
No file info version of buildNullExpression(). File info is to be set later on.
ROSE_DLL_API SgFunctionParameterTypeList * buildFunctionParameterTypeList(SgFunctionParameterList *paralist)
Build SgFunctionParameterTypeList from SgFunctionParameterList.
ROSE_DLL_API SgFunctionCallExp * buildMemberFunctionCall(std::string className, SgExpression *objectExpression, std::string functionName, SgExprListExp *params, SgScopeStatement *scope)
Build member function calls.
SgDefaultOptionStmt * buildDefaultOptionStmt_nfi(SgStatement *body)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgFloat64Val * buildFloat64Val(double v=0)
Build a float64.
ROSE_DLL_API SgActualArgumentExpression * buildActualArgumentExpression(SgName arg_name, SgExpression *arg)
Build an Actual Argument Expression.
ROSE_DLL_API PreprocessingInfo * buildHeader(const std::string &header_filename, PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before, bool isSystemHeader=false)
Build a dangling #include "x.h" header, insertHeader() is needed to actually insert it.
SgPassStatement * buildPassStatement_nfi()
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgStringVal * buildStringVal(std::string value="")
ROSE_DLL_API SgTypeSignedLong * buildSignedLongType()
Built in simple types.
ROSE_DLL_API SgClassDeclaration * buildDefiningClassDeclaration(SgName name, SgScopeStatement *scope)
Build a variable declaration, handle symbol table transparently.
SgGotoStatement * buildGotoStatement_nfi(SgLabelStatement *label)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgTypeChar * buildCharType()
Built in simple types.
ROSE_DLL_API SgTemplateParameterPtrList * getTemplateParameterList(SgDeclarationStatement *decl)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgClassExp * buildClassExp_nfi(SgClassSymbol *sym)
ROSE_DLL_API SgBreakStmt * buildBreakStmt()
Build a break statement.
ROSE_DLL_API SgForInitStatement * buildForInitStatement_nfi(SgStatementPtrList &statements)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API void setTemplateParameterParents(SgDeclarationStatement *decl)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API void pushScopeStack(SgScopeStatement *stmt)
Public interfaces of the scope stack, should be stable.
ROSE_DLL_API SgCommonBlockObject * buildCommonBlockObject(std::string name="", SgExprListExp *exp_list=NULL)
Build a Fortran common block, possibly with a name.
ROSE_DLL_API SgTypeSignedShort * buildSignedShortType()
Built in simple types.
ROSE_DLL_API SgUsingDirectiveStatement * buildUsingDirectiveStatement(SgNamespaceDeclarationStatement *ns_decl)
Build a using directive statement.
SgDictionaryExp * buildDictionaryExp_nfi(std::vector< SgKeyDatumPair * > pairs)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgCastExp * 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.
SgTemplateMemberFunctionRefExp * buildTemplateMemberFunctionRefExp_nfi(SgTemplateMemberFunctionSymbol *sym, bool virtual_call, bool need_qualifier)
DQ (12/29/2011): Adding template declaration support to the AST.
ROSE_DLL_API SgRvalueReferenceType * buildRvalueReferenceType(SgType *base_type)
Build a rvalue reference type.
ROSE_DLL_API SgClassDeclaration * buildNondefiningClassDeclaration_nfi(const SgName &name, SgClassDeclaration::class_types kind, SgScopeStatement *scope, bool buildTemplateInstantiation, SgTemplateArgumentPtrList *templateArgumentsList)
Build a structure first nondefining declaration, without file info.
ROSE_DLL_API SgStmtDeclarationStatement * buildStmtDeclarationStatement_nfi(SgStatement *stmt)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgForInitStatement * buildForInitStatement()
Build a for init statement.
SgDoWhileStmt * buildDoWhileStmt_nfi(SgStatement *body, SgStatement *condition)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API void popScopeStack()
intended to be a private member, don't access it directly. could be changed any time
ROSE_DLL_API SgSignedCharVal * buildSignedCharVal(signed char v=0)
Build a signed char.
ROSE_DLL_API SgAlignOfOp * buildAlignOfOp_nfi(SgExpression *exp)
Build alignof() expression with an expression parameter.
ROSE_DLL_API SgVarArgOp * buildVarArgOp_nfi(SgExpression *operand_i, SgType *expression_type)
Build vararg op expression.
T * buildUnaryExpression_nfi(SgExpression *operand)
Template function to build a unary expression of type T with no file info. Instantiated functions inc...
ROSE_DLL_API void testTemplateArgumentParents(SgDeclarationStatement *decl)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgTypeNullptr * buildNullptrType()
Built in simple types.
ROSE_DLL_API SgModifierType * buildUpcStrictType(SgType *base_type=nullptr)
Build a UPC strict type.
ROSE_DLL_API SgExprStatement * buildAssignStatement_ast_translate(SgExpression *lhs, SgExpression *rhs)
This version does not recursively reset the file info as a transformation.
ROSE_DLL_API SgTypeFloat * buildFloatType()
Built in simple types.
ROSE_DLL_API SgDeleteExp * buildDeleteExp(SgExpression *variable, short is_array, short need_global_specifier, SgFunctionDeclaration *deleteOperatorDeclaration)
ROSE_DLL_API SgTypeOfType * buildTypeOfType(SgExpression *base_expression, SgType *base_type)
Build a GNU typeof operator.
ROSE_DLL_API SgVoidVal * buildVoidVal()
DQ (2/14/2019): Adding support for C++14 void value expressions.
SgWhileStmt * buildWhileStmt_nfi(SgStatement *condition, SgStatement *body, SgStatement *else_body=NULL)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API bool emptyScopeStack()
intended to be a private member, don't access it directly. could be changed any time
SgClassNameRefExp * buildClassNameRefExp_nfi(SgClassSymbol *sym)
ROSE_DLL_API SgFloat80Val * buildFloat80Val_nfi(long double value, const std::string &str)
ROSE_DLL_API SgSetComprehension * buildSetComprehension(SgExpression *elt, SgExprListExp *generators)
ROSE_DLL_API SgTypeFloat64 * buildFloat64Type()
Built in simple types.
ROSE_DLL_API SgColonShapeExp * buildColonShapeExp_nfi()
No file info version of buildColonShapeExp(). File info is to be set later on.
ROSE_DLL_API SgVoidVal * buildVoidVal_nfi()
ROSE_DLL_API SgModifierType * buildVolatileType(SgType *base_type=nullptr)
Build a volatile type.
ROSE_DLL_API SgFunctionRefExp * 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 ...
ROSE_DLL_API SgTemplateVariableInstantiation * buildTemplateVariableInstantiation(const SgName &name, SgType *type, SgInitializer *varInit, SgScopeStatement *scope, SgTemplateVariableDeclaration *tpl_decl, SgTemplateArgumentPtrList &tpl_args)
Build template variable declarations.
ROSE_DLL_API SgTypeWchar * buildWcharType()
Built in simple types.
ROSE_DLL_API SgBasicBlock * 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.
ROSE_DLL_API SgAggregateInitializer * buildAggregateInitializer(SgExprListExp *initializers=NULL, SgType *type=NULL)
Build an aggregate initializer.
ROSE_DLL_API SgNoexceptOp * buildNoexceptOp_nfi(SgExpression *exp)
Build noexcept operator expression with an expression parameter.
ROSE_DLL_API SgTypeUnknown * buildUnknownType()
Built in simple types.
ROSE_DLL_API SgFoldExpression * buildFoldExpression(SgExpression *operands, std::string operator_token_string, bool is_left_associative)
ROSE_DLL_API SgVariableDeclaration * buildVariableDeclaration_nfi(const SgName &name, SgType *type, SgInitializer *varInit, SgScopeStatement *scope, bool builtFromUseOnly=false, SgStorageModifier::storage_modifier_enum sm=SgStorageModifier::e_default)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgTypeIdOp * buildTypeIdOp(SgExpression *operand_expr, SgType *operand_type)
DQ (1/25/2013): Added support for typeId operators.
ROSE_DLL_API SgExprStatement * buildAssignStatement(SgExpression *lhs, SgExpression *rhs)
Build an assignment statement from lefthand operand and right hand operand.
ROSE_DLL_API SgTypeUnsigned128bitInteger * buildUnsigned128bitIntegerType()
Built in simple types.
ROSE_DLL_API SgUnsignedIntVal * buildUnsignedIntVal(unsigned int v=0)
Build an unsigned integer.
SgFunctionRefExp * buildFunctionRefExp_nfi(SgFunctionSymbol *sym)
ROSE_DLL_API SgCharVal * buildCharVal(char value=0)
SgActualArgumentExpression * buildActualArgumentExpression_nfi(SgName arg_name, SgExpression *arg)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgSizeOfOp * buildSizeOfOp(SgExpression *exp=NULL)
Build sizeof() expression with an expression parameter.
ROSE_DLL_API SgMemberFunctionDeclaration * buildNondefiningMemberFunctionDeclaration(const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope, SgExprListExp *decoratorList, unsigned int functionConstVolatileFlags, bool buildTemplateInstantiation, SgTemplateArgumentPtrList *templateArgumentsList)
Build a prototype member function declaration.
ROSE_DLL_API SgJavaWildcardType * getUniqueJavaWildcardSuper(SgType *)
Build a SgFile node and attach it to SgProject.
SgTypeTraitBuiltinOperator * buildTypeTraitBuiltinOperator(SgName functionName, SgNodePtrList parameters)
SgCompoundLiteralExp * buildCompoundLiteralExp(SgVariableSymbol *varSymbol)
Build function for compound literals (uses a SgVariableSymbol and is similar to buildVarRefExp()).
ROSE_DLL_API SgTemplateVariableInstantiation * buildTemplateVariableInstantiation_nfi(const SgName &name, SgType *type, SgInitializer *varInit, SgScopeStatement *scope, SgTemplateVariableDeclaration *tpl_decl, SgTemplateArgumentPtrList &tpl_args)
Build a variable declaration, handle symbol table transparently.
SgExprListExp * buildExprListExp_nfi()
ROSE_DLL_API SgType * getTargetFileTypeSupport(SgType *snippet_type, SgScopeStatement *targetScope)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgVariantExpression * buildVariantExpression()
ROSE_DLL_API SgNonrealBaseClass * buildNonrealBaseClass(SgNonrealDecl *classDeclaration, SgClassDefinition *classDefinition, bool isVirtual, bool isDirect)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgTypeSignedInt * buildSignedIntType()
Built in simple types.
ROSE_DLL_API SgBFloat16Val * buildBFloat16Val(float v=0)
Build a bfloat16.
ROSE_DLL_API void fixupCopyOfNodeFromSeparateFileInNewTargetAst(SgStatement *insertionPoint, bool insertionPointIsScope, SgNode *node_copy, SgNode *node_original)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgWcharVal * buildWcharVal(wchar_t value=0)
ROSE_DLL_API SgUnsignedShortVal * buildUnsignedShortValHex(unsigned short v=0)
ROSE_DLL_API SgTemplateMemberFunctionDeclaration * buildDefiningTemplateMemberFunctionDeclaration(const SgName &name, SgType *return_type, SgFunctionParameterList *parlist, SgScopeStatement *scope, SgExprListExp *decoratorList, unsigned int functionConstVolatileFlags, SgTemplateMemberFunctionDeclaration *first_nondefing_declaration)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgVarRefExp * buildOpaqueVarRefExp(const std::string &varName, SgScopeStatement *scope=NULL)
Build a variable reference expression at scope to an opaque variable which has unknown information ex...
ROSE_DLL_API SgTypeUnsignedChar * buildUnsignedCharType()
Built in simple types.
ROSE_DLL_API SgJavaMarkerAnnotation * buildJavaMarkerAnnotation(SgType *)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgUnsignedIntVal * buildUnsignedIntVal_nfi(unsigned int v, const std::string &str)
ROSE_DLL_API SgNaryBooleanOp * buildNaryBooleanOp(SgExpression *lhs)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgModifierType * buildUpcBlockNumberType(SgType *base_type, long block_factor)
Build a UPC shared[n] type.
ROSE_DLL_API SgStatementExpression * buildStatementExpression(SgStatement *exp)
Build a GNU statement expression.
ROSE_DLL_API SgTypeSignedChar * buildSignedCharType()
Built in simple types.
ROSE_DLL_API SgUpcWaitStatement * buildUpcWaitStatement_nfi(SgExpression *exp)
Build a UPC wait statement.
ROSE_DLL_API SgDoubleVal * buildDoubleVal(double value=0.0)
Build a double value expression.
ROSE_DLL_API SgMemberFunctionDeclaration * buildDefaultConstructor(SgClassType *classType)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgUnsignedLongLongIntVal * buildUnsignedLongLongIntVal_nfi(unsigned long long v, const std::string &str)
ROSE_DLL_API SgAutoType * buildAutoType()
Built in simple types.
ROSE_DLL_API SgMemberFunctionRefExp * buildMemberFunctionRefExp(SgMemberFunctionSymbol *sym, bool virtual_call, bool need_qualifier)
ROSE_DLL_API SgFloat16Val * buildFloat16Val(float v=0)
Build a float16.
ROSE_DLL_API SgHereExp * buildHereExpression()
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgPlusPlusOp * buildPlusPlusOp(SgExpression *op=NULL)
ROSE_DLL_API SgComplexVal * buildComplexVal(SgValueExp *real_value, SgValueExp *imaginary_value)
ROSE_DLL_API SgNamespaceDeclarationStatement * buildNamespaceDeclaration_nfi(const SgName &name, bool unnamednamespace, SgScopeStatement *scope)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgIntVal * buildIntVal(int value=0)
Build an integer value expression.
SgYieldExpression * buildYieldExpression_nfi(SgExpression *value)
Build a variable declaration, handle symbol table transparently.
ROSE_DLL_API SgChar32Val * buildChar32Val_nfi(unsigned int value, const std::string &str)
ROSE_DLL_API DeclClass * buildClassDeclarationStatement_nfi(const SgName &name, SgClassDeclaration::class_types kind, SgScopeStatement *scope=NULL, SgClassDeclaration *nonDefiningDecl=NULL)
Build a generic class declaration statement (SgClassDeclaration or subclass) with a class declaration...
SgTemplateFunctionRefExp * buildTemplateFunctionRefExp_nfi(SgTemplateFunctionSymbol *sym)
DQ (12/15/2011): Adding template declaration support to the AST.
ROSE_DLL_API SgNullStatement * buildNullStatement()
Build a NULL statement.
ROSE_DLL_API SgUpcNotifyStatement * buildUpcNotifyStatement_nfi(SgExpression *exp)
Build a UPC notify statement.
ROSE_DLL_API SgConstVolatileModifier * buildConstVolatileModifier(SgConstVolatileModifier::cv_modifier_enum mtype=SgConstVolatileModifier::e_unknown)
Build a const/volatile type qualifier.
ROSE_DLL_API SgJavaForEachStatement * buildJavaForEachStatement(SgVariableDeclaration *=NULL, SgExpression *=NULL, SgStatement *=NULL)
Build a Java Foreach statement.
ROSE_DLL_API SgBracedInitializer * buildBracedInitializer(SgExprListExp *initializers=NULL, SgType *expression_type=NULL)
Build an braced initializer.
ROSE_DLL_API SgFunctionType * buildFunctionType(SgType *return_type, SgFunctionParameterTypeList *typeList=nullptr)
Build function type from return type and parameter type list.
ROSE_DLL_API SgScopeStatement * buildScopeStatement(SgClassDefinition *=NULL)
Build a SgFile node and attach it to SgProject.
ROSE_DLL_API SgDictionaryExp * buildDictionaryExp(std::vector< SgKeyDatumPair * > pairs)
Build a list of key-datum pairs.
ROSE_DLL_API SgLambdaCaptureList * buildLambdaCaptureList()
ROSE_DLL_API SgJovialForThenStatement * buildJovialForThenStatement_nfi()
Build a Jovial loop statement.
ROSE_DLL_API SgInitializedName * buildJavaFormalParameter(SgType *, const SgName &, bool is_var_args=false, bool is_final=false)
Build a SgFile node and attach it to SgProject.
Functions that are useful when operating on the AST.
Definition sageBuilder.h:25
ROSE_DLL_API void setOneSourcePositionForTransformation(SgNode *root)
Set current node's source position as transformation generated.
ROSE_DLL_API void setSourcePosition(SgNode *node)
Set the source code positon for the current (input) node.