ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OmpSupport::OmpAttribute Class Reference

#include <OmpAttribute.h>

Collaboration diagram for OmpSupport::OmpAttribute:

Public Member Functions

SgPragmaDeclarationgetPragmaDeclaration ()
 -----------—AST connection---------------— Get the associated SgPragmaDeclaration for C/C++, if any More...
 
PreprocessingInfogetPreprocessingInfo ()
 Get the associated PreprocessingInfo for Fortran, if any. More...
 
void setPreprocessingInfo (PreprocessingInfo *info)
 
SgNodegetNode ()
 Get the associated SgNode, can be SgPragmaDeclaration or others( for fortran nodes or during parallelization) More...
 
void setNode (SgNode *n)
 
void setOmpDirectiveType (omp_construct_enum omptype)
 ---------—directive type----— More...
 
omp_construct_enum getOmpDirectiveType ()
 
void addClause (omp_construct_enum clause_type)
 --------—clauses-------------— Add a clause into an OpenMP directive, the content of the clause is set by other interface, such as addVariable(), addExpression() , setReductionOperator() etc. More...
 
bool hasClause (omp_construct_enum clause_type)
 Check if a directive has a clause of the specified type. More...
 
std::vector< omp_construct_enumgetClauses ()
 Get all existing clauses. More...
 
SgVariableSymboladdVariable (omp_construct_enum targetConstruct, const std::string &varString, SgInitializedName *sgvar=NULL)
 -----—var list -----------— Add a variable into a variable list of an OpenMP construct ,return the symbol of the variable added, if possible More...
 
bool hasVariableList (omp_construct_enum)
 Check if a variable list is associated with a construct. More...
 
std::vector< std::pair
< std::string, SgNode * > > 
getVariableList (omp_construct_enum)
 Get the variable list associated with a construct. More...
 
std::vector< enum
omp_construct_enum
get_clauses (const std::string &variable)
 Find the relevant clauses for a variable. More...
 
void addExpression (omp_construct_enum targetConstruct, const std::string &expString, SgExpression *sgexp=NULL)
 -----—Expressions --------------------------— Add an expression to a clause More...
 
std::pair< std::string,
SgExpression * > 
getExpression (omp_construct_enum targetConstruct)
 Get expression of a clause. More...
 
void setReductionOperator (omp_construct_enum operatorx)
 -----—values for some clauses -------— More...
 
std::vector< omp_construct_enumgetReductionOperators ()
 Get reduction clauses for each operations, reduction(op:kind) More...
 
bool hasReductionOperator (omp_construct_enum operatorx)
 Check if a reduction operation exists. More...
 
void setMapVariant (omp_construct_enum operatorx)
 
std::vector< omp_construct_enumgetMapVariants ()
 Get map clauses for each variant, map(variant:var_list) More...
 
bool hasMapVariant (omp_construct_enum operatorx)
 Check if a map variant exists. More...
 
bool isMapVariant (omp_construct_enum omp_type)
 Check if the input parameter is a map variant enum type. More...
 
void setDefaultValue (omp_construct_enum valuex)
 
omp_construct_enum getDefaultValue ()
 
omp_construct_enum getScheduleKind ()
 
void setScheduleKind (omp_construct_enum kindx)
 
bool isInConstruct (const std::string &variable, enum omp_construct_enum)
 Check if a variable is inside a variable list of a clause/directive. More...
 
void setCriticalName (const std::string &name)
 Set name for named critical section. More...
 
std::string getCriticalName ()
 
bool isNamedCritical ()
 
void print ()
 Pretty print the OmpAttribute. More...
 
bool get_isUserDefined ()
 
std::string toOpenMPString ()
 Convert OmpAttribute to a legal OpenMP pragma string,. More...
 

Public Attributes

std::map< SgSymbol
*, std::vector< std::pair
< SgExpression *, SgExpression * > > > 
array_dimensions
 Dimension information for array variables, used by map clause, such as map (inout:array[0:n][0:m]) More...
 

Private Member Functions

 OmpAttribute ()
 Default constructors. More...
 
 OmpAttribute (omp_construct_enum omptype, SgNode *mynode)
 Constructor for known directive type and originating pragma/scope node. More...
 
void init ()
 Member functions ------------------------------— Initialize internal data. More...
 
std::string toOpenMPString (omp_construct_enum omp_type)
 Convert entire directives and clauses to string ,. More...
 
std::string toOpenMPString (std::vector< std::pair< std::string, SgNode * > >)
 Convert a variable list to x,y,z ,without parenthesis. More...
 

Private Attributes

SgNodemNode
 The associated SgNode for this attribute, could be SgPragmaDeclaration or other nodes. More...
 
PreprocessingInfopinfo
 Associated PreprocessingInfo for Fortran only. More...
 
bool isUserDefined
 A flag to indicate if the source OpenMP directive is introduced by programmers or not (by autoPar) More...
 
enum omp_construct_enum omp_type
 Directive information: type of OpenMP directive. More...
 
std::vector< omp_construct_enumclauses
 Clause information. More...
 
std::map< omp_construct_enum,
bool > 
clause_map
 
std::vector< omp_construct_enumreduction_operators
 
std::vector< omp_construct_enummap_variants
 
std::map< omp_construct_enum,
std::vector< std::pair
< std::string, SgNode * > > > 
variable_lists
 
std::map< std::string,
std::vector
< omp_construct_enum > > 
var_clauses
 
std::map< omp_construct_enum,
std::pair< std::string,
SgExpression * > > 
expressions
 
omp_construct_enum default_scope
 
omp_construct_enum schedule_kind
 
bool hasName
 
std::string name
 
bool isOrphaned
 
int wrapperCount
 
OmpAttributeparent
 

Friends

OmpAttributebuildOmpAttribute (omp_construct_enum directive_type, SgNode *node, bool userDefined)
 Some utility functions to manipulate OmpAttribute. More...
 

Detailed Description

Definition at line 255 of file OmpAttribute.h.

Constructor & Destructor Documentation

OmpSupport::OmpAttribute::OmpAttribute ( )
inlineprivate

Default constructors.

Definition at line 362 of file OmpAttribute.h.

References OmpSupport::e_unknown, and Dbg::init().

OmpSupport::OmpAttribute::OmpAttribute ( omp_construct_enum  omptype,
SgNode mynode 
)
inlineprivate

Constructor for known directive type and originating pragma/scope node.

Definition at line 370 of file OmpAttribute.h.

References Dbg::init(), and isSgLocatedNode().

Member Function Documentation

SgPragmaDeclaration* OmpSupport::OmpAttribute::getPragmaDeclaration ( )

-----------—AST connection---------------— Get the associated SgPragmaDeclaration for C/C++, if any

PreprocessingInfo* OmpSupport::OmpAttribute::getPreprocessingInfo ( )
inline

Get the associated PreprocessingInfo for Fortran, if any.

Definition at line 263 of file OmpAttribute.h.

void OmpSupport::OmpAttribute::setPreprocessingInfo ( PreprocessingInfo info)
inline

Definition at line 264 of file OmpAttribute.h.

SgNode* OmpSupport::OmpAttribute::getNode ( )
inline

Get the associated SgNode, can be SgPragmaDeclaration or others( for fortran nodes or during parallelization)

Definition at line 267 of file OmpAttribute.h.

void OmpSupport::OmpAttribute::setNode ( SgNode n)
inline

Definition at line 268 of file OmpAttribute.h.

void OmpSupport::OmpAttribute::setOmpDirectiveType ( omp_construct_enum  omptype)
inline

---------—directive type----—

Definition at line 270 of file OmpAttribute.h.

References OmpSupport::isDirective().

omp_construct_enum OmpSupport::OmpAttribute::getOmpDirectiveType ( )
inline

Definition at line 271 of file OmpAttribute.h.

void OmpSupport::OmpAttribute::addClause ( omp_construct_enum  clause_type)

--------—clauses-------------— Add a clause into an OpenMP directive, the content of the clause is set by other interface, such as addVariable(), addExpression() , setReductionOperator() etc.

bool OmpSupport::OmpAttribute::hasClause ( omp_construct_enum  clause_type)

Check if a directive has a clause of the specified type.

std::vector<omp_construct_enum> OmpSupport::OmpAttribute::getClauses ( )

Get all existing clauses.

SgVariableSymbol* OmpSupport::OmpAttribute::addVariable ( omp_construct_enum  targetConstruct,
const std::string &  varString,
SgInitializedName sgvar = NULL 
)

-----—var list -----------— Add a variable into a variable list of an OpenMP construct ,return the symbol of the variable added, if possible

bool OmpSupport::OmpAttribute::hasVariableList ( omp_construct_enum  )

Check if a variable list is associated with a construct.

std::vector<std::pair<std::string,SgNode* > > OmpSupport::OmpAttribute::getVariableList ( omp_construct_enum  )

Get the variable list associated with a construct.

std::vector<enum omp_construct_enum> OmpSupport::OmpAttribute::get_clauses ( const std::string &  variable)

Find the relevant clauses for a variable.

void OmpSupport::OmpAttribute::addExpression ( omp_construct_enum  targetConstruct,
const std::string &  expString,
SgExpression sgexp = NULL 
)

-----—Expressions --------------------------— Add an expression to a clause

std::pair<std::string, SgExpression*> OmpSupport::OmpAttribute::getExpression ( omp_construct_enum  targetConstruct)

Get expression of a clause.

void OmpSupport::OmpAttribute::setReductionOperator ( omp_construct_enum  operatorx)

-----—values for some clauses -------—

std::vector<omp_construct_enum> OmpSupport::OmpAttribute::getReductionOperators ( )

Get reduction clauses for each operations, reduction(op:kind)

bool OmpSupport::OmpAttribute::hasReductionOperator ( omp_construct_enum  operatorx)

Check if a reduction operation exists.

void OmpSupport::OmpAttribute::setMapVariant ( omp_construct_enum  operatorx)
std::vector<omp_construct_enum> OmpSupport::OmpAttribute::getMapVariants ( )

Get map clauses for each variant, map(variant:var_list)

bool OmpSupport::OmpAttribute::hasMapVariant ( omp_construct_enum  operatorx)

Check if a map variant exists.

bool OmpSupport::OmpAttribute::isMapVariant ( omp_construct_enum  omp_type)

Check if the input parameter is a map variant enum type.

void OmpSupport::OmpAttribute::setDefaultValue ( omp_construct_enum  valuex)
omp_construct_enum OmpSupport::OmpAttribute::getDefaultValue ( )
omp_construct_enum OmpSupport::OmpAttribute::getScheduleKind ( )
void OmpSupport::OmpAttribute::setScheduleKind ( omp_construct_enum  kindx)
bool OmpSupport::OmpAttribute::isInConstruct ( const std::string &  variable,
enum  omp_construct_enum 
)

Check if a variable is inside a variable list of a clause/directive.

void OmpSupport::OmpAttribute::setCriticalName ( const std::string &  name)

Set name for named critical section.

std::string OmpSupport::OmpAttribute::getCriticalName ( )
inline

Definition at line 343 of file OmpAttribute.h.

References name.

bool OmpSupport::OmpAttribute::isNamedCritical ( )
inline

Definition at line 344 of file OmpAttribute.h.

void OmpSupport::OmpAttribute::print ( )

Pretty print the OmpAttribute.

bool OmpSupport::OmpAttribute::get_isUserDefined ( )
inline

Definition at line 350 of file OmpAttribute.h.

std::string OmpSupport::OmpAttribute::toOpenMPString ( )

Convert OmpAttribute to a legal OpenMP pragma string,.

void OmpSupport::OmpAttribute::init ( )
private

Member functions ------------------------------— Initialize internal data.

std::string OmpSupport::OmpAttribute::toOpenMPString ( omp_construct_enum  omp_type)
private

Convert entire directives and clauses to string ,.

std::string OmpSupport::OmpAttribute::toOpenMPString ( std::vector< std::pair< std::string, SgNode * > >  )
private

Convert a variable list to x,y,z ,without parenthesis.

Friends And Related Function Documentation

OmpAttribute* buildOmpAttribute ( omp_construct_enum  directive_type,
SgNode node,
bool  userDefined 
)
friend

Some utility functions to manipulate OmpAttribute.

A builder for OmpAttribute, useDefined indicates if the directive is added by programmer or not (by autoParallelization)

Member Data Documentation

std::map<SgSymbol*, std::vector < std::pair <SgExpression*, SgExpression*> > > OmpSupport::OmpAttribute::array_dimensions

Dimension information for array variables, used by map clause, such as map (inout:array[0:n][0:m])

Definition at line 293 of file OmpAttribute.h.

SgNode* OmpSupport::OmpAttribute::mNode
private

The associated SgNode for this attribute, could be SgPragmaDeclaration or other nodes.

Definition at line 388 of file OmpAttribute.h.

PreprocessingInfo* OmpSupport::OmpAttribute::pinfo
private

Associated PreprocessingInfo for Fortran only.

Definition at line 390 of file OmpAttribute.h.

bool OmpSupport::OmpAttribute::isUserDefined
private

A flag to indicate if the source OpenMP directive is introduced by programmers or not (by autoPar)

Definition at line 393 of file OmpAttribute.h.

enum omp_construct_enum OmpSupport::OmpAttribute::omp_type
private

Directive information: type of OpenMP directive.

Definition at line 396 of file OmpAttribute.h.

std::vector<omp_construct_enum> OmpSupport::OmpAttribute::clauses
private

Clause information.

Definition at line 402 of file OmpAttribute.h.

std::map<omp_construct_enum,bool> OmpSupport::OmpAttribute::clause_map
private

Definition at line 403 of file OmpAttribute.h.

std::vector<omp_construct_enum> OmpSupport::OmpAttribute::reduction_operators
private

Definition at line 407 of file OmpAttribute.h.

std::vector<omp_construct_enum> OmpSupport::OmpAttribute::map_variants
private

Definition at line 412 of file OmpAttribute.h.

std::map<omp_construct_enum, std::vector<std::pair<std::string,SgNode* > > > OmpSupport::OmpAttribute::variable_lists
private

Definition at line 422 of file OmpAttribute.h.

std::map<std::string, std::vector<omp_construct_enum> > OmpSupport::OmpAttribute::var_clauses
private

Definition at line 424 of file OmpAttribute.h.

std::map<omp_construct_enum, std::pair<std::string, SgExpression*> > OmpSupport::OmpAttribute::expressions
private

Definition at line 428 of file OmpAttribute.h.

omp_construct_enum OmpSupport::OmpAttribute::default_scope
private

Definition at line 433 of file OmpAttribute.h.

omp_construct_enum OmpSupport::OmpAttribute::schedule_kind
private

Definition at line 436 of file OmpAttribute.h.

bool OmpSupport::OmpAttribute::hasName
private

Definition at line 440 of file OmpAttribute.h.

std::string OmpSupport::OmpAttribute::name
private

Definition at line 441 of file OmpAttribute.h.

bool OmpSupport::OmpAttribute::isOrphaned
private

Definition at line 445 of file OmpAttribute.h.

int OmpSupport::OmpAttribute::wrapperCount
private

Definition at line 448 of file OmpAttribute.h.

OmpAttribute* OmpSupport::OmpAttribute::parent
private

Definition at line 451 of file OmpAttribute.h.


The documentation for this class was generated from the following file: