ManagerICFGActive.hpp

Go to the documentation of this file.
00001 
00016 #ifndef ManagerICFGActive_h
00017 #define ManagerICFGActive_h
00018 
00019 //--------------------------------------------------------------------
00020 // OpenAnalysis headers
00021 
00022 #include <OpenAnalysis/Activity/ManagerActiveStandard.hpp>
00023 #include <OpenAnalysis/Activity/ManagerICFGDep.hpp>
00024 #include <OpenAnalysis/Activity/ManagerICFGUseful.hpp>
00025 #include <OpenAnalysis/Activity/ManagerICFGVaryActive.hpp>
00026 #include <OpenAnalysis/Activity/ActivePerStmt.hpp>
00027 #include <OpenAnalysis/IRInterface/ActivityIRInterface.hpp>
00028 
00029 #include <OpenAnalysis/Activity/InterActive.hpp>
00030 //#include <OpenAnalysis/CFG/EachCFGInterface.hpp>
00031 #include <OpenAnalysis/Alias/InterAliasInterface.hpp>
00032 #include <OpenAnalysis/SideEffect/InterSideEffectInterface.hpp>
00033 #include <OpenAnalysis/CallGraph/CallGraphInterface.hpp>
00034 
00035 namespace OA {
00036   namespace Activity {
00037 
00038 
00042 class ManagerICFGActive : public virtual DataFlow::ICFGDFProblem {
00043 public:
00044   ManagerICFGActive(OA_ptr<Activity::ActivityIRInterface> _ir);
00045   ~ManagerICFGActive () {}
00046 
00047   OA_ptr<InterActive> performAnalysis(
00048           OA_ptr<ICFG::ICFGInterface> icfg,
00049           OA_ptr<DataFlow::ParamBindings> paramBind,
00050           OA_ptr<Alias::InterAliasInterface> interAlias,
00051           OA_ptr<SideEffect::InterSideEffectInterface> interSE,
00052           DataFlow::DFPImplement algorithm);
00053 
00054 private:
00055   //========================================================
00056   // implementation of ICFGDFProblem interface
00057   //========================================================
00058   //--------------------------------------------------------
00059   // initialization callbacks
00060   //--------------------------------------------------------
00061 
00063   OA_ptr<DataFlow::DataFlowSet>  initializeTop();
00064   
00066   OA_ptr<DataFlow::DataFlowSet> 
00067       initializeNodeIN(OA_ptr<ICFG::NodeInterface> n);
00068   OA_ptr<DataFlow::DataFlowSet> 
00069       initializeNodeOUT(OA_ptr<ICFG::NodeInterface> n);
00070  
00071   //--------------------------------------------------------
00072   // solver callbacks 
00073   //--------------------------------------------------------
00074   
00077   OA_ptr<DataFlow::DataFlowSet> meet(OA_ptr<DataFlow::DataFlowSet> set1, 
00078                                      OA_ptr<DataFlow::DataFlowSet> set2); 
00079 
00082   OA_ptr<DataFlow::DataFlowSet> 
00083       transfer(ProcHandle proc, OA_ptr<DataFlow::DataFlowSet> in, 
00084                OA::StmtHandle stmt);
00085   
00089   OA_ptr<DataFlow::DataFlowSet> 
00090       entryTransfer(ProcHandle proc, OA_ptr<DataFlow::DataFlowSet> in);
00091 
00095   OA_ptr<DataFlow::DataFlowSet> 
00096       exitTransfer(ProcHandle proc, OA_ptr<DataFlow::DataFlowSet> out);
00097 
00099   OA_ptr<DataFlow::DataFlowSet> callerToCallee(ProcHandle caller,
00100     OA_ptr<DataFlow::DataFlowSet> dfset, CallHandle call, ProcHandle callee);
00101   
00103   OA_ptr<DataFlow::DataFlowSet> calleeToCaller(ProcHandle callee,
00104     OA_ptr<DataFlow::DataFlowSet> dfset, CallHandle call, ProcHandle caller);
00105 
00107  OA_ptr<DataFlow::DataFlowSet> callToReturn(ProcHandle caller,
00108     OA_ptr<DataFlow::DataFlowSet> dfset, CallHandle call, ProcHandle callee);
00109 
00110 private: // member variables
00111 
00112   OA_ptr<Activity::ActivityIRInterface> mIR;
00113   std::map<ProcHandle,OA_ptr<ActiveStandard> > mActiveMap;
00114 
00115   OA_ptr<DataFlow::ParamBindings> mParamBind;
00116   OA_ptr<ICFGDep> mICFGDep;
00117   OA_ptr<Alias::InterAliasInterface> mInterAlias;
00118   OA_ptr<DataFlow::ICFGDFSolver> mSolver;
00119   OA_ptr<ICFG::ICFGInterface> mICFG;
00120   OA_ptr<ActivePerStmt> mActive;
00121 };
00122 
00123   } // end of Activity namespace
00124 } // end of OA namespace
00125 
00126 #endif