ManagerICFGVaryActive.hpp

Go to the documentation of this file.
00001 
00017 #ifndef ManagerICFGVaryActive_H
00018 #define ManagerICFGVaryActive_H
00019 
00020 //--------------------------------------------------------------------
00021 #include <cassert>
00022 
00023 // OpenAnalysis headers
00024 #include <OpenAnalysis/Alias/InterAliasInterface.hpp>
00025 #include <OpenAnalysis/SideEffect/InterSideEffectInterface.hpp>
00026 #include <OpenAnalysis/IRInterface/ActivityIRInterface.hpp>
00027 
00028 #include <OpenAnalysis/DataFlow/ICFGDFProblem.hpp>
00029 #include <OpenAnalysis/DataFlow/ICFGDFSolver.hpp>
00030 #include <OpenAnalysis/DataFlow/ParamBindings.hpp>
00031 #include <OpenAnalysis/DataFlow/LocDFSet.hpp>
00032 #include <OpenAnalysis/Activity/InterVary.hpp>
00033 #include <OpenAnalysis/Activity/InterUseful.hpp>
00034 #include <OpenAnalysis/Activity/ICFGDep.hpp>
00035 
00036 #include "ManagerUsefulStandard.hpp"
00037 #include "ActivePerStmt.hpp"
00038 
00039 namespace OA {
00040   namespace Activity {
00041 
00046 class ManagerICFGVaryActive : public virtual DataFlow::ICFGDFProblem
00047 { 
00048 public:
00049   ManagerICFGVaryActive(OA_ptr<ActivityIRInterface> _ir);
00050   ~ManagerICFGVaryActive () {}
00051 
00052   OA_ptr<ActivePerStmt> 
00053   performAnalysis(OA_ptr<ICFG::ICFGInterface> icfg,
00054                   OA_ptr<DataFlow::ParamBindings> paramBind,
00055                   OA_ptr<Alias::InterAliasInterface> interAlias,
00056                   OA_ptr<ICFGDep> icfgDep,
00057                   OA_ptr<InterUseful> interUseful,
00058                   DataFlow::DFPImplement algorithm);
00059 
00060 private:
00061   //========================================================
00062   // helper routines
00063   //========================================================
00064   OA_ptr<DataFlow::LocDFSet> calculateActive(
00065         OA_ptr<LocIterator> varyIter,
00066         OA_ptr<LocIterator> usefulIter, StmtHandle stmt);
00067 
00068   //========================================================
00069   // implementation of ICFGDFProblem interface
00070   //========================================================
00071   //--------------------------------------------------------
00072   // initialization callbacks
00073   //--------------------------------------------------------
00074 
00076   OA_ptr<DataFlow::DataFlowSet>  initializeTop();
00077   
00079   OA_ptr<DataFlow::DataFlowSet> 
00080       initializeNodeIN(OA_ptr<ICFG::NodeInterface> n);
00081   OA_ptr<DataFlow::DataFlowSet> 
00082       initializeNodeOUT(OA_ptr<ICFG::NodeInterface> n);
00083  
00084   //--------------------------------------------------------
00085   // solver callbacks 
00086   //--------------------------------------------------------
00087   
00090   OA_ptr<DataFlow::DataFlowSet> meet(OA_ptr<DataFlow::DataFlowSet> set1, 
00091                                      OA_ptr<DataFlow::DataFlowSet> set2); 
00092 
00095   OA_ptr<DataFlow::DataFlowSet> 
00096       transfer(ProcHandle proc, OA_ptr<DataFlow::DataFlowSet> in, 
00097                OA::StmtHandle stmt);
00098   
00102   OA_ptr<DataFlow::DataFlowSet> 
00103       entryTransfer(ProcHandle proc, OA_ptr<DataFlow::DataFlowSet> in);
00104 
00108   OA_ptr<DataFlow::DataFlowSet> 
00109       exitTransfer(ProcHandle proc, OA_ptr<DataFlow::DataFlowSet> out);
00110 
00112   OA_ptr<DataFlow::DataFlowSet> callerToCallee(ProcHandle caller,
00113     OA_ptr<DataFlow::DataFlowSet> dfset, CallHandle call, ProcHandle callee);
00114   
00116   OA_ptr<DataFlow::DataFlowSet> calleeToCaller(ProcHandle callee,
00117     OA_ptr<DataFlow::DataFlowSet> dfset, CallHandle call, ProcHandle caller);
00118 
00120  OA_ptr<DataFlow::DataFlowSet> callToReturn(ProcHandle caller,
00121     OA_ptr<DataFlow::DataFlowSet> dfset, CallHandle call, ProcHandle callee);
00122 
00123 private:
00124   OA_ptr<ActivePerStmt> mActive;
00125   OA_ptr<InterUseful> mInterUseful;
00126   OA_ptr<ActivityIRInterface> mIR;
00127   OA_ptr<DataFlow::ParamBindings> mParamBind;
00128   OA_ptr<ICFGDep> mICFGDep;
00129   OA_ptr<Alias::InterAliasInterface> mInterAlias;
00130   OA_ptr<DataFlow::ICFGDFSolver> mSolver;
00131   OA_ptr<ICFG::ICFGInterface> mICFG;
00132 
00133 };
00134 
00135   } // end of Activity namespace
00136 } // end of OA namespace
00137 
00138 #endif