OpenADFortTk (including Open64 and OpenAnalysis references)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ParamBindings.hpp
Go to the documentation of this file.
1 
16 #ifndef ParamBindings_h
17 #define ParamBindings_h
18 
19 #include <iostream>
20 #include <map>
21 
26 
27 namespace OA {
28  namespace DataFlow {
29 
30 class ParamBindings : public virtual Annotation {
31 public:
34 
37 
40 
43  ProcHandle callee);
44 
47 
49  //bool isRefParam(SymHandle formal);
50 
53 
56 
59 
60  //*****************************************************************
61  // Output
62  //*****************************************************************
63  void output(IRHandlesIRInterface& ir);
64 
66  void dump(std::ostream& os, OA_ptr<IRHandlesIRInterface> ir);
67 
68  //*****************************************************************
69  // Construction methods
70  //*****************************************************************
72  ProcHandle callee, SymHandle sym);
73  //void setRefParam(SymHandle sym);
74  void mapFormalToProc(SymHandle formal, ProcHandle proc);
75  //void mapActualToCall(MemRefHandle actual, CallHandle call);
76 
77  void mapCallToExprList(CallHandle call,OA_ptr<std::list<ExprHandle> > elist);
78  void mapExprToTree(ExprHandle act_expr, OA_ptr<ExprTree> etree);
79  void mapFormalToExpr(CallHandle call, SymHandle formal, ExprHandle act_expr);
80 
81 private:
82  OUTPUT
83 
84  GENOUT std::map<CallHandle,std::map<ProcHandle,std::map<MemRefHandle,SymHandle> > >
86  GENOUT std::map<CallHandle,std::map<SymHandle,MemRefHandle> > mCalleeToCallerMap;
87  std::map<ProcHandle,OA_ptr<std::set<SymHandle> > > mProcToFormalSetMap;
88  std::map<CallHandle,OA_ptr<std::set<MemRefHandle> > > mCallToActualSetMap;
89  //std::map<SymHandle,bool> mIsRefParam;
90 
91  GENOUT std::map<CallHandle,OA_ptr<std::list<ExprHandle> > > mCallToExprListMap;
92  GENOUT std::map<ExprHandle,OA_ptr<ExprTree> > mExprToTreeMap;
93  GENOUT std::map<CallHandle,std::map<SymHandle,ExprHandle> > mCallToFormalToActualMap;
94 
95 
97  class SymIterator : public virtual OA::SymHandleIterator,
98  public OA::IRHandleSetIterator<OA::SymHandle>
99  {
100  public:
101  SymIterator(OA::OA_ptr<std::set<OA::SymHandle> > pSet)
102  : OA::IRHandleSetIterator<OA::SymHandle>(pSet) {}
104 
106  bool isValid() const
111  };
112 
114  class MemRefIterator : public virtual OA::MemRefHandleIterator,
115  public OA::IRHandleSetIterator<OA::MemRefHandle>
116  {
117  public:
118  MemRefIterator(OA::OA_ptr<std::set<OA::MemRefHandle> > pList)
119  : OA::IRHandleSetIterator<OA::MemRefHandle>(pList) {}
121 
123  bool isValid() const
128  };
129 
131  class ExprIterator : public virtual OA::ExprHandleIterator,
132  public OA::IRHandleListIterator<OA::ExprHandle>
133  {
134  public:
135  ExprIterator(OA::OA_ptr<std::list<OA::ExprHandle> > eList)
136  : OA::IRHandleListIterator<OA::ExprHandle>(eList) {}
138 
139  void operator++()
141  bool isValid() const
146  };
147 
148 
149 
150 };
151 
152  } // end of DataFlow namespace
153 } // end of OA namespace
154 
155 #endif