2 #include "sage3basic.h"
3 #include "checkIsModifiedFlag.h"
11 bool checkIsModifiedFlag(
SgNode *node)
14 TimingPerformance timer (
"Check the isModifiedFlag in each IR node:");
16 return CheckIsModifiedFlagSupport(node);
25 CheckIsModifiedFlagSupport(
SgNode *node)
38 for (vector<SgNode*>::const_iterator p = children.begin(); p != children.end(); ++p) {
40 if (cur && node==cur->
get_parent() && CheckIsModifiedFlagSupport(cur))
50 reportNodesMarkedAsModified(
SgNode *node)
61 printf (
"reportNodesMarkedAsModified(): node = %p = %s \n",node,node->
class_name().c_str());
67 NodesMarkedAsModified traversal;
68 traversal.traverse(node, preorder);
72 unsetNodesMarkedAsModified(
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);
104 checkIsModifiedFlag(
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;