sagexx_ug (1158317), страница 4
Текст из файла (страница 4)
The low-level node (VAR_REF or ARRAY_R// replaced by a ASSIGN_OP low-level node.};SgVarDeclStmt is used in the following places in the example programs: see [Dump Info - doVarDecl], page 178Member Functions:SgVarDeclStmt(SgExpression &varRefValList, SgExpression &attributeList, SgType &type)SgVarDeclStmt(SgExpression &varRefValList, SgType &type)SgType * type()int numberOfAttributes()SgExpression & attribute(int i)int numberOfSymbols()SgSymbol * symbol(int i)void deleteSymbol(int i)void deleteTheSymbol(SgSymbol &symbol)Chapter 3: StatementsSgExpression * initialValue(int i)void setInitialValue(int i, SgExpression &initVal)SgVarListDeclStmtRepresents lists of variable declarations, for all languages.For base class, see [SgDeclarationStatement], page 31.class SgVarListDeclStmt: public SgDeclarationStatement {// Declaration Statement// variant == INTENT_STMT, OPTIONAL_STMT, SAVE_STMT, PUBLIC_STMT,// PRIVATE_STMT, EXTERNAL_STAT, INTRINSIC_STAT, DIM_STAT,// ALLOCATABLE_STAT, POINTER_STAT, TARGET_STAT, MODULE_PROC_STMTpublic:SgVarListDeclStmt(int variant, SgExpression &symbolRefList);SgVarListDeclStmt(int variant, SgSymbol &symbolList,SgStatement &scope);intnumberOfSymbols();SgSymbol * symbol(int i);voidappendSymbol(SgSymbol &symbol);voiddeleteSymbol(int i);voiddeleteTheSymbol(SgSymbol &symbol);};SgVarListDeclStmt is used in the following places in the example programs: see [Dump Info - doVarDecl], page 178Member Functions:SgVarListDeclStmt(int variant, SgExpression &symbolRefList)SgVarListDeclStmt(int variant, SgSymbol &symbolList, SgStatement &scope)int numberOfSymbols()SgSymbol * symbol(int i)void appendSymbol(SgSymbol &symbol)34Chapter 3: Statements35void deleteSymbol(int i)void deleteTheSymbol(SgSymbol &symbol)SgNestedVarListDeclStmtRepresents Fortran lists of lists of variable declarations.For base class, see [SgDeclarationStatement], page 31.class SgNestedVarListDeclStmt: public SgDeclarationStatement {// Declaration statement// variant == NAMELIST_STAT, EQUI_STAT, COMM_STAT// These statements have the format of a list of variable lists.
For example,// EQUIVALENCE (A, C, D), (B, G, F), ....public:SgNestedVarListDeclStmt(int variant,SgExpression &listOfVarList);// varList must be of low-level variant appropriate to variant. For example,// if the variant is COMM_STAT, listOfVarList must be of variant COMM_LIST.SgExpression * lists();intnumberOfLists();SgExpression * list(int i);#if 0SgExpression * leadingVar(int i);#endifvoidaddList(SgExpression &list);voidaddVarToList(SgExpression &varRef);voiddeleteList(int i);voiddeleteTheList(SgExpression &list);voiddeleteVarInList(int i, SgExpression &varRef);voiddeleteVarInTheList(SgExpression &list, SgExpression &varRef);};SgNestedVarListDeclStmt is used in the following places in the example programs: see [Dump Info - doVarDecl], page 178Member Functions:SgNestedVarListDeclStmt(int variant, SgExpression &listOfVarList)Chapter 3: Statements36SgExpression * lists()int numberOfLists()SgExpression * list(int i)SgExpression * leadingVar(int i)void addList(SgExpression &list)void addVarToList(SgExpression &varRef)void deleteList(int i)void deleteTheList(SgExpression &list)void deleteVarInList(int i, SgExpression &varRef)void deleteVarInTheList(SgExpression &list, SgExpression &varRef)SgParameterStmtRepresents Fortran constants.For base class, see [SgDeclarationStatement], page 31.class SgParameterStmt: public SgDeclarationStatement {// Fortran constants declaration statement// variant = PARAM_DECLpublic:SgParameterStmt(SgExpression &constants, SgExpression &values);SgParameterStmt(SgExpression &constantsWithValues);intnumberOfConstants();SgSymbol * constant(int i);voidvoidvoid};// the number of constants declared// the i-th variableaddConstant(SgSymbol &constant, SgExpression &value);deleteConstant(int i);deleteTheConstant(SgSymbol &constant);SgParameterStmt is used in the following places in the example programs:Chapter 3: Statements37see [Dump Info - doVarDecl], page 178Member Functions:SgParameterStmt(SgExpression &constants, SgExpression &values)SgParameterStmt(SgExpression &constantsWithValues)int numberOfConstants()SgSymbol * constant(int i)void addConstant(SgSymbol &constant, SgExpression &value)void deleteConstant(int i)void deleteTheConstant(SgSymbol &constant)SgImplicitStmtRepresents Fortran implicit type declarations.For base class, see [SgDeclarationStatement], page 31.class SgImplicitStmt: public SgDeclarationStatement {// Fortran implicit type declaration statement// variant = IMPL_DECLpublic:SgImplicitStmt(SgExpression &implicitLists);intnumberOfImplicitTypes(); // the number of implicit types declared;SgType *implicitType(int i); // the i-th implicit typeSgExpression * implicitRangeList(int i) ;voidappendImplicitNode(SgExpression &impNode);#if 0voidaddImplicitType(SgType Type, char alphabet[]);intdeleteImplicitItem(int i);intdeleteTheImplicitItem(SgExpression &implicitItem);#endif};SgImplicitStmt is used in the following places in the example programs:Chapter 3: Statementssee [Dump Info - doVarDecl], page 178Member Functions:SgImplicitStmt(SgExpression &implicitLists)int numberOfImplicitTypes()SgType * implicitType(int i)SgExpression * implicitRangeList(int i)void appendImplicitNode(SgExpression &impNode)void addImplicitType(SgType Type, char alphabet[])int deleteImplicitItem(int i)int deleteTheImplicitItem(SgExpression &implicitItem)SgStmtFunctionStmtRepresents Fortran statement function declarations.For base class, see [SgDeclarationStatement], page 31.class SgStmtFunctionStmt: public SgDeclarationStatement {#if 0// Fortran statement function declaration// variant == STMTFN_DECLpublic:SgStmtFunctionStmt(SgSymbol &name, SgExpression &args,SgStatement Body);SgSymbol * name();voidsetName(SgSymbol &name);SgType *type();intnumberOfParameters();// the number of parametersSgSymbol * parameter(int i);// the i-th parameter};Member Functions:SgStmtFunctionStmt(SgSymbol &name, SgExpression &args, SgStatement Body)38Chapter 3: StatementsSgSymbol * name()void setName(SgSymbol &name)SgType * type()int numberOfParameters()SgSymbol * parameter(int i)SgStructureDeclStmtRepresents Fortran 90 structure declarations.For base class, see [SgDeclarationStatement], page 31.class SgStructureDeclStmt: public SgDeclarationStatement {// Fortran 90 structure declaration statement// variant == STRUCT_DECLpublic:SgStructureDeclStmt(SgSymbol &name, SgExpression &attributes,SgStatement &body);#if 0int isPrivate();int isPublic();int isSequence();#endif};SgStructureDeclStmt is used in the following places in the example programs: see [Dump Info - doVarDecl], page 178Member Functions:SgStructureDeclStmt(SgSymbol &name, SgExpression &attributes, SgStatement &body)int isPrivate()int isPublic()int isSequence()39Chapter 3: StatementsSgUseStmtRepresents Fortran 90 module usage statements.For base class, see [SgDeclarationStatement], page 31.class SgUseStmt: public SgDeclarationStatement {#if 0// Fortran 90 module usuage statement// variant = USE_STMTpublic:SgUseStmt(SgSymbol &moduleName, SgExpression &renameList,SgStatement &scope);// renameList must be a list of low-level nodes of variant RENAME_NODEintisOnly();SgSymbol *moduleName();voidsetModuleName(SgSymbol &moduleName);intnumberOfRenames();SgExpression * renameNode(int i);voidaddRename(SgSymbol &localName, SgSymbol &useName);voidaddRenameNode(SgExpression &renameNode);voiddeleteRenameNode(int i);voiddeleteTheRenameNode(SgExpression &renameNode);};Member Functions:SgUseStmt(SgSymbol &moduleName, SgExpression &renameList, SgStatement &scope)int isOnly()SgSymbol * moduleName()void setModuleName(SgSymbol &moduleName)int numberOfRenames()SgExpression * renameNode(int i)void addRename(SgSymbol &localName, SgSymbol &useName)void addRenameNode(SgExpression &renameNode)void deleteRenameNode(int i)40Chapter 3: Statements41void deleteTheRenameNode(SgExpression &renameNode)SgMiscellStmtRepresents Fortran 90 contains statements, private statements, sequence statements.For base class, see [SgDeclarationStatement], page 31.class SgMiscellStmt: public SgDeclarationStatement {#if 0// Fortran 90 simple miscellaneous statements// variant == CONTAINS_STMT, PRIVATE_STMT, SEQUENCE_STMTpublic:SgMiscellStmt(int variant);};Member Functions:SgMiscellStmt(int variant)3.4 Control StatementsSgForStmtRepresents C for.Represents Fortran do.This class has a set of high level functions for semantic analysis and transformations.
Thisincludes the analysis of implicit induction variables dened in the loop body as well as informationabout the interactions with other loops that may in the same loop nest. In addition there are veryhigh level transformation such as normalization, interchange, unrolling, fusion. (In the currentversion of the system many of these functions are still un-implemented because they depend ondata dependence information.)For base class, see Section 3.1 [SgStatement], page 11.Chapter 3: Statements42class SgForStmt: public SgStatement {// for Fortran Do and C for// variant = FOR_NODEpublic:SgForStmt(SgSymbol &do_var, SgExpression &start,SgExpression &end, SgExpression &step,SgStatement &body);SgForStmt(SgSymbol *do_var, SgExpression *start,SgExpression *end, SgExpression *step,SgStatement *body);SgForStmt(SgSymbol &do_var, SgExpression &start,SgExpression &end, SgStatement &body);SgForStmt(SgExpression &start, SgExpression &end,SgExpression &step, SgStatement &body);SgSymbolvoiddoName();// the name of the loop (for F90.)setDoName(SgSymbol &doName);// sets the name of the loop(for F90)SgExpression * start();voidsetStart(SgExpression &lbound);SgExpression * end();voidsetEnd(SgExpression &ubound);SgExpression * step();voidsetStep(SgExpression &step);SgLabel *endOfLoop();//SgExpression & bounds();// bounds are returned as a triplet lb:ub;//voidsetBounds(SgTripletOp &bounds); // bounds are passed as a triplet lb:u// body is returned with control end statement//still attached.SgStatement * body();// s is assumed to terminate with a//control end statement.voidset_body(SgStatement &s);#if 0intreplaceBody(SgStatement &s); // new body = s and lex successors.intSgSymbol *SgExpression *#endifintSgStatement *SgStatement *SgStatement *numberOfInductVars();// 1 if an induction variable can be founinductionVar(int i);// i-th induction variableindVarRange(int i); // range of i-th ind.