ManagerICFGUseful.hpp

Go to the documentation of this file.
00001 
00016 #ifndef ManagerICFGUseful_H
00017 #define ManagerICFGUseful_H
00018 
00019 //--------------------------------------------------------------------
00020 #include <cassert>
00021 
00022 // OpenAnalysis headers
00023 #include <OpenAnalysis/Alias/InterAliasInterface.hpp>
00024 #include <OpenAnalysis/SideEffect/InterSideEffectInterface.hpp>
00025 #include <OpenAnalysis/IRInterface/ActivityIRInterface.hpp>
00026 
00027 //??? needed???
00028 //#include <OpenAnalysis/ExprTree/DifferentiableLocsVisitor.hpp>
00029 //#include <OpenAnalysis/ExprTree/EvalToMemRefVisitor.hpp>
00030 //#include <OpenAnalysis/DataFlow/CalleeToCallerVisitor.hpp>
00031 
00032 // MMA ??
00033 //#include <OpenAnalysis/Activity/CalleeToCallerMayTransVisitor.hpp>
00034 
00035 #include <OpenAnalysis/DataFlow/ICFGDFProblem.hpp>
00036 #include <OpenAnalysis/DataFlow/ICFGDFSolver.hpp>
00037 #include <OpenAnalysis/DataFlow/ParamBindings.hpp>
00038 #include <OpenAnalysis/DataFlow/LocDFSet.hpp>
00039 #include <OpenAnalysis/Activity/InterUseful.hpp>
00040 #include <OpenAnalysis/Activity/ICFGDep.hpp>
00041 
00042 #include "ManagerUsefulStandard.hpp"
00043 
00044 namespace OA {
00045   namespace Activity {
00046 
00051 class ManagerICFGUseful : public virtual DataFlow::ICFGDFProblem
00052 { 
00053 public:
00054   ManagerICFGUseful(OA_ptr<ActivityIRInterface> _ir);
00055   ~ManagerICFGUseful () {}
00056 
00057   OA_ptr<InterUseful> 
00058   performAnalysis(OA_ptr<ICFG::ICFGInterface> icfg,
00059                   OA_ptr<DataFlow::ParamBindings> paramBind,
00060                   OA_ptr<Alias::InterAliasInterface> interAlias,
00061                   OA_ptr<SideEffect::InterSideEffectInterface> interSE,
00062                   OA_ptr<ICFGDep> icfgDep,
00063                   DataFlow::DFPImplement algorithm);
00064 
00065 private:
00066   //========================================================
00067   // implementation of ICFGDFProblem interface
00068   //========================================================
00069   //--------------------------------------------------------
00070   // initialization callbacks
00071   //--------------------------------------------------------
00072 
00074   OA_ptr<DataFlow::DataFlowSet>  initializeTop();
00075   
00077   OA_ptr<DataFlow::DataFlowSet> 
00078       initializeNodeIN(OA_ptr<ICFG::NodeInterface> n);
00079   OA_ptr<DataFlow::DataFlowSet> 
00080       initializeNodeOUT(OA_ptr<ICFG::NodeInterface> n);
00081  
00082   //--------------------------------------------------------
00083   // solver callbacks 
00084   //--------------------------------------------------------
00085   
00088   OA_ptr<DataFlow::DataFlowSet> meet(OA_ptr<DataFlow::DataFlowSet> set1, 
00089                                      OA_ptr<DataFlow::DataFlowSet> set2); 
00090 
00093   OA_ptr<DataFlow::DataFlowSet> 
00094       transfer(ProcHandle proc, OA_ptr<DataFlow::DataFlowSet> in, 
00095                OA::StmtHandle stmt);
00096   
00100   OA_ptr<DataFlow::DataFlowSet> 
00101       entryTransfer(ProcHandle proc, OA_ptr<DataFlow::DataFlowSet> in);
00102 
00106   OA_ptr<DataFlow::DataFlowSet> 
00107       exitTransfer(ProcHandle proc, OA_ptr<DataFlow::DataFlowSet> out);
00108 
00110   OA_ptr<DataFlow::DataFlowSet> callerToCallee(ProcHandle caller,
00111     OA_ptr<DataFlow::DataFlowSet> dfset, CallHandle call, ProcHandle callee);
00112   
00114   OA_ptr<DataFlow::DataFlowSet> calleeToCaller(ProcHandle callee,
00115     OA_ptr<DataFlow::DataFlowSet> dfset, CallHandle call, ProcHandle caller);
00116 
00118  OA_ptr<DataFlow::DataFlowSet> callToReturn(ProcHandle caller,
00119     OA_ptr<DataFlow::DataFlowSet> dfset, CallHandle call, ProcHandle callee);
00120 
00121 private:
00122   OA_ptr<InterUseful> mInterUseful;
00123   OA_ptr<ActivityIRInterface> mIR;
00124   OA_ptr<DataFlow::ParamBindings> mParamBind;
00125   OA_ptr<ICFGDep> mICFGDep;
00126   OA_ptr<Alias::InterAliasInterface> mInterAlias;
00127   OA_ptr<DataFlow::ICFGDFSolver> mSolver;
00128   OA_ptr<ICFG::ICFGInterface> mICFG;
00129 
00130   // FIXME ??
00131   // mInterSE is no longer used in this analysis
00132   // (used to be sent to CalleeToCallerMayTransVisitor() constructor)
00133   OA_ptr<SideEffect::InterSideEffectInterface> mInterSE;
00134 
00135   std::map<ProcHandle,OA_ptr<UsefulStandard> > mUsefulMap;
00136 
00137 };
00138 
00139   } // end of Activity namespace
00140 } // end of OA namespace
00141 
00142 #endif