ManagerLivenessStandard.hpp

Go to the documentation of this file.
00001 // ManagerLivenessStandard.hpp
00002 
00003 #ifndef LivenessManagerStandard_h
00004 #define LivenessManagerStandard_h
00005 
00006 //--------------------------------------------------------------------
00007 // OpenAnalysis headers
00008 #include <OpenAnalysis/Utils/OA_ptr.hpp>
00009 #include <OpenAnalysis/IRInterface/LivenessIRInterface.hpp>
00010 #include <OpenAnalysis/Liveness/LivenessStandard.hpp>
00011 
00012 #include <OpenAnalysis/Alias/Interface.hpp>
00013 
00014 #include <OpenAnalysis/DataFlow/CFGDFProblem.hpp>
00015 #include <OpenAnalysis/Location/Location.hpp>
00016 #include <OpenAnalysis/DataFlow/LocDFSet.hpp>
00017 #include <OpenAnalysis/SideEffect/InterSideEffectInterface.hpp>
00018 #include <OpenAnalysis/DataFlow/CFGDFSolver.hpp>
00019 #include <OpenAnalysis/CFG/CFGInterface.hpp>
00020 
00021 namespace OA {
00022   namespace Liveness {
00023 
00024 
00025 class ManagerLivenessStandard 
00026     : public DataFlow::CFGDFProblem { 
00027 public:
00028   ManagerLivenessStandard(OA_ptr<LivenessIRInterface> _ir);
00029   ~ManagerLivenessStandard () {}
00030 
00031   OA_ptr<LivenessStandard> performAnalysis(ProcHandle, 
00032         OA_ptr<CFG::CFGInterface> cfg, OA_ptr<Alias::Interface> alias, 
00033         OA_ptr<SideEffect::InterSideEffectInterface> interSE,
00034         DataFlow::DFPImplement algorithm);
00035 
00036 private:
00037   OA_ptr<DataFlow::DataFlowSet> initializeTop();
00038   OA_ptr<DataFlow::DataFlowSet> initializeBottom();
00039 
00040   OA_ptr<DataFlow::DataFlowSet>
00041            initializeNodeIN(OA_ptr<CFG::NodeInterface> n);
00042   
00043   OA_ptr<DataFlow::DataFlowSet>
00044            initializeNodeOUT(OA_ptr<CFG::NodeInterface> n);
00045                      
00046 
00047   OA_ptr<DataFlow::DataFlowSet> 
00048   meet (OA_ptr<DataFlow::DataFlowSet> set1, OA_ptr<DataFlow::DataFlowSet> set2); 
00049 
00050   OA_ptr<DataFlow::DataFlowSet> 
00051   transfer(OA_ptr<DataFlow::DataFlowSet> in, OA::StmtHandle stmt); 
00052 
00053 private: // member variables
00054 
00055   OA_ptr<LivenessIRInterface> mIR;
00056   OA_ptr<Alias::Interface> mAlias;
00057   OA_ptr<LivenessStandard> mLiveMap;
00058  // OA_ptr<LocIterator> mLocIter;
00059 //  std::map<StmtHandle,std::set<OA_ptr<Location> > > mStmtMayDefMap;
00060 //  std::map<StmtHandle,std::set<OA_ptr<Location> > > mStmtMustDefMap;
00061  std::map <StmtHandle, LocSet > mStmtMustDefMap; 
00062  std::map<StmtHandle, LocSet > mStmtMayUseMap;
00063   OA_ptr<DataFlow::CFGDFSolver> mSolver;
00064     
00065 };
00066 
00067   } // end of Liveness namespace
00068 } // end of OA namespace
00069 
00070 #endif