3#include "checkIsModifiedFlag.h"
11bool checkIsModifiedFlag(
SgNode *node)
14 TimingPerformance timer (
"Check the isModifiedFlag in each IR node:");
16 return CheckIsModifiedFlagSupport(node);
25CheckIsModifiedFlagSupport(
SgNode *node)
38 for (vector<SgNode*>::const_iterator p = children.begin(); p != children.end(); ++p) {
40 if (cur && node==cur->
get_parent() && CheckIsModifiedFlagSupport(cur))
50reportNodesMarkedAsModified(
SgNode *node)
61 printf (
"reportNodesMarkedAsModified(): node = %p = %s \n",node,node->
class_name().c_str());
67 NodesMarkedAsModified traversal;
68 traversal.traverse(node, preorder);
72unsetNodesMarkedAsModified(
SgNode *node)
79 printf (
"In unsetNodesMarkedAsModified(): node = %p = %s \n",node,node->
class_name().c_str());
90 printf (
"unsetNodesMarkedAsModified(): node = %p = %s \n",node,node->
class_name().c_str());
99 NodesMarkedAsModified traversal;
100 traversal.traverse(node, preorder);
104checkIsModifiedFlag(
SgNode *node)
111 printf (
"In checkIsModifiedFlag(): node = %p = %s \n",node,node->
class_name().c_str());
120 bool isSubtreeModifiedFlag;
122 NodesMarkedAsModified () : isSubtreeModifiedFlag(false) {}
128 isSubtreeModifiedFlag =
true;
137 NodesMarkedAsModified traversal;
138 traversal.traverse(node, preorder);
140 return traversal.isSubtreeModifiedFlag;
Class for traversing the AST.
virtual void visit(SgNode *astNode)=0
this method is called at every traversed node.
This class represents the base class for all IR nodes within Sage III.
SgNode * get_parent() const
Access function for parent node.
void set_isModified(bool isModified)
All nodes in the AST contain a isModified flag used to track changes to the AST.
virtual std::vector< SgNode * > get_traversalSuccessorContainer()
container of pointers to AST successor nodes used in the traversal overridden in every class by gener...
virtual std::string class_name() const
returns a string representing the class name
bool get_isModified() const
Acess function for isModified flag.