auto_ReachingDefsStandard.hpp

Go to the documentation of this file.
00001 
00002 /* ReachingDefsStandard.hpp
00003    NOTE: This file was automatically generated by DFAGen.  It is the interface
00004          for the ReachingDefs analysis results.
00005 */
00006 
00007 #ifndef ReachingDefsStandard_hpp
00008 #define ReachingDefsStandard_hpp
00009 
00010 #include <cassert>
00011 #include <iostream>
00012 #include <map>
00013 #include <set>
00014 #include <vector>
00015 #include <OpenAnalysis/Utils/OA_ptr.hpp>
00016 #include <OpenAnalysis/IRInterface/IRHandles.hpp>
00017 #include <OpenAnalysis/IRInterface/auto_ReachingDefsIRInterface.hpp>
00018 #include <OpenAnalysis/OABase/Annotation.hpp>
00019 #include <OpenAnalysis/Utils/GenOutputTool.hpp>
00020 #include <OpenAnalysis/Location/Location.hpp>
00021 #include <OpenAnalysis/DataFlow/DFAGenDFSet.hpp>
00022 #include <OpenAnalysis/Utils/Util.hpp>
00023 
00024 namespace OA {
00025   namespace ReachingDefs {
00026 
00027 typedef DataFlow::DFAGenDFSet<StmtHandle > ReachingDefsDFSet;
00028 
00029 class ReachingDefsStandard : public virtual Annotation {
00030   public:
00031     ReachingDefsStandard(ProcHandle p, OA_ptr<ReachingDefsIRInterface> _ir) {
00032         mIR = _ir;
00033         mExitReachingDefs = new ReachingDefsDFSet();
00034     }
00035     ~ReachingDefsStandard() {}
00036 
00037     ReachingDefsDFSet::iterator getReachingDefsIterator(StmtHandle s);
00038 
00039     ReachingDefsDFSet::iterator getExitReachingDefsIterator();
00040 
00041     void insert(StmtHandle s, StmtHandle  val) {
00042         if(mReachingDefs[s].ptrEqual(0)) {
00043             mReachingDefs[s] = new ReachingDefsDFSet();
00044         }
00045         mReachingDefs[s]->insert(val);
00046     }
00047 
00048     void insertExit(StmtHandle  val) {
00049         mExitReachingDefs->insert(val);
00050     }
00051 
00052     OA_ptr<ReachingDefsDFSet> getReachingDefsSet(StmtHandle s) {
00053         map<StmtHandle, OA_ptr<ReachingDefsDFSet> >::iterator element =
00054             mReachingDefs.find(s);
00055 
00056         if(element == mReachingDefs.end()) {
00057             mReachingDefs[s] = new ReachingDefsDFSet();
00058             element = mReachingDefs.find(s);
00059         }
00060 
00061         return (*element).second;
00062     }
00063 
00064     void output(IRHandlesIRInterface& pIR);
00065 
00066     void dump(std::ostream& os, OA_ptr<IRHandlesIRInterface> ir);
00067 
00068   private:
00069     map<StmtHandle, OA_ptr<ReachingDefsDFSet> > mReachingDefs;
00070     OA_ptr<ReachingDefsDFSet>  mExitReachingDefs;
00071     OA_ptr<ReachingDefsIRInterface> mIR;
00072 };
00073 
00074   } // end of Liveness namespace
00075 } // end of OA namespace
00076 
00077 #endif
00078 

Generated on Sat Oct 31 05:21:20 2009 for OpenAnalysis by  doxygen 1.6.1