Skip to content

SgCopyHelp

Supporting class from copy mechanism within ROSE.

Synopsis

Declared in <src/frontend/SageIII/Cxx_Grammar.h> (not stored in Git)

class SgCopyHelp;

Description

This class forms a base class for the SgShallowCopy and SgTreeCopy classes to support the control of copying of subtrees (what IR nodes are copied by a deep or shallow copy).

To tailor a specific type of copy operation derive a class from this abstract class and define the clone_node function as required. context information if required muyst be obtained through local analysis inside the function using the parent or scope information at each IR node.

Note

This is an abstract class.


Used in ROSETTA generated copy functions on each IR node.
             The location of this code should perhaps be changed to be in the
             generate copy code rather than Node.code in ROSETTA/Grammar.



Types

Name
ConstructionScope
FixupNodePairLess

Type Aliases

Name
copiedNodeMapType
copiedNodeMapTypeIterator
copiedPreprocessingMapType
copiedTypeReplacementMapType
copiedTypeReplacementSnapshot
fixupNodePairSetType
fixupNodePairSetTypeIterator
fixupNodePairType
originalNodeMapType
originalNodeSetType
supersededNodeSetType
supersededNodeSetTypeIterator

Enums

Name
ProvenancePolicy

Member Functions

Name Description
SgCopyHelp
SgCopyHelp(SgCopyHelp const&) = default; [constructor]
Supporting class from copy mechanism within ROSE.
~SgCopyHelp
virtual ~SgCopyHelp(); [destructor] [virtual]
Destructor
assignCopiedNodePair
void assignCopiedNodePair( SgNode const* key, SgNode* value);
beginFixupNodePair
bool beginFixupNodePair( SgNode const* original, SgNode* copy);
bindCopiedReference
template<class T> void bindCopiedReference( T*& edge, T const* original);
clearState
void clearState();
completeFixupNodePair
void completeFixupNodePair( SgNode const* original, SgNode* copy);
constructClassTypeCopy
void constructClassTypeCopy(SgClassDeclaration const* declaration);
constructEnumTypeCopy
void constructEnumTypeCopy(SgEnumDeclaration const* declaration);
constructTemplateParameterTypeCopy
void constructTemplateParameterTypeCopy(SgTemplateParameter const* parameter);
copyAst
virtual SgNode* copyAst(SgNode const* n) = 0; [virtual]
copyOrLookupAst
SgNode* copyOrLookupAst(SgNode const* n);
copyOrLookupOwnedAst
SgNode* copyOrLookupOwnedAst(SgNode const* n);
decrementDepth
void decrementDepth();
eraseCopiedNodePair
size_t eraseCopiedNodePair(SgNode const* key);
finalizeRootCopy
virtual void finalizeRootCopy(); [virtual]
getProvenancePolicy
ProvenancePolicy getProvenancePolicy() const;
get_copiedFortranSourceNames
std::unordered_set<SgNode const*> const& get_copiedFortranSourceNames() const;
Copied SgInitializedName sources that carry Fortran source-type syntax.
get_copiedNodeMap
copiedNodeMapType const& get_copiedNodeMap() const;
get_copiedPreprocessingMap
copiedPreprocessingMapType const& get_copiedPreprocessingMap() const;
get_depth
int get_depth();
get_originalNodesForCopy
originalNodeSetType const& get_originalNodesForCopy(SgNode const* copy) const;
get_supersededNodeCopies
supersededNodeSetType& get_supersededNodeCopies();
incrementDepth
void incrementDepth();
insertCopiedNodePair
void insertCopiedNodePair( SgNode const* key, SgNode* value);
insertCopiedPreprocessingPair
void insertCopiedPreprocessingPair( PreprocessingInfo const* original, PreprocessingInfo* copy);
isCopyingOriginal
bool isCopyingOriginal(SgNode const* node) const;
isFixupNodePairActive
bool isFixupNodePairActive( SgNode const* original, SgNode* copy) const;
isFixupNodePairCompleted
bool isFixupNodePairCompleted( SgNode const* original, SgNode* copy) const;
noteSupersededCopiedNode
void noteSupersededCopiedNode(SgNode* value);
plannedExternalSemanticCopyEdge
virtual SgNode* plannedExternalSemanticCopyEdge(SgNode const* original) const; [virtual]
prepareRootCopyForFixup
virtual void prepareRootCopyForFixup(); [virtual]
requireBoundCopiedReferences
void requireBoundCopiedReferences() const;
snapshotCopiedTypeReplacements
copiedTypeReplacementSnapshot snapshotCopiedTypeReplacements() const;
Immutable snapshot of every non-identity type pair in the copied-node map; later pairs are not visible through it.

Static Member Functions

Name
isConstructingCopy
static bool isConstructingCopy(SgNode const* node);

Private Type Aliases

Name
ReferenceBinding

Private Enums

Name
ReferenceTargetKind

Private Member Functions

Name
bindCopyReference
void bindCopyReference( SgNode const* original, ReferenceBinding binding);
indexCopiedNodePair
void indexCopiedNodePair( SgNode const* key, SgNode* value);
removeOriginalNodePair
void removeOriginalNodePair( SgNode const* original, SgNode const* copy);
unindexCopiedNodePair
void unindexCopiedNodePair(SgNode const* key);
writableCopiedTypeReplacements
copiedTypeReplacementMapType& writableCopiedTypeReplacements();

Private Static Member Functions

Name
activeConstruction
static SgCopyHelp*& activeConstruction();
activeScope
static ConstructionScope*& activeScope();

Private Data Members

Name Description
activeFixupNodePairs
completedFixupNodePairs
copiedFortranSourceNames
copiedNodeMap This is internal state used to asscociate pairs of IR nodes copied instead of shared.
copiedPreprocessingMap
copiedTypeReplacements
depth This data member records the depth of the traversal (root node == 0)
originalNodeMap
pendingReferences
provenancePolicy
supersededNodeCopies

Derived Classes

Name Description
SgShallowCopy Supporting class for "Shallow" copies of the AST. This class supports only shallow copies of the AST.
SgTreeCopy Supporting class for "Deep" copies of the AST.

Created with MrDocs