ROSE  0.11.96.11
reachingDef.h
1 #pragma once
2 
3 // DQ (10/5/2014): This is more strict now that we include rose_config.h in the sage3basic.h.
4 // #include "rose.h"
5 // rose.h and sage3basic.h should not be included in librose header files. [Robb P. Matzke 2014-10-15]
6 // #include "sage3basic.h"
7 
8 #include <boost/shared_ptr.hpp>
9 #include <map>
10 #include <set>
11 
12 #include "dataflowCfgFilter.h"
13 
14 class ROSE_DLL_API ReachingDef
15 {
16 public:
17 
18  enum Type
19  {
22 
25 
28  EXPANDED_DEF
29  };
30 
31  typedef boost::shared_ptr<ReachingDef> ReachingDefPtr;
32 
33  typedef FilteredCFGEdge<ssa_private::DataflowCfgFilter> FilteredCfgEdge;
34 
35 private:
37  Type defType;
38 
41  std::map<ReachingDefPtr, std::set<FilteredCfgEdge> > parentDefs;
42 
45  SgNode* thisNode;
46 
48  int renamingNumer;
49 
50 public:
51 
52  //---------CONSTRUCTORS---------
53 
55  ReachingDef(SgNode* defNode, Type type);
56 
57  //---------ACCESSORS---------
58 
60  bool isPhiFunction() const;
61 
64  const std::map<ReachingDefPtr, std::set<FilteredCfgEdge> >& getJoinedDefs() const;
65 
68  SgNode* getDefinitionNode() const;
69 
71  std::set<SgNode*> getActualDefinitions() const;
72 
75  int getRenamingNumber() const;
76 
79  bool isOriginalDef() const
80  {
81  return defType == ORIGINAL_DEF;
82  }
83 
84  bool operator==(const ReachingDef& other) const;
85 
86  //---------MODIFIERS---------
87 
89  void setDefinitionNode(SgNode* defNode);
90 
92  void addJoinedDef(ReachingDefPtr newDef, FilteredCfgEdge edge);
93 
95  void setRenamingNumber(int n);
96 };
ReachingDef::Type
Type
Definition: reachingDef.h:18
ReachingDef::PHI_FUNCTION
@ PHI_FUNCTION
'Fake' definition that joins two different reaching definitions.
Definition: reachingDef.h:21
ReachingDef
Definition: reachingDef.h:14
SgNode
This class represents the base class for all IR nodes within Sage III.
Definition: Cxx_Grammar.h:6739
ReachingDef::isOriginalDef
bool isOriginalDef() const
Returns true if this is an original definition (i.e.
Definition: reachingDef.h:79
ReachingDef::ORIGINAL_DEF
@ ORIGINAL_DEF
Definition for the actual variable in question, not a parent or child.
Definition: reachingDef.h:24