reachingDef.h

Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include <boost/shared_ptr.hpp>
00004 #include <map>
00005 #include <set>
00006 #include <rose.h>
00007 #include "dataflowCfgFilter.h"
00008 
00009 class ReachingDef
00010 {
00011 public:
00012 
00013     enum Type
00014     {
00016         PHI_FUNCTION,
00017 
00019         ORIGINAL_DEF,
00020 
00023         EXPANDED_DEF
00024     };
00025 
00026     typedef boost::shared_ptr<ReachingDef> ReachingDefPtr;
00027 
00028     typedef FilteredCFGEdge<ssa_private::DataflowCfgFilter> FilteredCfgEdge;
00029 
00030 private:
00032     Type defType;
00033 
00036     std::map<ReachingDefPtr, std::set<FilteredCfgEdge> > parentDefs;
00037 
00040     SgNode* thisNode;
00041 
00043     int renamingNumer;
00044 
00045 public:
00046 
00047     //---------CONSTRUCTORS---------
00048 
00050     ReachingDef(SgNode* defNode, Type type);
00051 
00052     //---------ACCESSORS---------
00053 
00055     bool isPhiFunction() const;
00056 
00059     const std::map<ReachingDefPtr, std::set<FilteredCfgEdge> >& getJoinedDefs() const;
00060 
00063     SgNode* getDefinitionNode() const;
00064 
00066     std::set<SgNode*> getActualDefinitions() const;
00067 
00070     int getRenamingNumber() const;
00071 
00074     bool isOriginalDef() const
00075     {
00076         return defType == ORIGINAL_DEF;
00077     }
00078 
00079     bool operator==(const ReachingDef& other) const;
00080 
00081     //---------MODIFIERS---------
00082 
00084     void setDefinitionNode(SgNode* defNode);
00085 
00087     void addJoinedDef(ReachingDefPtr newDef, FilteredCfgEdge edge);
00088 
00090     void setRenamingNumber(int n);
00091 };

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