fixupCopy.h

Go to the documentation of this file.
00001 // DQ (10/15/2007): This controls the output of debugging information within the fixupCopy() member function of many IR nodes.
00002 // These member functions are used to handle custom IR node specific details of correcting references made by the AST copy 
00003 // mechanism between the original AST and the copy of the AST.
00004 // DQ (11/29/2009): Note that MSVC does not support use of "false" in macros, so use "0" instead.
00005 #define DEBUG_FIXUP_COPY 0
00006 #define DEBUG_FIXUP_COPY_OUTPUT_MAP 0
00007 
00008 void outputMap ( SgCopyHelp & help );
00009 
00010 // DQ (10/16/2007): This is a macro to simplify the code associated with fixing up data member in the AST copy.
00011 #if DEBUG_FIXUP_COPY
00012 #define FixupCopyDataMemberMacro(IR_node_copy,IR_node_type,get_accessFunctionName,set_accessFunctionName)                \
00013      if (IR_node_copy->get_accessFunctionName() == this->get_accessFunctionName())                                       \
00014         {                                                                                                                \
00015           SgCopyHelp::copiedNodeMapTypeIterator i = help.get_copiedNodeMap().find(this->get_accessFunctionName());       \
00016           printf ("SgCopyHelp::copiedNodeMapTypeIterator i != help.get_copiedNodeMap().end() = %s (using %s()) \n",i != help.get_copiedNodeMap().end() ? "true" : "false",#get_accessFunctionName); \
00017           if (i != help.get_copiedNodeMap().end())                                                                       \
00018              {                                                                                                           \
00019                SgNode* associated_node_copy = i->second;                                                                 \
00020                ROSE_ASSERT(associated_node_copy != NULL);                                                                \
00021                IR_node_type* local_copy = is##IR_node_type(associated_node_copy);                                        \
00022                ROSE_ASSERT(local_copy != NULL);                                                                          \
00023                printf ("Resetting using %s->%s(local_copy) = %p = %s \n",#IR_node_copy,#set_accessFunctionName,local_copy,local_copy->class_name().c_str()); \
00024                IR_node_copy->set_accessFunctionName(local_copy);                                                         \
00025              }                                                                                                           \
00026           ROSE_ASSERT(IR_node_copy->get_accessFunctionName()->variantT() == this->get_accessFunctionName()->variantT()); \
00027         }                                                                                                                \
00028        else                                                                                                              \
00029         {                                                                                                                \
00030            printf ("%s->%s() = %p != this->%s() = %p (so %s is already set for %p) \n",#IR_node_copy,#get_accessFunctionName,IR_node_copy,#get_accessFunctionName,this,#get_accessFunctionName,IR_node_copy); \
00031         }
00032 #else
00033 #define FixupCopyDataMemberMacro(IR_node_copy,IR_node_type,get_accessFunctionName,set_accessFunctionName)                \
00034      if (IR_node_copy->get_accessFunctionName() == this->get_accessFunctionName())                                       \
00035         {                                                                                                                \
00036           SgCopyHelp::copiedNodeMapTypeIterator i = help.get_copiedNodeMap().find(this->get_accessFunctionName());       \
00037           if (i != help.get_copiedNodeMap().end())                                                                       \
00038              {                                                                                                           \
00039                SgNode* associated_node_copy = i->second;                                                                 \
00040                ROSE_ASSERT(associated_node_copy != NULL);                                                                \
00041                IR_node_type* local_copy = is##IR_node_type(associated_node_copy);                                        \
00042                ROSE_ASSERT(local_copy != NULL);                                                                          \
00043                IR_node_copy->set_accessFunctionName(local_copy);                                                         \
00044              }                                                                                                           \
00045           ROSE_ASSERT(IR_node_copy->get_accessFunctionName()->variantT() == this->get_accessFunctionName()->variantT()); \
00046         }
00047 #endif
00048 

Generated on Sat May 19 00:53:06 2012 for ROSE by  doxygen 1.4.7