ROSE
0.9.6a
|
This class represents the location of the code associated with the IR node in the original source code. More...
#include <Cxx_Grammar.h>
Public Types | |
enum | classifier { e_transformation = 0x1, e_compiler_generated = 0x2, e_output_in_code_generation = 0x4, e_shared = 0x8, e_frontend_specific = 0x10, e_source_position_unavailable_in_frontend = 0x20, e_comment_or_directive = 0x40, e_token = 0x80, e_default_argument = 0x100, e_implicit_cast = 0x200 } |
Enum type containing classifications if IR nodes. More... | |
enum | p_fileflags { COPY_FILE_ID = -1, NULL_FILE_ID = -2, TRANSFORMATION_FILE_ID = -3, COMPILER_GENERATED_FILE_ID = -4, COMPILER_GENERATED_MARKED_FOR_OUTPUT_FILE_ID = -5, BAD_FILE_ID = -6 } |
Enum to hold previously common default values for filename used by the default and static SgNULL_File constructors. More... | |
enum | { static_variant = V_Sg_File_Info } |
static variant value More... | |
typedef SgSupport | base_node_type |
Public Types inherited from SgSupport | |
enum | { static_variant = V_SgSupport } |
static variant value More... | |
typedef SgNode | base_node_type |
Public Types inherited from SgNode | |
enum | { static_variant = V_SgNode } |
static variant value More... | |
Public Member Functions | |
virtual SgNode * | copy (SgCopyHelp &help) const |
This function clones the current IR node object recursively or not, depending on the argument. More... | |
Sg_File_Info () | |
This is the less useful default constructor. More... | |
Sg_File_Info (const std::string &filename, int line=0, int col=0) | |
Sg_File_Info (const Sg_File_Info &X) | |
This the copy constructor (deep copy made). More... | |
Sg_File_Info (int file_id, int line, int column) | |
void | post_construction_initialization () |
Final initialization for constructors This function is called at the end of generated constructors to allow the specification writer to add special initialization functions or tests. Default is to do nothing. Otherwise it should be overridden in the spec file, in NewHeaderCode/NewOutlinedCode. More... | |
void | set_filename (const char *filename) ROSE_DEPRECATED_FUNCTION |
This function sets the filename of the construct's association with source code. More... | |
void | set_filenameString (const std::string &filename) |
void | set_line (int line) |
This function sets the line number of the construct's association with source code in the source file named by p_filename. More... | |
void | set_col (int n) |
void | display (const std::string label) const |
void | display () const |
std::string | displayString (const std::string &label="") const |
const char * | get_filename () const ROSE_DEPRECATED_FUNCTION |
Returns filename of source code associated with IR node. More... | |
const std::string & | get_filenameString () const |
int | get_line () const |
Returns the line number of the associated code for this IR node. More... | |
int | get_col () const |
Returns the column number of the associated code for this IR node. More... | |
void | set_file_id (int file_id) |
int | get_file_id () const |
std::string | get_raw_filename () const |
Returns filename of source code associated with IR node. More... | |
int | get_raw_line () const |
Returns the line number of the associated code for this IR node. More... | |
int | get_raw_col () const |
Returns the column number of the associated code for this IR node. More... | |
void | set_physical_filename (const std::string &filename) |
std::string | get_physical_filename () const |
void | set_physical_file_id (int physical_file_id) |
int | get_physical_file_id () const |
void | set_physical_line (int line) |
int | get_physical_line () const |
void | set_physical_source_position_to_match_logical_source_position () |
void | set_source_sequence_number (unsigned int n) |
unsigned int | get_source_sequence_number () const |
void | updateSourcePosition (Sg_File_Info *update) |
bool | hasPositionInSource () const |
No earthly idea what this function does! More... | |
bool | isSameFile (SgFile *file) const |
bool | isSameFile (Sg_File_Info *fileInfo) const |
bool | isSameFile (const Sg_File_Info &fileInfo) const |
bool | isTransformation () const |
Access function for classification bit field. More... | |
bool | isCompilerGenerated () const |
Returns true only if compiler generated (either by the front-end or by ROSE). More... | |
bool | isCompilerGeneratedNodeToBeUnparsed () const ROSE_DEPRECATED_FUNCTION |
Returns true only if compiler generated and required to be unparsed in generated code. More... | |
bool | isOutputInCodeGeneration () const |
Returns true only if required to be unparsed in generated code. More... | |
bool | isShared () const |
Returns true only if shared internally (either by the front-end or by ROSE). More... | |
bool | isFrontendSpecific () const |
bool | isSourcePositionUnavailableInFrontend () const |
void | unsetSourcePositionUnavailableInFrontend () |
void | setSourcePositionUnavailableInFrontend () |
bool | isCommentOrDirective () const |
void | unsetCommentOrDirective () |
void | setCommentOrDirective () |
bool | isToken () const |
void | unsetToken () |
void | setToken () |
bool | isDefaultArgument () const |
void | unsetDefaultArgument () |
void | setDefaultArgument () |
bool | isImplicitCast () const |
void | unsetImplicitCast () |
void | setImplicitCast () |
void | unsetTransformation () |
Set/unset functions for classification bit field. More... | |
void | setTransformation () |
Marks an IR node to be a transformation if it is not one already. More... | |
void | unsetCompilerGeneratedNodeToBeUnparsed () ROSE_DEPRECATED_FUNCTION |
Mark as compiler generated but as required to be output by unparser (e.g. required template instatiations) More... | |
void | setCompilerGeneratedNodeToBeUnparsed () ROSE_DEPRECATED_FUNCTION |
Marks IR node as compiler generated but required in the generated source (e.g. requied templates). More... | |
void | unsetOutputInCodeGeneration () |
Mark as to be output by the unparser (code generator) More... | |
void | setOutputInCodeGeneration () |
Marks IR node as compiler generated but required in the generated source (e.g. requied templates). More... | |
void | unsetShared () |
Support for shared IR nodes (shared via AST merge mechanism) More... | |
void | setShared () |
Marks IR node as shared. More... | |
void | unsetFrontendSpecific () |
void | setFrontendSpecific () |
void | addFileToUnparse (int file_id) |
Add files to the set that should be able to unparse the node. More... | |
bool | shouldUnparse (int file_id) |
Should this node be unparsed by this file? More... | |
void | unsetCompilerGenerated () |
Unmarks IR node as compiler generated. More... | |
void | setCompilerGenerated () |
Marks IR node as compiler generated. More... | |
unsigned int | get_classificationBitField (void) const |
Get whole bit field fr modifier set. More... | |
void | set_classificationBitField (unsigned int) |
void | set_isPartOfTransformation (bool isPartOfTransformation) ROSE_DEPRECATED_FUNCTION |
This function marks an IR nodes as being part of a transformation, this function is deprecated. More... | |
bool | get_isPartOfTransformation () ROSE_DEPRECATED_FUNCTION |
This function indicates of the IR nodes is part of a transformation. More... | |
void | register_node (SgLocatedNode *node) ROSE_DEPRECATED_FUNCTION |
void | deregister_node (SgLocatedNode *node) ROSE_DEPRECATED_FUNCTION |
bool | ok () const |
Checks internal consistancy of data. More... | |
Sg_File_Info & | operator= (const Sg_File_Info &X) |
virtual std::string | class_name () const |
Copies AST (whole subtree, depending on the SgCopyHelp class. More... | |
virtual VariantT | variantT () const |
returns new style SageIII enum values More... | |
void * | operator new (size_t size) |
returns pointer to newly allocated IR node More... | |
void | operator delete (void *pointer, size_t size) |
deallocated memory for IR node (returns memory to memory pool for reuse) More... | |
void | operator delete (void *pointer) |
virtual std::vector< SgNode * > | get_traversalSuccessorContainer () |
FOR INTERNAL USE within ROSE traverals mechanism only. More... | |
virtual std::vector< std::string > | get_traversalSuccessorNamesContainer () |
FOR INTERNAL USE within ROSE traverals mechanism only. More... | |
virtual size_t | get_numberOfTraversalSuccessors () |
virtual SgNode * | get_traversalSuccessorByIndex (size_t idx) |
virtual size_t | get_childIndex (SgNode *child) |
virtual RTIReturnType | roseRTI () |
FOR INTERNAL USE Access to Runtime Type Information (RTI) for this IR nodes. More... | |
virtual const char * | sage_class_name () const ROSE_DEPRECATED_FUNCTION |
void | executeVisitorMemberFunction (ROSE_VisitorPattern &visitor) |
FOR INTERNAL USE Support for visitor pattern. More... | |
virtual void | accept (ROSE_VisitorPattern &visitor) |
DXN (08/09/2010): support for the classic visitor pattern done in GoF. More... | |
virtual bool | isInMemoryPool () |
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the heap. More... | |
virtual void | checkDataMemberPointersIfInMemoryPool () |
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the heap. More... | |
virtual std::vector< std::pair < SgNode *, std::string > > | returnDataMemberPointers () const |
FOR INTERNAL USE Returns STL vector of pairs of SgNode* and strings for use in AST tools More... | |
virtual void | processDataMemberReferenceToPointers (ReferenceToPointerHandler *) |
FOR INTERNAL USE Processes pairs of references to SgNode* and strings for use in AST tools More... | |
virtual long | getChildIndex (SgNode *childNode) const |
FOR INTERNAL USE Returns a unique index value for the childNode in the list of children at this IR node. More... | |
Sg_File_Info (const Sg_File_InfoStorageClass &source) | |
Sg_File_Info * | addRegExpAttribute (std::string s, AstRegExAttribute *a) |
Support for AST matching using regular expression. More... | |
SgFileIdList | get_fileIDsToUnparse () const |
void | set_fileIDsToUnparse (SgFileIdList fileIDsToUnparse) |
virtual | ~Sg_File_Info () |
This is the destructor. More... | |
Public Member Functions inherited from SgSupport | |
void * | operator new (size_t size) |
returns pointer to newly allocated IR node More... | |
void | operator delete (void *pointer, size_t size) |
deallocated memory for IR node (returns memory to memory pool for reuse) More... | |
void | operator delete (void *pointer) |
void | executeVisitorMemberFunction (ROSE_VisitorPattern &visitor) |
FOR INTERNAL USE Support for visitor pattern. More... | |
SgSupport (const SgSupportStorageClass &source) | |
SgSupport * | addRegExpAttribute (std::string s, AstRegExAttribute *a) |
Support for AST matching using regular expression. More... | |
virtual | ~SgSupport () |
This is the destructor. More... | |
SgSupport () | |
This is the constructor. More... | |
Public Member Functions inherited from SgNode | |
void * | operator new (size_t size) |
returns pointer to newly allocated IR node More... | |
void | operator delete (void *pointer, size_t size) |
deallocated memory for IR node (returns memory to memory pool for reuse) More... | |
void | operator delete (void *pointer) |
void | executeVisitorMemberFunction (ROSE_VisitorPattern &visitor) |
FOR INTERNAL USE Support for visitor pattern. More... | |
SgNode (const SgNodeStorageClass &source) | |
SgNode * | addRegExpAttribute (std::string s, AstRegExAttribute *a) |
Support for AST matching using regular expression. More... | |
void | set_isModified (bool isModified) |
All nodes in the AST contain a isModified flag used to track changes to the AST. More... | |
bool | get_isModified () const |
Acess function for isModified flag This flag records if the current IR node has been modified. It is set to false after and ROSE front-end processing. More... | |
void | set_parent (SgNode *parent) |
All nodes in the AST contain a reference to a parent node. More... | |
SgNode * | get_parent () const |
Access function for parent node. More... | |
bool | isChild (SgNode *node) const |
Query function for if the input IR nodes is a child of the current IR node. More... | |
virtual std::string | unparseToString (SgUnparse_Info *info) const |
This function unparses the AST node (excluding comments and unnecessary white space) More... | |
std::string | unparseToString () const |
std::string | unparseToCompleteString () |
This function unparses the AST node (including comments and white space) More... | |
int | variant () const ROSE_DEPRECATED_FUNCTION |
Older version function returns enum value "NODE". More... | |
virtual void | addNewAttribute (std::string s, AstAttribute *a) |
Add a new attribute represented by the named string. More... | |
virtual AstAttribute * | getAttribute (std::string s) const |
Returns attribute of name 's'. More... | |
virtual void | updateAttribute (std::string s, AstAttribute *a) |
Replace existing attribute of name 's' with new AstAttribute. More... | |
virtual void | setAttribute (std::string s, AstAttribute *a) |
This is a wrapper function with the following semantics: if no attribute of name 's' exists then addNewAttribute(s,a); is called, otherwise updateAttribute(s,a); is called. More... | |
virtual void | removeAttribute (std::string s) |
Remove attribute of name 's' if present. More... | |
virtual bool | attributeExists (std::string s) const |
Tests if attribute of name 's' is present. More... | |
virtual int | numberOfAttributes () const |
Returns the number of attributes on this IR node. More... | |
virtual AstAttributeMechanism * | get_attributeMechanism () const |
FOR INTERNAL USE Access function; if an attribute exists then a pointer to it is returned, else error. More... | |
virtual void | set_attributeMechanism (AstAttributeMechanism *a) |
FOR INTERNAL USE Access function; sets poiner to value AstAttributeMechanism. More... | |
virtual void | fixupCopy (SgNode *copy, SgCopyHelp &help) const |
virtual Sg_File_Info * | get_file_info (void) const |
File information containing filename, line number, column number, and if the SgNode is a part of a new transformation, etc. More... | |
virtual Sg_File_Info * | get_startOfConstruct (void) const |
New function interface for Sg_File_Info data stores starting location of contruct (typically the opening brace or first letter of keyword). More... | |
virtual Sg_File_Info * | get_endOfConstruct (void) const |
New function interface for Sg_File_Info data stores ending location of contruct (typically the closing brace). More... | |
VirtualCFG::CFGNode | cfgForBeginning () |
Returns the CFG node for just before this AST node. More... | |
VirtualCFG::CFGNode | cfgForEnd () |
Returns the CFG node for just after this AST node. More... | |
virtual unsigned int | cfgIndexForEnd () const |
Determine the CFG index for the end of this construct. More... | |
virtual bool | cfgIsIndexInteresting (unsigned int index) const |
Determine whether a particular CFG node index is "interesting" for this kind of node. More... | |
virtual unsigned int | cfgFindChildIndex (SgNode *n) |
Find the index of n in this node's CFG children. More... | |
virtual unsigned int | cfgFindNextChildIndex (SgNode *n) |
Find the index just after n in this node's CFG children. More... | |
virtual std::vector < VirtualCFG::CFGEdge > | cfgOutEdges (unsigned int index=false) |
Find the out edges of a CFG node – internal version. More... | |
virtual std::vector < VirtualCFG::CFGEdge > | cfgInEdges (unsigned int index=false) |
Find the in edges of a CFG node – internal version. More... | |
int | numberOfNodesInSubtree () |
Computes the number of nodes in the defined subtree of the AST. More... | |
int | depthOfSubtree () |
Computes the depth of the current defined subtree of the AST. More... | |
SgNode * | get_freepointer () const |
void | set_freepointer (SgNode *freepointer) |
virtual | ~SgNode () |
This is the destructor. More... | |
SgNode () | |
This is the constructor. More... | |
bool | get_isVisited () const ROSE_DEPRECATED_FUNCTION |
DOCS IN HEADER: Access function for p_isVisited flag used previously by the AST traversals. More... | |
void | set_isVisited (bool isVisited) ROSE_DEPRECATED_FUNCTION |
Access function for p_isVisited flag used previously by the AST traversals. More... | |
Static Public Member Functions | |
static int | addFilenameToMap (const std::string &filename) |
Access function to permit files referenced in Dwarf to be mapped to integers using the same scheme as for source code. More... | |
static int | numberOfSourceFiles () |
Returns the number of entries in the filename map. More... | |
static void | display_static_data (const std::string label) |
static Sg_File_Info * | generateDefaultFileInfo () |
Static function to return new Sg_File_Info object set to default values. More... | |
static Sg_File_Info * | generateDefaultFileInfoForTransformationNode () |
Static function to return new Sg_File_Info object set to default values appropriate for transformations. More... | |
static Sg_File_Info * | generateFileInfoForTransformationNode (int file_id) |
Static function to return new Sg_File_Info object set to default values appropriate for transformations that are not in the source file. More... | |
static Sg_File_Info * | generateFileInfoForTransformationNode (std::string filename) |
static Sg_File_Info * | generateDefaultFileInfoForCompilerGeneratedNode () |
Static function to return new Sg_File_Info object set to default values appropriate for compiler generated code. More... | |
static const std::string & | getFilenameFromID (int id) |
static int | getIDFromFilename (std::string filename) |
static std::map< int, std::string > & | get_fileidtoname_map () |
Access function for static datamember fileidtoname_map. More... | |
static void | set_fileidtoname_map (std::map< int, std::string > &X) |
Access function for map of file names. More... | |
static std::map< std::string, int > & | get_nametofileid_map () |
Access function for static datamember nametofileid_map. More... | |
static void | set_nametofileid_map (std::map< std::string, int > &X) |
Access function for map of file names. More... | |
static size_t | numberOfNodes () |
Returns the total number of IR nodes of this type. More... | |
static size_t | memoryUsage () |
Returns the size in bytes of the total memory allocated for all IR nodes of this type. More... | |
static void | traverseMemoryPoolNodes (ROSE_VisitTraversal &visit) |
FOR INTERNAL USE Support for visitor pattern. More... | |
static void | traverseMemoryPoolVisitorPattern (ROSE_VisitorPattern &visitor) |
FOR INTERNAL USE Support for visitor pattern. More... | |
static void | visitRepresentativeNode (ROSE_VisitTraversal &visit) |
FOR INTERNAL USE Support for type-based traversal. More... | |
Static Public Member Functions inherited from SgSupport | |
static size_t | numberOfNodes () |
Returns the total number of IR nodes of this type. More... | |
static size_t | memoryUsage () |
Returns the size in bytes of the total memory allocated for all IR nodes of this type. More... | |
static void | traverseMemoryPoolNodes (ROSE_VisitTraversal &visit) |
FOR INTERNAL USE Support for visitor pattern. More... | |
static void | traverseMemoryPoolVisitorPattern (ROSE_VisitorPattern &visitor) |
FOR INTERNAL USE Support for visitor pattern. More... | |
static void | visitRepresentativeNode (ROSE_VisitTraversal &visit) |
FOR INTERNAL USE Support for type-based traversal. More... | |
Static Public Member Functions inherited from SgNode | |
static size_t | numberOfNodes () |
Returns the total number of IR nodes of this type. More... | |
static size_t | memoryUsage () |
Returns the size in bytes of the total memory allocated for all IR nodes of this type. More... | |
static void | traverseMemoryPoolNodes (ROSE_VisitTraversal &visit) |
FOR INTERNAL USE Support for visitor pattern. More... | |
static void | traverseMemoryPoolVisitorPattern (ROSE_VisitorPattern &visitor) |
FOR INTERNAL USE Support for visitor pattern. More... | |
static void | visitRepresentativeNode (ROSE_VisitTraversal &visit) |
FOR INTERNAL USE Support for type-based traversal. More... | |
static std::vector< std::string > | buildCommandLineToSubstituteTransformationFile (const std::vector< std::string > &argv, std::string newFileName) |
Command line support for this compilation The command line is saved as a static variable so that it will be available to support the rewrite mechanism. More... | |
static std::vector< VariantT > | getClassHierarchySubTreeFunction (VariantT v) |
static void | getClassHierarchySubTreeFunction (VariantT v, std::vector< VariantT > &) |
static std::map< SgNode *, std::string > & | get_globalMangledNameMap () |
Access function for performance optimizing global mangled name map. More... | |
static void | clearGlobalMangledNameMap () |
Support to clear the performance optimizing global mangled name map. More... | |
static std::map< std::string, int > & | get_shortMangledNameCache () |
Access function for lower level optimizing of global mangled name map. More... | |
static std::map< SgNode *, std::string > & | get_globalQualifiedNameMapForNames () |
Access function for name qualification support (for names). More... | |
static void | set_globalQualifiedNameMapForNames (const std::map< SgNode *, std::string > &X) |
Access function for name qualification support (for names). More... | |
static std::map< SgNode *, std::string > & | get_globalQualifiedNameMapForTypes () |
Access function for name qualification support (for type). More... | |
static void | set_globalQualifiedNameMapForTypes (const std::map< SgNode *, std::string > &X) |
Access function for name qualification support (for type). More... | |
static std::map< SgNode *, std::string > & | get_globalTypeNameMap () |
Access function for name qualification support (for names of types). More... | |
static void | set_globalTypeNameMap (const std::map< SgNode *, std::string > &X) |
Access function for name qualification support (for names of types). More... | |
static SgFunctionTypeTable * | get_globalFunctionTypeTable () |
Access function for symbol table specific to function types. More... | |
static void | set_globalFunctionTypeTable (SgFunctionTypeTable *globalFunctionTypeTable) |
Access function for symbol table specific to function types. More... | |
static SgTypeTable * | get_globalTypeTable () |
Access function for symbol table specific to non-function types. More... | |
static void | set_globalTypeTable (SgTypeTable *globalTypeTable) |
Access function for symbol table specific to non-function types. More... | |
Protected Attributes | |
int | p_file_id |
This is a key that maps integers to file names, it prevents redundent storage of filename strings. More... | |
int | p_line |
This is the line number of the location of the source code for this IR node. More... | |
int | p_col |
This is the column number of the location of the source code for this IR node. More... | |
unsigned int | p_classificationBitField |
This is mechanism for classification of the IR node. More... | |
int | p_physical_file_id |
int | p_physical_line |
unsigned int | p_source_sequence_number |
SgFileIdList | p_fileIDsToUnparse |
This set contains a list of all file ids for which the accompanying IR node should be unparsed. More... | |
Static Protected Attributes | |
static std::map< int, std::string > | p_fileidtoname_map |
This is a static STL map of file id (integers) to file names (strings). More... | |
static std::map< std::string, int > | p_nametofileid_map |
This is a static STL map of file names (strings) to file id (integers). More... | |
Friends | |
class | AST_FILE_IO |
class | Sg_File_InfoStorageClass |
class | AstSpecificDataManagingClass |
class | AstSpecificDataManagingClassStorageClass |
bool | operator== (const Sg_File_Info &X, const Sg_File_Info &Y) |
This relational operator tests two Sg_File_Info objects for equal position information. More... | |
bool | operator!= (const Sg_File_Info &X, const Sg_File_Info &Y) |
This relational operator tests two Sg_File_Info objects for unequal position information. More... | |
bool | operator> (const Sg_File_Info &X, const Sg_File_Info &Y) |
This relational operator tests two Sg_File_Info objects for X being after Y in the same file. More... | |
bool | operator< (const Sg_File_Info &X, const Sg_File_Info &Y) |
This relational operator tests two Sg_File_Info objects for X being before Y in the same file. More... | |
bool | operator>= (const Sg_File_Info &X, const Sg_File_Info &Y) |
This relational operator tests two Sg_File_Info objects for X being at the same position or after Y in the same file. More... | |
bool | operator<= (const Sg_File_Info &X, const Sg_File_Info &Y) |
This relational operator tests two Sg_File_Info objects for X being at the same position or before Y in the same file. More... | |
ROSE_DLL_API friend Sg_File_Info * | isSg_File_Info (SgNode *s) |
Casts pointer from base class to derived class. More... | |
ROSE_DLL_API friend const Sg_File_Info * | isSg_File_Info (const SgNode *s) |
Casts pointer from base class to derived class (for const pointers) More... | |
Sg_File_Info * | Sg_File_Info_getPointerFromGlobalIndex (unsigned long globalIndex) |
Constructor for use by AST File I/O Mechanism. More... | |
unsigned long | Sg_File_Info_getNumberOfValidNodesAndSetGlobalIndexInFreepointer (unsigned long) |
Get the size of the memory pool. More... | |
void | Sg_File_Info_clearMemoryPool () |
void | Sg_File_Info_extendMemoryPoolForFileIO (unsigned long) |
void | Sg_File_Info_getNextValidPointer (std::pair< Sg_File_Info *, std::vector< unsigned char * >::const_iterator > &) |
void | Sg_File_Info_resetValidFreepointers () |
This class represents the location of the code associated with the IR node in the original source code.
This object is used to represent the starting and the ending position of the source code
associated with some IR nodes (in other cases the endOfConstruct returnes the same data as the startOfConstruct).
Classification of the IR nodes is included in this object and applies to: - SgStatements - SgExpression - SgInitializedName - SgFile (and maybe SgDirectory) - Perhaps also SgTemplateArguments, SgTemplateParameters, SgBaseClass
classifications are:
Note that p_filename is correctly initialized in the Sg_File_Info object for a SgGlobal, but the p_line and p_col are set to 0 (zero). All other IR nodes have valid Sg_File_Info objects with correct p_filename and p_line and p_col set to nonzero values. A few IR nodes in the AST will have a default value of their Sg_File_Info nodes with p_filename set to "NULL_FILE" and p_line and p_col set to 0 (zero). These are increasingly rare to find in the AST, but since some IR nodes can't be associated with their source position in the AST they persist.
A pointer for this object is in the SgNode, but it is only valid for SgLocatedNodes and the SgInitializedName. The get_File_Info() member function (and associated get_startOfConstruct() and get_endOfConstruct() member functions) are implemented in the SgNode, for uniformity, but return NULL for all but the SgLocatedNodes and the SgInitializedName IR nodes.
Definition at line 20046 of file Cxx_Grammar.h.
Definition at line 20698 of file Cxx_Grammar.h.
Enum type containing classifications if IR nodes.
This is part of the classification mechanism for IR nodes within ROSE. Compiler generated code is not output in the code generation phase, but some compiler generated IR nodes must be output so such nodes are explicitly marked within the classification process (implemented in ASTFixes.C).
We need constructors taking a value of this type.
Definition at line 20083 of file Cxx_Grammar.h.
Enum to hold previously common default values for filename used by the default and static SgNULL_File constructors.
These values can and likely should disappear in the future.
Definition at line 20334 of file Cxx_Grammar.h.
anonymous enum |
Sg_File_Info::Sg_File_Info | ( | ) |
This is the less useful default constructor.
This constructor builds the Sg_File_Info base class.
This constructor should be deprecated since we don't want it to be used. It's presence is historical, since it was previously used a lot (inappropriately). Before it is removed we likely need a constructor that can take a Sg_File_Info::classifier enum value.
Sg_File_Info::Sg_File_Info | ( | const std::string & | filename, |
int | line = 0 , |
||
int | col = 0 |
||
) |
Sg_File_Info::Sg_File_Info | ( | const Sg_File_Info & | X) |
This the copy constructor (deep copy made).
This constructor does a deep copy of all data in the Sg_File_Info object.
Sg_File_Info::Sg_File_Info | ( | int | file_id, |
int | line, | ||
int | column | ||
) |
Sg_File_Info::Sg_File_Info | ( | const Sg_File_InfoStorageClass & | source) |
|
virtual |
This is the destructor.
There is nothing to delete in this object.
|
virtual |
This function clones the current IR node object recursively or not, depending on the argument.
This function performs a copy based on the specification of the input parameter. The input parameter is used to determin which data members are copied by reference and which are copied by value.
help | - If this argument is of type SgTreeCopy, then the IR node is cloned recursively. If its of type SgShallowCopy only the first level of the IR node is copied, everything else is left pointing to the the original IR node's object's data members. |
It appears the the copy functions don't set the parents of anything that they do a deep copy of! This can cause AST tests to fail. In particular some functions that require the parent pointers to be valid will return NULL pointers (e.g. SgInitializedName::get_declaration()). It might be that we should allow this to be done as part of the SgCopyHelp::clone function or perhaps another member function of SgCopyHelp would be useful for this support. It is not serious if the AST post processing is done since that will set any NULL pointers that are found within its traversal.
none | No exceptions are thrown by this function. |
Reimplemented from SgSupport.
|
virtual |
Final initialization for constructors This function is called at the end of generated constructors to allow the specification writer to add special initialization functions or tests. Default is to do nothing. Otherwise it should be overridden in the spec file, in NewHeaderCode/NewOutlinedCode.
Reimplemented from SgNode.
|
static |
Access function to permit files referenced in Dwarf to be mapped to integers using the same scheme as for source code.
|
static |
Returns the number of entries in the filename map.
Sg_File_Info::set_filename | ( | const char * | filename) |
This function sets the filename of the construct's association with source code.
This function should be updated to take and return a string. Likely we can implement an overloaded function with takes and resturns a string and preserve this function (deprecated) for a period of time.
void Sg_File_Info::set_filenameString | ( | const std::string & | filename) |
Sg_File_Info::set_line | ( | int | line) |
This function sets the line number of the construct's association with source code in the source file named by p_filename.
void Sg_File_Info::set_col | ( | int | n) |
void Sg_File_Info::display | ( | const std::string | label) | const |
Referenced by SageInterface::getEnclosingNode().
void Sg_File_Info::display | ( | ) | const |
std::string Sg_File_Info::displayString | ( | const std::string & | label = "" ) | const |
|
static |
Sg_File_Info::get_filename | ( | ) | const |
Returns filename of source code associated with IR node.
The filename returned is manipulated under some contitions:
For debugging purposes it is an error to ask for the filename from any IR node for which hasPositionInSource() == false.
Referenced by ssa_private::FunctionFilter::operator()().
const std::string& Sg_File_Info::get_filenameString | ( | ) | const |
Referenced by AttributeListMap::defined_macro(), and yicesCheck().
Sg_File_Info::get_line | ( | ) | const |
Returns the line number of the associated code for this IR node.
Sg_File_Info::get_col | ( | ) | const |
Returns the column number of the associated code for this IR node.
void Sg_File_Info::set_file_id | ( | int | file_id) |
int Sg_File_Info::get_file_id | ( | ) | const |
Sg_File_Info::get_raw_filename | ( | ) | const |
Returns filename of source code associated with IR node.
The filename is not manipulated! The value of p_filename is returned whatever the IR node classification.
This is useful for debugging.
Sg_File_Info::get_raw_line | ( | ) | const |
Returns the line number of the associated code for this IR node.
Sg_File_Info::get_raw_col | ( | ) | const |
Returns the column number of the associated code for this IR node.
void Sg_File_Info::set_physical_filename | ( | const std::string & | filename) |
std::string Sg_File_Info::get_physical_filename | ( | ) | const |
void Sg_File_Info::set_physical_file_id | ( | int | physical_file_id) |
int Sg_File_Info::get_physical_file_id | ( | ) | const |
void Sg_File_Info::set_physical_line | ( | int | line) |
int Sg_File_Info::get_physical_line | ( | ) | const |
void Sg_File_Info::set_physical_source_position_to_match_logical_source_position | ( | ) |
void Sg_File_Info::set_source_sequence_number | ( | unsigned int | n) |
unsigned int Sg_File_Info::get_source_sequence_number | ( | ) | const |
void Sg_File_Info::updateSourcePosition | ( | Sg_File_Info * | update) |
Sg_File_Info::hasPositionInSource | ( | ) | const |
No earthly idea what this function does!
Abstracts query as to if an IR node maps back to the source code (evolving set of reasons whey this can be false).
There are several reasons why an IR node might NOT have a mapping back to the source code:
This is an evolving set of reasons, so abstracting it as a member function is helpful.
bool Sg_File_Info::isSameFile | ( | SgFile * | file) | const |
bool Sg_File_Info::isSameFile | ( | Sg_File_Info * | fileInfo) | const |
bool Sg_File_Info::isSameFile | ( | const Sg_File_Info & | fileInfo) | const |
Sg_File_Info::isTransformation | ( | ) | const |
Access function for classification bit field.
Returns true only if part of a transformation.
Sg_File_Info::isCompilerGenerated | ( | ) | const |
Returns true only if compiler generated (either by the front-end or by ROSE).
We do not presently distinguish between compiler generated code from EDG or by ROSE. For example template instatiations are not marked as compiler generated by EDG, but if ROSE generates specializations from instatioated templates then they are marked by ROSE as being compiler generated.
Referenced by CGFunction::iterator::getTarget(), ssa_unfiltered_cfg::FunctionFilter::operator()(), and ssa_private::FunctionFilter::operator()().
Sg_File_Info::isCompilerGeneratedNodeToBeUnparsed | ( | ) | const |
Returns true only if compiler generated and required to be unparsed in generated code.
Templates instatiated by ROSE are marked as compiler generated, but only those instatiated templates that are used in the source file are required and so only those must be unparsed in the generated code.
Sg_File_Info::isOutputInCodeGeneration | ( | ) | const |
Returns true only if required to be unparsed in generated code.
Templates instatiated by ROSE are marked as compiler generated, but only those instatiated templates that are used in the source file are required and so only those must be unparsed in the generated code. Note that currently all transformed IR nodes are implicitly considered to be marked as outputInCodeGeneration, but this will be made an explicit requirement in the future.
Sg_File_Info::isShared | ( | ) | const |
Returns true only if shared internally (either by the front-end or by ROSE).
This is a new classification supporting the AST merge mechanism. Currently numerous types of IR nodes that are shared (SgType, SgSymbol, many non-defining declarations, etc.) are not explicitly marked as shared. This may be correct in a future release (requires more thought).
bool Sg_File_Info::isFrontendSpecific | ( | ) | const |
bool Sg_File_Info::isSourcePositionUnavailableInFrontend | ( | ) | const |
void Sg_File_Info::unsetSourcePositionUnavailableInFrontend | ( | ) |
void Sg_File_Info::setSourcePositionUnavailableInFrontend | ( | ) |
bool Sg_File_Info::isCommentOrDirective | ( | ) | const |
void Sg_File_Info::unsetCommentOrDirective | ( | ) |
void Sg_File_Info::setCommentOrDirective | ( | ) |
bool Sg_File_Info::isToken | ( | ) | const |
void Sg_File_Info::unsetToken | ( | ) |
void Sg_File_Info::setToken | ( | ) |
bool Sg_File_Info::isDefaultArgument | ( | ) | const |
void Sg_File_Info::unsetDefaultArgument | ( | ) |
void Sg_File_Info::setDefaultArgument | ( | ) |
bool Sg_File_Info::isImplicitCast | ( | ) | const |
void Sg_File_Info::unsetImplicitCast | ( | ) |
void Sg_File_Info::setImplicitCast | ( | ) |
Sg_File_Info::unsetTransformation | ( | ) |
Set/unset functions for classification bit field.
If the IR node is a transformation it marks it false (zeros transformation marker bit internally).
Sg_File_Info::setTransformation | ( | ) |
Marks an IR node to be a transformation if it is not one already.
Sg_File_Info::unsetCompilerGeneratedNodeToBeUnparsed | ( | ) |
Mark as compiler generated but as required to be output by unparser (e.g. required template instatiations)
Unmarks IR node as compiler generated but required in the generated source (e.g. requied templates).
Sg_File_Info::setCompilerGeneratedNodeToBeUnparsed | ( | ) |
Marks IR node as compiler generated but required in the generated source (e.g. requied templates).
Sg_File_Info::unsetOutputInCodeGeneration | ( | ) |
Mark as to be output by the unparser (code generator)
Unmarks IR node as compiler generated but required in the generated source (e.g. requied templates).
Sg_File_Info::setOutputInCodeGeneration | ( | ) |
Marks IR node as compiler generated but required in the generated source (e.g. requied templates).
Sg_File_Info::unsetShared | ( | ) |
Support for shared IR nodes (shared via AST merge mechanism)
Unmarks IR node as shared.
Sg_File_Info::setShared | ( | ) |
Marks IR node as shared.
void Sg_File_Info::unsetFrontendSpecific | ( | ) |
void Sg_File_Info::setFrontendSpecific | ( | ) |
void Sg_File_Info::addFileToUnparse | ( | int | file_id) |
Add files to the set that should be able to unparse the node.
bool Sg_File_Info::shouldUnparse | ( | int | file_id) |
Should this node be unparsed by this file?
Sg_File_Info::unsetCompilerGenerated | ( | ) |
Unmarks IR node as compiler generated.
Sg_File_Info::setCompilerGenerated | ( | ) |
Marks IR node as compiler generated.
|
static |
Static function to return new Sg_File_Info object set to default values.
|
static |
Static function to return new Sg_File_Info object set to default values appropriate for transformations.
This function calls setOutputInCodeGeneration() and sets the file_id to be TRANSFORMATION_FILE_ID.
|
static |
Static function to return new Sg_File_Info object set to default values appropriate for transformations that are not in the source file.
Static function which allows specification of transformation with assignement to a specific file (where it would be unparsed). This function will call setOutputInCodeGeneration() and sets the file_id to a non-negative value. This function is useful when transformation to a program happen within a header file (e.g. including a header file as part of a transformation). Setting the file_id to the current source file should have the same result (semantics) as Sg_File_Info::generateDefaultFileInfoForTransformationNode().
|
static |
|
static |
Static function to return new Sg_File_Info object set to default values appropriate for compiler generated code.
unsigned int Sg_File_Info::get_classificationBitField | ( | void | ) | const |
Get whole bit field fr modifier set.
void Sg_File_Info::set_classificationBitField | ( | unsigned | int) |
Sg_File_Info::set_isPartOfTransformation | ( | bool | isPartOfTransformation) |
This function marks an IR nodes as being part of a transformation, this function is deprecated.
Sg_File_Info::get_isPartOfTransformation | ( | ) |
This function indicates of the IR nodes is part of a transformation.
void Sg_File_Info::register_node | ( | SgLocatedNode * | node) |
void Sg_File_Info::deregister_node | ( | SgLocatedNode * | node) |
bool Sg_File_Info::ok | ( | ) | const |
Checks internal consistancy of data.
This function verifies: -# filename pointer is valid -# if not compiler generaated then line number > 0 Defined to be used in tests: ROSE_ASSERT(statement->get_file_info()->ok());
|
static |
|
static |
Sg_File_Info& Sg_File_Info::operator= | ( | const Sg_File_Info & | X) |
|
static |
Access function for static datamember fileidtoname_map.
|
static |
Access function for map of file names.
|
static |
Access function for static datamember nametofileid_map.
|
static |
Access function for map of file names.
|
virtual |
Copies AST (whole subtree, depending on the SgCopyHelp class.
returns a string representing the class name
Reimplemented from SgSupport.
|
virtual |
returns new style SageIII enum values
Reimplemented from SgSupport.
void* Sg_File_Info::operator new | ( | size_t | size) |
returns pointer to newly allocated IR node
void Sg_File_Info::operator delete | ( | void * | pointer, |
size_t | size | ||
) |
deallocated memory for IR node (returns memory to memory pool for reuse)
void Sg_File_Info::operator delete | ( | void * | pointer) |
|
static |
Returns the total number of IR nodes of this type.
|
static |
Returns the size in bytes of the total memory allocated for all IR nodes of this type.
|
virtual |
FOR INTERNAL USE within ROSE traverals mechanism only.
This function builds and returns a copy of ordered container holding pointers to children of this node in a traversal. It is associated with the definition of a tree that is travered by the AST traversal mechanism; a tree that is embeded in the AST (which is a more general graph). This function is used within the implementation of the AST traversal and has a semantics may change in subtle ways that makes it difficult to use in user code. It can return unexpected data members and thus the order and the number of elements is unpredicable and subject to change.
Reimplemented from SgSupport.
|
virtual |
FOR INTERNAL USE within ROSE traverals mechanism only.
This function builds and returns a copy of ordered container holding strings used to name data members that are traversed in the IR node. It is associated with the definition of a tree that is travered by the AST traversal mechanism; a tree that is embeded in the AST (which is a more general graph). This function is used within the implementation of the AST traversal and has a semantics may change in subtle ways that makes it difficult to use in user code. It can return unexpected data members and thus the order and the number of elements is unpredicable and subject to change.
Each string is a name of a member variable holding a pointer to a child in the AST. The names are the same as used in the generated enums for accessing attributes in a traversal. The order is the same in which they are traversed and the same in which the access enums are defined. Therefore this method can be used to get the corresponding name (string) of an access enum which allows to produce more meaningful messages for attribute computations.
Reimplemented from SgSupport.
|
virtual |
Reimplemented from SgSupport.
|
virtual |
Reimplemented from SgSupport.
|
virtual |
FOR INTERNAL USE Access to Runtime Type Information (RTI) for this IR nodes.
This function provides runtime type information for accessing the
structure of the current node. It is useful for generating code which would dump out or rebuild IR nodes.
Reimplemented from SgSupport.
|
virtual |
returns a C style string (char*) representing the class name
Reimplemented from SgSupport.
void Sg_File_Info::executeVisitorMemberFunction | ( | ROSE_VisitorPattern & | visitor) |
FOR INTERNAL USE Support for visitor pattern.
|
virtual |
DXN (08/09/2010): support for the classic visitor pattern done in GoF.
Reimplemented from SgSupport.
|
static |
FOR INTERNAL USE Support for visitor pattern.
|
static |
FOR INTERNAL USE Support for visitor pattern.
|
static |
FOR INTERNAL USE Support for type-based traversal.
|
virtual |
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the heap.
The AST File I/O depends upon the allocation of IR nodes being from the heap, stack based or global IR nodes should not appear in the AST if it will be written out to a file and read back in. To enforce this concept, this function implements a test to verify that the IR node can be found on the heap and is part of a larger test of the whole AST. This test must pass before the AST can be written out to a file. This is part of a compromise in the design of the AST File I/O to support binary streaming of data to files; for performance. It is also rather difficult, but possible, to build a useful AST with IR nodes allocated on the stack or frm global scope, this test filters out such cased from being used with the AST File I/O mechanism.
Reimplemented from SgSupport.
|
virtual |
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the heap.
The AST File I/O depends upon the allocation of IR nodes being from the heap, stack based or global IR nodes should not appear in the AST if it will be written out to a file and read back in. To enforce this concept, this function implements a test to verify that the IR node can be found on the heap and is part of a larger test of the whole AST. This test must pass before the AST can be written out to a file. This is part of a compromise in the design of the AST File I/O to support binary streaming of data to files; for performance. It is also rather difficult, but possible, to build a useful AST with IR nodes allocated on the stack or frm global scope, this test filters out such cased from being used with the AST File I/O mechanism.
Reimplemented from SgSupport.
|
virtual |
FOR INTERNAL USE Returns STL vector of pairs of SgNode* and strings for use in AST tools
This functions is part of general support for many possible tools to operate on the AST. The forms a list of ALL IR node pointers used by each IR node, and is a supperset of the get_traversalSuccessorContainer(). It is (I think) less than the set of pointers used by the AST file I/O. This is part of work implemented by Andreas, and support tools such as the AST graph generation.
Reimplemented from SgSupport.
|
virtual |
FOR INTERNAL USE Processes pairs of references to SgNode* and strings for use in AST tools
This functions similar to returnDataMemberPointers() except that it passes references to a handler object. As a result there is FAR more damage that can be done by using this function, but it is type-safe. This is provided for support of internal tools that operate on the AST, e.g the AST Merge mechanism.
Reimplemented from SgSupport.
|
virtual |
FOR INTERNAL USE Returns a unique index value for the childNode in the list of children at this IR node.
This function returns a unique value for the input childNode in set of children at this IR node. Note that a negative value indicates that the input node is not a child. This is the basis for the implementation of the isChild(SgNode*) member function. Data members that are NULL in the IR node are counted internally (so that this function returns value that could be statically defined, and so are not dynamically determined).
Reimplemented from SgSupport.
Sg_File_Info* Sg_File_Info::addRegExpAttribute | ( | std::string | s, |
AstRegExAttribute * | a | ||
) |
Support for AST matching using regular expression.
This support is incomplete and the subject of current research to define RegEx trees to support inexact matching.
SgFileIdList Sg_File_Info::get_fileIDsToUnparse | ( | ) | const |
void Sg_File_Info::set_fileIDsToUnparse | ( | SgFileIdList | fileIDsToUnparse) |
|
friend |
Definition at line 20657 of file Cxx_Grammar.h.
|
friend |
Definition at line 20658 of file Cxx_Grammar.h.
|
friend |
Definition at line 20659 of file Cxx_Grammar.h.
|
friend |
Definition at line 20660 of file Cxx_Grammar.h.
|
friend |
This relational operator tests two Sg_File_Info objects for equal position information.
|
friend |
This relational operator tests two Sg_File_Info objects for unequal position information.
|
friend |
This relational operator tests two Sg_File_Info objects for X being after Y in the same file.
|
friend |
This relational operator tests two Sg_File_Info objects for X being before Y in the same file.
|
friend |
This relational operator tests two Sg_File_Info objects for X being at the same position or after Y in the same file.
|
friend |
This relational operator tests two Sg_File_Info objects for X being at the same position or before Y in the same file.
|
friend |
Casts pointer from base class to derived class.
Cast function (from derived class to Sg_File_Info pointer).
This functions returns a Sg_File_Info pointer for any input of a pointer to an object derived from a Sg_File_Info.
|
friend |
Casts pointer from base class to derived class (for const pointers)
Cast function (from derived class to Sg_File_Info pointer).
This functions returns a Sg_File_Info pointer for any input of a pointer to an object derived from a Sg_File_Info.
|
friend |
Constructor for use by AST File I/O Mechanism.
This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory which obtained via fast binary file I/O from disk.
Typedef used for low level memory access.
Typedef used to hold memory addresses as values.
Methods to find the pointer to a global and local index
|
friend |
Get the size of the memory pool.
It actually returns the size of the whole blocks allocated, no matter they contain valid pointers or not.
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
This is a key that maps integers to file names, it prevents redundent storage of filename strings.
This is part of a mechanism to reduce the memory requirements of the IR (to support whole program analysis in ROSE). The values are keys to an STL map which relates file ids to file name strings, allowing a more compressed representation of the filename data in the Sg_File_Info object. There are two maps, one for finding the filename string from a file id integer (p_fileidtoname_map), and another for the reverse map (p_nametofileid_map).
We will in the future limit the range of this value (expect a signed short int: 16 bits, 32K = 32768 files plus negative values for special cases).
Definition at line 20722 of file Cxx_Grammar.h.
|
protected |
This is the line number of the location of the source code for this IR node.
This information is useful in the heuristics of attaching comments to IR nodes (SgStatement and SgExpression IR nodes).
The value of this variable is always greater than or equal to zero. In the case of isCompilerGenerated() == true or isTransformation() == true then value is INT_MAX-1. This value if define for this case so that all comments will be attached before the associated statement.
We will in the future limit the range of this value (expect a short int: 20 bits, 1000K = 1,048,576 lines per file).
Definition at line 20726 of file Cxx_Grammar.h.
|
protected |
This is the column number of the location of the source code for this IR node.
This information is useful in the heuristics of attaching comments to IR nodes (SgStatement and SgExpression IR nodes).
The value of this variable is always greater than or equal to zero. If IR node is compiler generated for a transformation then value is set to INT_MAX-1.
We will in the future limit the range of this value (expect a short int: 16 bits, 64K = 65536 charaters per line).
Definition at line 20730 of file Cxx_Grammar.h.
|
protected |
This is mechanism for classification of the IR node.
IR nodes use this mechanism to classify themselves as either part of a transformation or compiler generated (other enum values of Sg_File_Info::classifier are not used).
We will in the future limit the range of this value (expect an unsigned char: 8 bits, 64K = 65536 charaters per line).
Definition at line 20734 of file Cxx_Grammar.h.
|
protected |
Definition at line 20738 of file Cxx_Grammar.h.
|
protected |
Definition at line 20742 of file Cxx_Grammar.h.
|
protected |
Definition at line 20746 of file Cxx_Grammar.h.
|
protected |
This set contains a list of all file ids for which the accompanying IR node should be unparsed.
This is part of the AST Merge mechanism.
This set contains a list of file ids. During unparsing, if we encounter a node with this Sg_File_Info object, we only want to unparse this file if the file we are currently unparsing is in this list.
NOTE: This set should be empty unless the node is marked as shared
Definition at line 20750 of file Cxx_Grammar.h.
|
staticprotected |
This is a static STL map of file id (integers) to file names (strings).
Definition at line 20754 of file Cxx_Grammar.h.
|
staticprotected |
This is a static STL map of file names (strings) to file id (integers).
Definition at line 20758 of file Cxx_Grammar.h.