00001 00015 #ifndef ReachDefsManagerStandard_h 00016 #define ReachDefsManagerStandard_h 00017 00018 //-------------------------------------------------------------------- 00019 // OpenAnalysis headers 00020 #include <OpenAnalysis/Utils/OA_ptr.hpp> 00021 #include <OpenAnalysis/IRInterface/ReachDefsIRInterface.hpp> 00022 #include <OpenAnalysis/ReachDefs/ReachDefsStandard.hpp> 00023 00024 //#include <OpenAnalysis/CFG/CFGInterface.hpp> 00025 #include <OpenAnalysis/Alias/Interface.hpp> 00026 00027 #include <OpenAnalysis/DataFlow/CFGDFProblem.hpp> 00028 #include <OpenAnalysis/Location/Locations.hpp> 00029 #include <OpenAnalysis/DataFlow/IRHandleDataFlowSet.hpp> 00030 #include <OpenAnalysis/SideEffect/InterSideEffectInterface.hpp> 00031 #include <OpenAnalysis/DataFlow/CFGDFSolver.hpp> 00032 #include <OpenAnalysis/CFG/CFGInterface.hpp> 00033 00034 namespace OA { 00035 namespace ReachDefs { 00036 00037 00043 class ManagerReachDefsStandard 00044 : public virtual DataFlow::CFGDFProblem { 00045 //??? eventually public OA::AnnotationManager 00046 public: 00047 ManagerReachDefsStandard(OA_ptr<ReachDefsIRInterface> _ir); 00048 //{ CFGDFProblem<IRHandleDataFlowSet<StmtHandle> >( DataFlow::Forward ); } 00049 //{ CFGDFProblem( DataFlow::Forward ); } 00050 ~ManagerReachDefsStandard () {} 00051 00053 OA_ptr<ReachDefsStandard> performAnalysis(ProcHandle, 00054 OA_ptr<CFG::CFGInterface> cfg, OA_ptr<Alias::Interface> alias, 00055 OA_ptr<SideEffect::InterSideEffectInterface> interSE, 00056 DataFlow::DFPImplement algorithm); 00057 00060 //virtual Alias::AliasMap* performAnalysis(ProcHandle); 00061 00062 //------------------------------------------------------------------ 00063 // Implementing the callbacks for CFGDFProblem 00064 //------------------------------------------------------------------ 00065 protected: 00066 OA_ptr<DataFlow::DataFlowSet> initializeTop(); 00067 OA_ptr<DataFlow::DataFlowSet> initializeBottom(); 00068 00069 //void initializeNode(OA_ptr<CFG::Interface::Node> n); 00070 // Added by PLM 07/26/06 00072 OA_ptr<DataFlow::DataFlowSet> 00073 initializeNodeIN(OA_ptr<CFG::NodeInterface> n); 00074 00075 OA_ptr<DataFlow::DataFlowSet> 00076 initializeNodeOUT(OA_ptr<CFG::NodeInterface> n); 00077 00078 00079 OA_ptr<DataFlow::DataFlowSet> 00080 meet (OA_ptr<DataFlow::DataFlowSet> set1, OA_ptr<DataFlow::DataFlowSet> set2); 00081 00082 OA_ptr<DataFlow::DataFlowSet> 00083 transfer(OA_ptr<DataFlow::DataFlowSet> in, OA::StmtHandle stmt); 00084 00085 protected: // member variables 00086 00087 OA_ptr<ReachDefsIRInterface> mIR; 00088 OA_ptr<Alias::Interface> mAlias; 00089 OA_ptr<ReachDefsStandard> mReachDefMap; 00090 //std::set<MemRefHandle> mMemRefSet; // set of all memrefs seen so far 00091 00092 // the statements that may define this MemRefHandle 00093 //std::map<MemRefHandle,std::set<StmtHandle> > mMayDefMap; 00094 00095 // all memrefs that a statement may and must define 00096 //std::map<StmtHandle,DataFlow::IRHandleDataFlowSet<MemRefHandle> > mStmtMayDefMap; 00097 //std::map<StmtHandle,DataFlow::IRHandleDataFlowSet<MemRefHandle> > mStmtMustDefMap; 00098 std::map<StmtHandle,std::set<OA_ptr<Location> > > mStmtMayDefMap; 00099 std::map<StmtHandle,std::set<OA_ptr<Location> > > mStmtMustDefMap; 00100 // Added by PLM 07/26/06 00101 OA_ptr<DataFlow::CFGDFSolver> mSolver; 00102 00103 }; 00104 00105 } // end of ReachDefs namespace 00106 } // end of OA namespace 00107 00108 #endif
1.6.1