ROSE 0.11.145.147
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Sg_File_Info Class Reference

Description

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.

Definition at line 28926 of file Cxx_Grammar.h.

Inheritance diagram for Sg_File_Info:
Inheritance graph
[legend]
Collaboration diagram for Sg_File_Info:
Collaboration graph
[legend]

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...
 
enum  { static_variant = V_SgNode }
 static variant value More...
 

Public Member Functions

virtual SgNodecopy (SgCopyHelp &help) const override
 
 Sg_File_Info ()
 This is the less useful default constructor.
 
 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).
 
 Sg_File_Info (int file_id, int line, int column)
 
void post_construction_initialization () override
 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.
 
void check_file_id (const char *label, bool assertion=true) const
 
void set_filename (const char *filename)
 This function sets the filename of the construct's association with source code.
 
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.
 
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
 Returns filename of source code associated with IR node.
 
const std::string & get_filenameString () const
 
int get_line () const
 Returns the line number of the associated code for this IR node.
 
int get_col () const
 Returns the column number of the associated code for this IR node.
 
int get_line (int file_id) const
 Where this is a shared IR node across multiple files, return the line number location of the IR node for a specific file.
 
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.
 
int get_raw_line () const
 Returns the line number of the associated code for this IR node.
 
int get_raw_col () const
 Returns the column number of the associated code for this IR node.
 
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 ()
 
int * get_physical_file_id_reference ()
 
int get_physical_line (int file_id) const
 Where this is a shared IR node across multiple files, return the line number location of the IR node for a specific file.
 
int get_physical_file_id (int file_id) const
 
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!
 
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.
 
bool isCompilerGenerated () const
 Returns true only if compiler generated (either by the front-end or by ROSE).
 
bool isCompilerGeneratedNodeToBeUnparsed () const
 Returns true only if compiler generated and required to be unparsed in generated code.
 
bool isOutputInCodeGeneration () const
 Returns true only if required to be unparsed in generated code.
 
bool isShared () const
 Returns true only if shared internally (either by the front-end or by ROSE).
 
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.
 
void setTransformation ()
 Marks an IR node to be a transformation if it is not one already.
 
void unsetCompilerGeneratedNodeToBeUnparsed ()
 Mark as compiler generated but as required to be output by unparser (e.g. required template instatiations)
 
void setCompilerGeneratedNodeToBeUnparsed ()
 Marks IR node as compiler generated but required in the generated source (e.g. requied templates).
 
void unsetOutputInCodeGeneration ()
 Mark as to be output by the unparser (code generator)
 
void setOutputInCodeGeneration ()
 Marks IR node as compiler generated but required in the generated source (e.g. requied templates).
 
void unsetShared ()
 Support for shared IR nodes (shared via AST merge mechanism)
 
void setShared ()
 Marks IR node as shared.
 
void unsetFrontendSpecific ()
 
void setFrontendSpecific ()
 
void addFileToUnparse (int file_id)
 Add files to the set that should be able to unparse the node.
 
bool shouldUnparse (int file_id)
 Should this node be unparsed by this file?
 
void unsetCompilerGenerated ()
 Unmarks IR node as compiler generated.
 
void setCompilerGenerated ()
 Marks IR node as compiler generated.
 
unsigned int get_classificationBitField (void) const
 Get whole bit field fr modifier set.
 
void set_classificationBitField (unsigned int)
 
void set_isPartOfTransformation (bool isPartOfTransformation)
 This function marks an IR nodes as being part of a transformation, this function is deprecated.
 
bool get_isPartOfTransformation ()
 This function indicates of the IR nodes is part of a transformation.
 
void register_node (SgLocatedNode *node)
 
void deregister_node (SgLocatedNode *node)
 
bool ok () const
 Checks internal consistancy of data.
 
Sg_File_Infooperator= (const Sg_File_Info &X)
 
virtual std::string class_name () const override
 returns a string representing the class name
 
virtual VariantT variantT () const override
 returns new style SageIII enum values
 
void * operator new (size_t size)
 returns pointer to newly allocated IR node
 
void operator delete (void *pointer, size_t size)
 deallocated memory for IR node (returns memory to memory pool for reuse)
 
void operator delete (void *pointer)
 
virtual std::vector< SgNode * > get_traversalSuccessorContainer () override
 container of pointers to AST successor nodes used in the traversal overridden in every class by generated implementation
 
virtual std::vector< std::string > get_traversalSuccessorNamesContainer () override
 container of names of variables or container indices used used in the traversal to access AST successor nodes overridden in every class by generated implementation
 
virtual size_t get_numberOfTraversalSuccessors () override
 return number of children in the traversal successor list
 
virtual SgNodeget_traversalSuccessorByIndex (size_t idx) override
 index-based access to traversal successors by index number
 
virtual size_t get_childIndex (SgNode *child) override
 index-based access to traversal successors by child node
 
virtual RTIReturnType roseRTI () override
 return C++ Runtime-Time-Information
 
virtual const char * sage_class_name () const override
 
void executeVisitorMemberFunction (ROSE_VisitorPattern &visitor)
 FOR INTERNAL USE Support for visitor pattern.
 
virtual void accept (ROSE_VisitorPattern &visitor) override
 support for the classic visitor pattern done in GoF
 
virtual bool isInMemoryPool () override
 FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the heap.
 
virtual void checkDataMemberPointersIfInMemoryPool () override
 FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the heap.
 
virtual std::vector< std::pair< SgNode *, std::string > > returnDataMemberPointers () const override
 FOR INTERNAL USE Returns STL vector of pairs of SgNode* and strings for use in AST tools
 
virtual void processDataMemberReferenceToPointers (ReferenceToPointerHandler *) override
 FOR INTERNAL USE Processes pairs of references to SgNode* and strings for use in AST tools
 
virtual long getChildIndex (SgNode *childNode) const override
 FOR INTERNAL USE Returns a unique index value for the childNode in the list of children at this IR node.
 
 Sg_File_Info (const Sg_File_InfoStorageClass &source)
 IR node constructor to support AST File I/O.
 
Sg_File_InfoaddRegExpAttribute (std::string s, AstRegExAttribute *a)
 Support for AST matching using regular expression.
 
const SgFileIdList & get_fileIDsToUnparse () const
 
SgFileIdList & get_fileIDsToUnparse ()
 
const SgFileLineNumberList & get_fileLineNumbersToUnparse () const
 
SgFileLineNumberList & get_fileLineNumbersToUnparse ()
 
virtual ~Sg_File_Info ()
 This is the destructor.
 
- Public Member Functions inherited from SgSupport
void * operator new (size_t size)
 returns pointer to newly allocated IR node
 
void operator delete (void *pointer, size_t size)
 deallocated memory for IR node (returns memory to memory pool for reuse)
 
void operator delete (void *pointer)
 
void executeVisitorMemberFunction (ROSE_VisitorPattern &visitor)
 FOR INTERNAL USE Support for visitor pattern.
 
 SgSupport (const SgSupportStorageClass &source)
 IR node constructor to support AST File I/O.
 
SgSupportaddRegExpAttribute (std::string s, AstRegExAttribute *a)
 Support for AST matching using regular expression.
 
virtual ~SgSupport ()
 This is the destructor.
 
 SgSupport ()
 This is the constructor.
 
- Public Member Functions inherited from SgNode
void * operator new (size_t size)
 returns pointer to newly allocated IR node
 
void operator delete (void *pointer, size_t size)
 deallocated memory for IR node (returns memory to memory pool for reuse)
 
void operator delete (void *pointer)
 
void executeVisitorMemberFunction (ROSE_VisitorPattern &visitor)
 FOR INTERNAL USE Support for visitor pattern.
 
 SgNode (const SgNodeStorageClass &source)
 IR node constructor to support AST File I/O.
 
SgNodeaddRegExpAttribute (std::string s, AstRegExAttribute *a)
 Support for AST matching using regular expression.
 
void set_isModified (bool isModified)
 All nodes in the AST contain a isModified flag used to track changes to the AST.
 
void set_containsTransformation (bool containsTransformation)
 Many nodes can hide other AST nodes and we need to track when outer nodes contain modified nodes even if they are not themselves modified.
 
bool get_isModified () const
 Acess function for isModified flag.
 
bool get_containsTransformation () const
 Acess function for containsTransformation flag.
 
SgNodeget_raw_parent () const
 Access function for direct access to uncomputed value of parent node.
 
bool isChild (SgNode *node) const
 Query function for if the input IR nodes is a child of the current IR node.
 
virtual std::string unparseToString (SgUnparse_Info *info) const
 This function unparses the AST node (excluding comments and unnecessary white space)
 
std::string unparseToString () const
 
int variant () const
 Older version function returns enum value "NODE".
 
virtual void addNewAttribute (std::string s, AstAttribute *a)
 Add a new attribute represented by the named string.
 
virtual AstAttributegetAttribute (std::string s) const
 Returns attribute of name 's'.
 
virtual void updateAttribute (std::string s, AstAttribute *a)
 Replace existing attribute of name 's' with new AstAttribute.
 
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.
 
virtual void removeAttribute (std::string s)
 Remove attribute of name 's' if present.
 
virtual bool attributeExists (std::string s) const
 Tests if attribute of name 's' is present.
 
virtual int numberOfAttributes () const
 Returns the number of attributes on this IR node.
 
virtual AstAttributeMechanismget_attributeMechanism () const
 FOR INTERNAL USE Access function; if an attribute exists then a pointer to it is returned, else error.
 
virtual void set_attributeMechanism (AstAttributeMechanism *a)
 FOR INTERNAL USE Access function; sets poiner to value AstAttributeMechanism.
 
virtual void fixupCopy_scopes (SgNode *copy, SgCopyHelp &help) const
 
virtual void fixupCopy_symbols (SgNode *copy, SgCopyHelp &help) const
 
virtual void fixupCopy_references (SgNode *copy, SgCopyHelp &help) const
 
virtual Sg_File_Infoget_file_info (void) const
 File information containing filename, line number, column number, and if the SgNode is a part of a new transformation, etc.
 
virtual Sg_File_Infoget_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).
 
virtual Sg_File_Infoget_endOfConstruct (void) const
 New function interface for Sg_File_Info data stores ending location of contruct (typically the closing brace).
 
VirtualCFG::CFGNode cfgForBeginning ()
 Returns the CFG node for just before this AST node.
 
VirtualCFG::CFGNode cfgForEnd ()
 Returns the CFG node for just after this AST node.
 
virtual unsigned int cfgIndexForEnd () const
 Determine the CFG index for the end of this construct.
 
virtual bool cfgIsIndexInteresting (unsigned int index) const
 Determine whether a particular CFG node index is "interesting" for this kind of node.
 
virtual unsigned int cfgFindChildIndex (SgNode *n)
 Find the index of n in this node's CFG children.
 
virtual unsigned int cfgFindNextChildIndex (SgNode *n)
 Find the index just after n in this node's CFG children.
 
virtual std::vector< VirtualCFG::CFGEdgecfgOutEdges (unsigned int index=false)
 Find the out edges of a CFG node – internal version.
 
virtual std::vector< VirtualCFG::CFGEdgecfgInEdges (unsigned int index=false)
 Find the in edges of a CFG node – internal version.
 
int numberOfNodesInSubtree ()
 Computes the number of nodes in the defined subtree of the AST.
 
int depthOfSubtree ()
 Computes the depth of the current defined subtree of the AST.
 
template<class T >
T * initParentPointer (T *child, SgNode *parent)
 Generated for tree edge data member initializations.
 
SgNodeget_freepointer () const
 
void set_freepointer (SgNode *freepointer)
 
virtual ~SgNode ()
 This is the destructor.
 
 SgNode ()
 This is the constructor.
 
void * operator new (size_t size)
 returns pointer to newly allocated IR node
 
void operator delete (void *pointer, size_t size)
 deallocated memory for IR node (returns memory to memory pool for reuse)
 
void operator delete (void *pointer)
 
void executeVisitorMemberFunction (ROSE_VisitorPattern &visitor)
 FOR INTERNAL USE Support for visitor pattern.
 
 SgNode (const SgNodeStorageClass &source)
 IR node constructor to support AST File I/O.
 
SgNodeaddRegExpAttribute (std::string s, AstRegExAttribute *a)
 Support for AST matching using regular expression.
 
void set_isModified (bool isModified)
 All nodes in the AST contain a isModified flag used to track changes to the AST.
 
void set_containsTransformation (bool containsTransformation)
 Many nodes can hide other AST nodes and we need to track when outer nodes contain modified nodes even if they are not themselves modified.
 
bool get_isModified () const
 Acess function for isModified flag.
 
bool get_containsTransformation () const
 Acess function for containsTransformation flag.
 
void set_parent (SgNode *parent)
 All nodes in the AST contain a reference to a parent node.
 
SgNodeget_parent () const
 Access function for parent node.
 
SgNodeget_raw_parent () const
 Access function for direct access to uncomputed value of parent node.
 
bool isChild (SgNode *node) const
 Query function for if the input IR nodes is a child of the current IR node.
 
virtual std::string unparseToString (SgUnparse_Info *info) const
 This function unparses the AST node (excluding comments and unnecessary white space)
 
std::string unparseToString () const
 
std::string unparseToCompleteString ()
 This function unparses the AST node (including comments and white space)
 
int variant () const
 
bool get_isVisited () const
 DOCS IN HEADER: Access function for p_isVisited flag used previously by the AST traversals.
 
void set_isVisited (bool isVisited)
 Access function for p_isVisited flag used previously by the AST traversals.
 
virtual void addNewAttribute (std::string s, AstAttribute *a)
 Add a new attribute represented by the named string.
 
virtual AstAttributegetAttribute (std::string s) const
 Returns attribute of name 's'.
 
virtual void updateAttribute (std::string s, AstAttribute *a)
 Replace existing attribute of name 's' with new AstAttribute.
 
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.
 
virtual void removeAttribute (std::string s)
 Remove attribute of name 's' if present.
 
virtual bool attributeExists (std::string s) const
 Tests if attribute of name 's' is present.
 
virtual int numberOfAttributes () const
 Returns the number of attributes on this IR node.
 
virtual AstAttributeMechanismget_attributeMechanism () const
 FOR INTERNAL USE Access function; if an attribute exists then a pointer to it is returned, else error.
 
virtual void set_attributeMechanism (AstAttributeMechanism *a)
 FOR INTERNAL USE Access function; sets poiner to value AstAttributeMechanism.
 
virtual void fixupCopy_scopes (SgNode *copy, SgCopyHelp &help) const
 
virtual void fixupCopy_symbols (SgNode *copy, SgCopyHelp &help) const
 
virtual void fixupCopy_references (SgNode *copy, SgCopyHelp &help) const
 
virtual Sg_File_Infoget_file_info (void) const
 File information containing filename, line number, column number, and if the SgNode is a part of a new transformation, etc.
 
virtual Sg_File_Infoget_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).
 
virtual Sg_File_Infoget_endOfConstruct (void) const
 New function interface for Sg_File_Info data stores ending location of contruct (typically the closing brace).
 
VirtualCFG::CFGNode cfgForBeginning ()
 Returns the CFG node for just before this AST node.
 
VirtualCFG::CFGNode cfgForEnd ()
 Returns the CFG node for just after this AST node.
 
virtual unsigned int cfgIndexForEnd () const
 Determine the CFG index for the end of this construct.
 
virtual bool cfgIsIndexInteresting (unsigned int index) const
 Determine whether a particular CFG node index is "interesting" for this kind of node.
 
virtual unsigned int cfgFindChildIndex (SgNode *n)
 Find the index of n in this node's CFG children.
 
virtual unsigned int cfgFindNextChildIndex (SgNode *n)
 Find the index just after n in this node's CFG children.
 
virtual std::vector< VirtualCFG::CFGEdgecfgOutEdges (unsigned int index=false)
 Find the out edges of a CFG node – internal version.
 
virtual std::vector< VirtualCFG::CFGEdgecfgInEdges (unsigned int index=false)
 Find the in edges of a CFG node – internal version.
 
int numberOfNodesInSubtree ()
 Computes the number of nodes in the defined subtree of the AST.
 
int depthOfSubtree ()
 Computes the depth of the current defined subtree of the AST.
 
template<class T >
T * initParentPointer (T *child, SgNode *parent)
 Generated for tree edge data member initializations.
 
SgNodeget_freepointer () const
 
void set_freepointer (SgNode *freepointer)
 
void set_parent (SgNode *parent)
 All nodes in the AST contain a reference to a parent node.
 
SgNodeget_parent () const
 Access function for parent node.
 
std::string unparseToCompleteString ()
 This function unparses the AST node (including comments and white space)
 
bool get_isVisited () const
 DOCS IN HEADER: Access function for p_isVisited flag used previously by the AST traversals.
 
void set_isVisited (bool isVisited)
 Access function for p_isVisited flag used previously by the AST traversals.
 
template<class T >
std::enable_if< std::is_pointer< T >::value, void >::type changeChildPointer (T &edge, T const &child)
 Set a child edge in a tree to point to a specific child.
 
template<class T >
std::enable_if<!std::is_pointer< T >::value, void >::type changeChildPointer (T &edge, T const &child)
 Set a child edge in a tree to point to a specific child.
 
template<class T >
std::enable_if< std::is_pointer< T >::value, void >::type changeChildPointer (T &edge, T const &child)
 Set a child edge in a tree to point to a specific child.
 
template<class T >
std::enable_if<!std::is_pointer< T >::value, void >::type changeChildPointer (T &edge, T const &child)
 Set a child edge in a tree to point to a specific child.
 

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.
 
static int numberOfSourceFiles ()
 Returns the number of entries in the filename map.
 
static void display_static_data (const std::string label)
 
static Sg_File_InfogenerateDefaultFileInfo ()
 Static function to return new Sg_File_Info object set to default values.
 
static Sg_File_InfogenerateDefaultFileInfoForTransformationNode ()
 Static function to return new Sg_File_Info object set to default values appropriate for transformations.
 
static Sg_File_InfogenerateFileInfoForTransformationNode (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.
 
static Sg_File_InfogenerateFileInfoForTransformationNode (std::string filename)
 
static Sg_File_InfogenerateDefaultFileInfoForCompilerGeneratedNode ()
 Static function to return new Sg_File_Info object set to default values appropriate for compiler generated code.
 
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.
 
static void set_fileidtoname_map (std::map< int, std::string > &X)
 Access function for map of file names.
 
static std::map< std::string, int > & get_nametofileid_map ()
 Access function for static datamember nametofileid_map.
 
static void set_nametofileid_map (std::map< std::string, int > &X)
 Access function for map of file names.
 
static void deleteMemoryPool ()
 
static size_t numberOfNodes ()
 Returns the total number of IR nodes of this type.
 
static size_t memoryUsage ()
 Returns the size in bytes of the total memory allocated for all IR nodes of this type.
 
static void traverseMemoryPoolNodes (ROSE_VisitTraversal &visit)
 FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node.
 
static void traverseMemoryPoolVisitorPattern (ROSE_VisitorPattern &visitor)
 FOR INTERNAL USE Support for visitor pattern.
 
static void visitRepresentativeNode (ROSE_VisitTraversal &visit)
 FOR INTERNAL USE Support for type-based traversal.
 
static SgNodegetNodeByNodeId (VariantT variantT, size_t poolIdx, size_t itemIdx)
 Find a node by its variant type, pool index, and item index.
 
static Sg_File_InfogetNodeByNodeIdInternal (size_t poolIdx, size_t itemIdx)
 FOR INTERNAL USE Find an SgNode from its memory pool and location therin.
 
static std::string getNodeIdString (Sg_File_Info *sgnode)
 compute the NodeId for a particular SgNode*.
 
static std::string getNodeIdStringInternal (Sg_File_Info *sgnode)
 
- Static Public Member Functions inherited from SgSupport
static void deleteMemoryPool ()
 
static size_t numberOfNodes ()
 Returns the total number of IR nodes of this type.
 
static size_t memoryUsage ()
 Returns the size in bytes of the total memory allocated for all IR nodes of this type.
 
static void traverseMemoryPoolNodes (ROSE_VisitTraversal &visit)
 FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node.
 
static void traverseMemoryPoolVisitorPattern (ROSE_VisitorPattern &visitor)
 FOR INTERNAL USE Support for visitor pattern.
 
static void visitRepresentativeNode (ROSE_VisitTraversal &visit)
 FOR INTERNAL USE Support for type-based traversal.
 
static SgNodegetNodeByNodeId (VariantT variantT, size_t poolIdx, size_t itemIdx)
 Find a node by its variant type, pool index, and item index.
 
static SgSupportgetNodeByNodeIdInternal (size_t poolIdx, size_t itemIdx)
 FOR INTERNAL USE Find an SgNode from its memory pool and location therin.
 
static std::string getNodeIdString (SgSupport *sgnode)
 compute the NodeId for a particular SgNode*.
 
static std::string getNodeIdStringInternal (SgSupport *sgnode)
 
- Static Public Member Functions inherited from SgNode
static void deleteMemoryPool ()
 
static size_t numberOfNodes ()
 Returns the total number of IR nodes of this type.
 
static size_t memoryUsage ()
 Returns the size in bytes of the total memory allocated for all IR nodes of this type.
 
static void traverseMemoryPoolNodes (ROSE_VisitTraversal &visit)
 FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node.
 
static void traverseMemoryPoolVisitorPattern (ROSE_VisitorPattern &visitor)
 FOR INTERNAL USE Support for visitor pattern.
 
static void visitRepresentativeNode (ROSE_VisitTraversal &visit)
 FOR INTERNAL USE Support for type-based traversal.
 
static SgNodegetNodeByNodeId (VariantT variantT, size_t poolIdx, size_t itemIdx)
 Find a node by its variant type, pool index, and item index.
 
static SgNodegetNodeByNodeIdInternal (size_t poolIdx, size_t itemIdx)
 FOR INTERNAL USE Find an SgNode from its memory pool and location therin.
 
static std::string getNodeIdString (SgNode *sgnode)
 compute the NodeId for a particular SgNode*.
 
static std::string getNodeIdStringInternal (SgNode *sgnode)
 
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.
 
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.
 
static void clearGlobalMangledNameMap ()
 Support to clear the performance optimizing global mangled name map.
 
static std::map< std::string, uint64_t > & get_shortMangledNameCache ()
 Access function for lower level optimizing of global mangled name map.
 
static std::map< SgNode *, std::string > & get_globalQualifiedNameMapForNames ()
 Access function for name qualification support (for names).
 
static void set_globalQualifiedNameMapForNames (const std::map< SgNode *, std::string > &X)
 Access function for name qualification support (for names).
 
static std::map< SgNode *, std::string > & get_globalQualifiedNameMapForTypes ()
 Access function for name qualification support (for type).
 
static void set_globalQualifiedNameMapForTypes (const std::map< SgNode *, std::string > &X)
 Access function for name qualification support (for type).
 
static std::map< SgNode *, std::map< SgNode *, std::string > > & get_globalQualifiedNameMapForMapsOfTypes ()
 Access function for name qualification support (for maps of types).
 
static void set_globalQualifiedNameMapForMapsOfTypes (const std::map< SgNode *, std::map< SgNode *, std::string > > &X)
 Access function for name qualification support (for maps of types).
 
static std::map< SgNode *, std::string > & get_globalQualifiedNameMapForTemplateHeaders ()
 Access function for name qualification support (for template headers in template declarations).
 
static void set_globalQualifiedNameMapForTemplateHeaders (const std::map< SgNode *, std::string > &X)
 Access function for name qualification support (for template headers in template declarations).
 
static std::map< SgNode *, std::string > & get_globalTypeNameMap ()
 Access function for name qualification support (for names of types).
 
static void set_globalTypeNameMap (const std::map< SgNode *, std::string > &X)
 Access function for name qualification support (for names of types).
 
static SgFunctionTypeTableget_globalFunctionTypeTable ()
 Access function for symbol table specific to function types.
 
static void set_globalFunctionTypeTable (SgFunctionTypeTable *globalFunctionTypeTable)
 Access function for symbol table specific to function types.
 
static SgTypeTableget_globalTypeTable ()
 Access function for symbol table specific to non-function types.
 
static void set_globalTypeTable (SgTypeTable *globalTypeTable)
 Access function for symbol table specific to non-function types.
 
static VariantT variantFromPool (SgNode const *n)
 
template<class T >
static std::enable_if< std::is_base_of< SgNode, T >::value, T * >::type createAndParent (SgNode *parent)
 Allocate and return a new node after setting its parent.
 
static void deleteMemoryPool ()
 
static size_t numberOfNodes ()
 Returns the total number of IR nodes of this type.
 
static size_t memoryUsage ()
 Returns the size in bytes of the total memory allocated for all IR nodes of this type.
 
static void traverseMemoryPoolNodes (ROSE_VisitTraversal &visit)
 FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node.
 
static void traverseMemoryPoolVisitorPattern (ROSE_VisitorPattern &visitor)
 FOR INTERNAL USE Support for visitor pattern.
 
static void visitRepresentativeNode (ROSE_VisitTraversal &visit)
 FOR INTERNAL USE Support for type-based traversal.
 
static SgNodegetNodeByNodeId (VariantT variantT, size_t poolIdx, size_t itemIdx)
 Find a node by its variant type, pool index, and item index.
 
static SgNodegetNodeByNodeIdInternal (size_t poolIdx, size_t itemIdx)
 FOR INTERNAL USE Find an SgNode from its memory pool and location therin.
 
static std::string getNodeIdString (SgNode *sgnode)
 compute the NodeId for a particular SgNode*.
 
static std::string getNodeIdStringInternal (SgNode *sgnode)
 
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.
 
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.
 
static void clearGlobalMangledNameMap ()
 Support to clear the performance optimizing global mangled name map.
 
static std::map< std::string, uint64_t > & get_shortMangledNameCache ()
 Access function for lower level optimizing of global mangled name map.
 
static std::map< SgNode *, std::string > & get_globalQualifiedNameMapForNames ()
 Access function for name qualification support (for names).
 
static void set_globalQualifiedNameMapForNames (const std::map< SgNode *, std::string > &X)
 Access function for name qualification support (for names).
 
static std::map< SgNode *, std::string > & get_globalQualifiedNameMapForTypes ()
 Access function for name qualification support (for type).
 
static void set_globalQualifiedNameMapForTypes (const std::map< SgNode *, std::string > &X)
 Access function for name qualification support (for type).
 
static std::map< SgNode *, std::map< SgNode *, std::string > > & get_globalQualifiedNameMapForMapsOfTypes ()
 Access function for name qualification support (for maps of types).
 
static void set_globalQualifiedNameMapForMapsOfTypes (const std::map< SgNode *, std::map< SgNode *, std::string > > &X)
 Access function for name qualification support (for maps of types).
 
static std::map< SgNode *, std::string > & get_globalQualifiedNameMapForTemplateHeaders ()
 Access function for name qualification support (for template headers in template declarations).
 
static void set_globalQualifiedNameMapForTemplateHeaders (const std::map< SgNode *, std::string > &X)
 Access function for name qualification support (for template headers in template declarations).
 
static std::map< SgNode *, std::string > & get_globalTypeNameMap ()
 Access function for name qualification support (for names of types).
 
static void set_globalTypeNameMap (const std::map< SgNode *, std::string > &X)
 Access function for name qualification support (for names of types).
 
static SgFunctionTypeTableget_globalFunctionTypeTable ()
 Access function for symbol table specific to function types.
 
static void set_globalFunctionTypeTable (SgFunctionTypeTable *globalFunctionTypeTable)
 Access function for symbol table specific to function types.
 
static SgTypeTableget_globalTypeTable ()
 Access function for symbol table specific to non-function types.
 
static void set_globalTypeTable (SgTypeTable *globalTypeTable)
 Access function for symbol table specific to non-function types.
 
static VariantT variantFromPool (SgNode const *n)
 
template<class T >
static std::enable_if< std::is_base_of< SgNode, T >::value, T * >::type createAndParent (SgNode *parent)
 Allocate and return a new node after setting its parent.
 

Protected Attributes

int p_file_id
 This is a key that maps integers to file names, it prevents redundent storage of filename strings.
 
int p_line
 This is the line number of the location of the source code for this IR node.
 
int p_col
 This is the column number of the location of the source code for this IR node.
 
unsigned int p_classificationBitField
 This is mechanism for classification of the IR node.
 
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.
 
SgFileLineNumberList p_fileLineNumbersToUnparse
 
- Protected Attributes inherited from SgNode
SgNodep_parent
 This is the pointer to the parent IR node in the AST.
 
bool p_isModified
 Records if IR node has been modified (data members reset).
 
bool p_containsTransformation
 
SgNodep_freepointer
 This is the pointer to the chain of previously freed objects.
 

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).
 
static std::map< std::string, int > p_nametofileid_map
 This is a static STL map of file names (strings) to file id (integers).
 
- Static Protected Attributes inherited from SgNode
static std::vector< std::tuple< unsigned char *, unsigned, VariantT > > all_pools
 
static SgFunctionTypeTablep_globalFunctionTypeTable
 Pointer to symbol table specific to function types.
 
static SgTypeTablep_globalTypeTable
 
static std::map< SgNode *, std::string > p_globalMangledNameMap
 Cache of mangled names to avoid regeneration of previously build mangled names or parts of mangled names. This is a performance optimization.
 
static std::map< std::string, uint64_t > p_shortMangledNameCache
 STL map used as a cache to shorten generated mangled names. This is mostly a space optimization ofr mangled names of templates.
 
static std::map< SgNode *, std::string > p_globalQualifiedNameMapForNames
 
static std::map< SgNode *, std::string > p_globalQualifiedNameMapForTypes
 
static std::map< SgNode *, std::string > p_globalQualifiedNameMapForTemplateHeaders
 
static std::map< SgNode *, std::string > p_globalTypeNameMap
 
static std::map< SgNode *, std::map< SgNode *, std::string > > p_globalQualifiedNameMapForMapsOfTypes
 

Additional Inherited Members

- Protected Member Functions inherited from SgNode
virtual void destructorHelper ()
 This gets called by all Rosebud-generated destructors.
 
virtual void destructorHelper ()
 This gets called by all Rosebud-generated destructors.
 
virtual void debugSerializationBegin (const char *className)
 Called by generated serializers.
 
virtual void debugSerializationEnd (const char *className)
 Called by generated serializers.
 
virtual void debugSerializationBegin (const char *className)
 Called by generated serializers.
 
virtual void debugSerializationEnd (const char *className)
 Called by generated serializers.
 

Member Typedef Documentation

◆ base_node_type

Definition at line 29625 of file Cxx_Grammar.h.

Member Enumeration Documentation

◆ classifier

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).

  • Examples of transformation IR nodes include:
    1. Any relocated AST subtrees
    2. Any new IR nodes
  • Examples of compiler-generated IR nodes include:
    1. Any implicit or unnecessary casts not explicitly represented in the source code
    2. Instantiated templates
  • Examples of compiler-generated code marked for output (in code generation phase) include:
    1. Any transformed template instantiations
    2. required templates assigned to specific files (see ROSE prelinking details)
  • Examples of shared IR nodes include:
    1. All types (not implemented yet)
    2. All IR nodes shared across originally separate ASTs (see AST Merge Mechanism)
  • Examples of frontend specific IR nodes include:
    1. float __builtin_acosf (float __builtin__x);
    2. #define __builtin_va_start va_start
    3. All functions and variables defined in "rose_edg_required_macros_and_functions.h"
Enumerator
e_transformation 

classify as a transformation

e_compiler_generated 

classify as compiler generated

e_output_in_code_generation 

classify as required when generating code in unparser (orthogonal concept to transformation and compiler generated)

e_shared 

classify as a shared IR node (part of evolving support for AST merging)

e_frontend_specific 

classify as frontend specific (e.g. gnu compatable function from rose_edg_required_macros_and_functions.h)

e_source_position_unavailable_in_frontend 

classify as explictly unabailable from front-end

e_comment_or_directive 

classify as a comment or directive (not a part of the language grammar)

e_token 

classify as a token from the parser (not a part of the language grammar)

e_default_argument 

classify as a default arguement to function call expression

e_implicit_cast 

classify as a implicit cast

Definition at line 28963 of file Cxx_Grammar.h.

◆ p_fileflags

Enum to hold previously common default values for filename used by the default and static SgNULL_File constructors.

Enumerator
COPY_FILE_ID 

default value (equivalent to filename with "COPY")

NULL_FILE_ID 

value equivalent to filename with "NULL_FILE"

TRANSFORMATION_FILE_ID 

value for all nodes marked as part of a translation

COMPILER_GENERATED_FILE_ID 

value for compiler generated IR nodes (NOT marked for output)

COMPILER_GENERATED_MARKED_FOR_OUTPUT_FILE_ID 

value for compiler generated IR nodes (marked for output, deprecated value)

BAD_FILE_ID 

value returned if there is no file id mapped to given filename

Definition at line 29207 of file Cxx_Grammar.h.

◆ anonymous enum

anonymous enum

static variant value

Definition at line 29246 of file Cxx_Grammar.h.

Constructor & Destructor Documentation

◆ Sg_File_Info()

Sg_File_Info::Sg_File_Info ( )

This is the less useful default constructor.

This constructor builds the Sg_File_Info base class.

◆ ~Sg_File_Info()

Sg_File_Info::~Sg_File_Info ( )
virtual

This is the destructor.

There is nothing to delete in this object.

Member Function Documentation

◆ copy()

virtual SgNode * Sg_File_Info::copy ( SgCopyHelp help) const
overridevirtual

Reimplemented from SgSupport.

◆ post_construction_initialization()

void Sg_File_Info::post_construction_initialization ( )
overridevirtual

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.

◆ set_line()

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.

Returns
Returns an integer.

◆ get_filename()

Sg_File_Info::get_filename ( ) const

Returns filename of source code associated with IR node.

The filename returned is manipulated under some contitions:

◆ get_line()

Sg_File_Info::get_line ( ) const

Returns the line number of the associated code for this IR node.

Returns
Returns integer.

◆ get_col()

Sg_File_Info::get_col ( ) const

Returns the column number of the associated code for this IR node.

Returns
Returns integer

◆ get_raw_filename()

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.

◆ get_raw_line()

Sg_File_Info::get_raw_line ( ) const

Returns the line number of the associated code for this IR node.

Returns
Returns integer.

◆ get_raw_col()

Sg_File_Info::get_raw_col ( ) const

Returns the column number of the associated code for this IR node.

Returns
Returns

◆ hasPositionInSource()

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).

Returns
Returns bool.

There are several reasons why an IR node might NOT have a mapping back to the source code:

◆ isTransformation()

Sg_File_Info::isTransformation ( ) const

Access function for classification bit field.

Returns true only if part of a transformation.

Returns
Returns bool.

◆ unsetTransformation()

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).

Returns
Returns void.

◆ setTransformation()

Sg_File_Info::setTransformation ( )

Marks an IR node to be a transformation if it is not one already.

Returns
Returns void.

◆ unsetCompilerGeneratedNodeToBeUnparsed()

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).

Returns
Returns void.

◆ setCompilerGeneratedNodeToBeUnparsed()

Sg_File_Info::setCompilerGeneratedNodeToBeUnparsed ( )

Marks IR node as compiler generated but required in the generated source (e.g. requied templates).

Returns
Returns void.

◆ unsetOutputInCodeGeneration()

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).

Returns
Returns void.

◆ setOutputInCodeGeneration()

Sg_File_Info::setOutputInCodeGeneration ( )

Marks IR node as compiler generated but required in the generated source (e.g. requied templates).

Returns
Returns void.

◆ unsetShared()

Sg_File_Info::unsetShared ( )

Support for shared IR nodes (shared via AST merge mechanism)

Unmarks IR node as shared.

Returns
Returns void.

◆ setShared()

Sg_File_Info::setShared ( )

Marks IR node as shared.

Returns
Returns void.

◆ unsetCompilerGenerated()

Sg_File_Info::unsetCompilerGenerated ( )

Unmarks IR node as compiler generated.

Returns
Returns void.

◆ setCompilerGenerated()

Sg_File_Info::setCompilerGenerated ( )

Marks IR node as compiler generated.

Returns
Returns void.

◆ generateDefaultFileInfo()

Sg_File_Info::generateDefaultFileInfo ( )
static

Static function to return new Sg_File_Info object set to default values.

Returns
Returns pointer to Sg_File_Info.

◆ generateDefaultFileInfoForTransformationNode()

Sg_File_Info::generateDefaultFileInfoForTransformationNode ( )
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.

Returns
Returns pointer to Sg_File_Info.

◆ generateFileInfoForTransformationNode()

Sg_File_Info::generateFileInfoForTransformationNode ( int  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().

Returns
Returns pointer to Sg_File_Info.

◆ generateDefaultFileInfoForCompilerGeneratedNode()

Sg_File_Info::generateDefaultFileInfoForCompilerGeneratedNode ( )
static

Static function to return new Sg_File_Info object set to default values appropriate for compiler generated code.

Returns
Returns pointer to Sg_File_Info.

◆ set_isPartOfTransformation()

Sg_File_Info::set_isPartOfTransformation ( bool  isPartOfTransformation)

This function marks an IR nodes as being part of a transformation, this function is deprecated.

Returns
Returns void.

◆ get_isPartOfTransformation()

Sg_File_Info::get_isPartOfTransformation ( )

This function indicates of the IR nodes is part of a transformation.

Returns
Returns bool

◆ ok()

bool Sg_File_Info::ok ( ) const

Checks internal consistancy of data.

This function verifies:

  1. filename pointer is valid
  2. if not compiler generaated then line number > 0

Defined to be used in tests: ROSE_ASSERT(statement->get_file_info()->ok());

Returns
Returns bool.

◆ class_name()

virtual std::string Sg_File_Info::class_name ( ) const
overridevirtual

returns a string representing the class name

Reimplemented from SgSupport.

◆ variantT()

virtual VariantT Sg_File_Info::variantT ( ) const
overridevirtual

returns new style SageIII enum values

Reimplemented from SgSupport.

◆ operator delete()

void Sg_File_Info::operator delete ( void *  pointer)
inline

Definition at line 29301 of file Cxx_Grammar.h.

◆ get_traversalSuccessorContainer()

virtual std::vector< SgNode * > Sg_File_Info::get_traversalSuccessorContainer ( )
overridevirtual

container of pointers to AST successor nodes used in the traversal overridden in every class by generated implementation

Reimplemented from SgSupport.

◆ get_traversalSuccessorNamesContainer()

virtual std::vector< std::string > Sg_File_Info::get_traversalSuccessorNamesContainer ( )
overridevirtual

container of names of variables or container indices used used in the traversal to access AST successor nodes overridden in every class by generated implementation

Reimplemented from SgSupport.

◆ get_numberOfTraversalSuccessors()

virtual size_t Sg_File_Info::get_numberOfTraversalSuccessors ( )
overridevirtual

return number of children in the traversal successor list

Reimplemented from SgSupport.

◆ get_traversalSuccessorByIndex()

virtual SgNode * Sg_File_Info::get_traversalSuccessorByIndex ( size_t  idx)
overridevirtual

index-based access to traversal successors by index number

Reimplemented from SgSupport.

◆ get_childIndex()

virtual size_t Sg_File_Info::get_childIndex ( SgNode child)
overridevirtual

index-based access to traversal successors by child node

Reimplemented from SgSupport.

◆ roseRTI()

virtual RTIReturnType Sg_File_Info::roseRTI ( )
overridevirtual

return C++ Runtime-Time-Information

Reimplemented from SgSupport.

◆ sage_class_name()

virtual const char * Sg_File_Info::sage_class_name ( ) const
overridevirtual

returns a C style string (char*) representing the class name

Reimplemented from SgSupport.

◆ accept()

virtual void Sg_File_Info::accept ( ROSE_VisitorPattern visitor)
overridevirtual

support for the classic visitor pattern done in GoF

Reimplemented from SgSupport.

◆ isInMemoryPool()

virtual bool Sg_File_Info::isInMemoryPool ( )
overridevirtual

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.

◆ checkDataMemberPointersIfInMemoryPool()

virtual void Sg_File_Info::checkDataMemberPointersIfInMemoryPool ( )
overridevirtual

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.

◆ returnDataMemberPointers()

virtual std::vector< std::pair< SgNode *, std::string > > Sg_File_Info::returnDataMemberPointers ( ) const
overridevirtual

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.

Warning
This function can return unexpected data members and thus the order and the number of elements is unpredicable and subject to change.
Returns
STL vector of pairs of SgNode* and strings

Reimplemented from SgSupport.

◆ processDataMemberReferenceToPointers()

virtual void Sg_File_Info::processDataMemberReferenceToPointers ( ReferenceToPointerHandler )
overridevirtual

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.

Warning
This function can return unexpected data members and thus the order and the number of elements is unpredicable and subject to change.

Reimplemented from SgSupport.

◆ getChildIndex()

virtual long Sg_File_Info::getChildIndex ( SgNode childNode) const
overridevirtual

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).

Warning
The mapping on children to integer values could change from release to release of ROSE.
Returns
long

Reimplemented from SgSupport.

◆ addRegExpAttribute()

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.

Member Data Documentation

◆ p_file_id

Sg_File_Info::p_file_id
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).

Definition at line 29653 of file Cxx_Grammar.h.

◆ p_line

Sg_File_Info::p_line
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.

Definition at line 29657 of file Cxx_Grammar.h.

◆ p_col

Sg_File_Info::p_col
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.

Definition at line 29661 of file Cxx_Grammar.h.

◆ p_classificationBitField

Sg_File_Info::p_classificationBitField
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).

Definition at line 29665 of file Cxx_Grammar.h.

◆ p_physical_file_id

int Sg_File_Info::p_physical_file_id
protected

Definition at line 29669 of file Cxx_Grammar.h.

◆ p_physical_line

int Sg_File_Info::p_physical_line
protected

Definition at line 29673 of file Cxx_Grammar.h.

◆ p_source_sequence_number

unsigned int Sg_File_Info::p_source_sequence_number
protected

Definition at line 29677 of file Cxx_Grammar.h.

◆ p_fileIDsToUnparse

Sg_File_Info::p_fileIDsToUnparse
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.

Definition at line 29681 of file Cxx_Grammar.h.

◆ p_fileLineNumbersToUnparse

SgFileLineNumberList Sg_File_Info::p_fileLineNumbersToUnparse
protected

Definition at line 29685 of file Cxx_Grammar.h.

◆ p_fileidtoname_map

std::map< int, std::string > Sg_File_Info::p_fileidtoname_map
staticprotected

This is a static STL map of file id (integers) to file names (strings).

Definition at line 29689 of file Cxx_Grammar.h.

◆ p_nametofileid_map

std::map< std::string, int > Sg_File_Info::p_nametofileid_map
staticprotected

This is a static STL map of file names (strings) to file id (integers).

Definition at line 29693 of file Cxx_Grammar.h.


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