DFAGenReachingDefinitionsStandard.hpp

Go to the documentation of this file.
00001 
00002  // DFAGenReachingDefinitions.hpp
00003 
00004 #ifndef DFAGenReachingDefinitionsStandard_hpp
00005 #define LivenessStandard_hpp
00006 
00007 #include <cassert>
00008 #include <iostream>
00009 #include <map>
00010 #include <set>
00011 #include <vector>
00012 #include <OpenAnalysis/Utils/OA_ptr.hpp>
00013 #include <OpenAnalysis/IRInterface/IRHandles.hpp>
00014 #include <OpenAnalysis/OABase/Annotation.hpp>
00015 #include <OpenAnalysis/Utils/GenOutputTool.hpp>
00016 #include <OpenAnalysis/Location/Location.hpp>
00017 #include <OpenAnalysis/DataFlow/LocDFSet.hpp>
00018 #include <OpenAnalysis/Utils/Util.hpp>
00019 
00020 namespace OA {
00021   namespace DFAGenReachingDefinitions {
00022 
00023 
00024 
00025 class DFAGenReachingDefinitionsStandard : public virtual Annotation 
00026 {
00027   public:
00028     DFAGenReachingDefinitionsStandard(ProcHandle p){} 
00029     ~DFAGenReachingDefinitionsStandard() {}
00030 
00031     OA_ptr<LocIterator> getDFAGenReachingDefinitionsIterator(StmtHandle s); 
00032 
00033     OA_ptr<LocIterator> getExitDFAGenReachingDefinitionsIterator(); 
00034 // TODO
00035  //    Live will be a set of locations
00036     void insertDFAGenReachingDefinitions(StmtHandle s, OA_ptr<Location> Live)
00037     { 
00038       if(mDFAGenReachingDefinitions[s].ptrEqual(0)) {
00039         mDFAGenReachingDefinitions[s] = new LocSet;
00040       }
00041       mDFAGenReachingDefinitions[s]->insert(Live);    
00042     }
00043 
00044     void insertExitDFAGenReachingDefinitions(OA_ptr<Location> Live)
00045     { 
00046       mExitDFAGenReachingDefinitions->insert(Live); 
00047     }
00048 
00049 
00050     void output(IRHandlesIRInterface& pIR);
00051 
00052     void dump(std::ostream& os, OA_ptr<IRHandlesIRInterface> ir);
00053 
00054   private:
00055     std::map<StmtHandle,OA_ptr<LocSet> > mDFAGenReachingDefinitions;
00056     OA_ptr<LocSet> mExitDFAGenReachingDefinitions;
00057 }; 
00058 
00059   } // end of Liveness namespace
00060 } // end of OA namespace
00061 
00062 #endif