DepStandard.hpp

Go to the documentation of this file.
00001 
00015 #ifndef DepStandard_hpp
00016 #define DepStandard_hpp
00017 
00018 #include <set>
00019 #include <map>
00020 #include <OpenAnalysis/Utils/OA_ptr.hpp>
00021 #include <OpenAnalysis/IRInterface/IRHandles.hpp>
00022 #include <OpenAnalysis/Location/Locations.hpp>
00023 
00024 #include "DepDFSet.hpp"
00025 
00026 
00027 namespace OA {
00028   namespace Activity {
00029 
00030 /* 
00031    Maps each statement to a set of Dependences use,def where use is a 
00032    differentiable location used at some point when defining the def location.
00033    Also keeps track of must def locations for a statement.
00034 */
00035 class DepStandard {
00036   public:
00037     DepStandard() {}
00038     ~DepStandard() {}
00039 
00040     //*****************************************************************
00041     // Interface Implementation
00042     //*****************************************************************
00043 
00045     OA_ptr<DepDFSet> getFinalDep()
00046       { return mProcDepDFSet; }
00047     
00050     OA_ptr<LocIterator> 
00051         getMayDefIterator(StmtHandle stmt, const OA_ptr<Location> use);
00052 
00056     OA_ptr<LocIterator> 
00057         getDiffUseIterator(StmtHandle stmt, OA_ptr<Location> def);
00058     
00061     OA_ptr<LocIterator> getMustDefIterator(StmtHandle stmt);
00062 
00063     //*****************************************************************
00064     // Construction methods
00065     //*****************************************************************
00066     
00068     void mapStmtToDeps(StmtHandle stmt, OA_ptr<DepDFSet> depDFSet)
00069       { mDepDFSet[stmt] = depDFSet; }
00070 
00072     void mapFinalDeps(OA_ptr<DepDFSet> depDFSet)
00073       { mProcDepDFSet = depDFSet; }
00074 
00076     void insertDepForStmt(StmtHandle stmt, OA_ptr<Location> use,
00077             OA_ptr<Location> def);
00078 
00080     void insertMustDefForStmt(StmtHandle stmt, OA_ptr<Location> def);
00081    
00082     //*****************************************************************
00083     // Output
00084     //*****************************************************************
00085 
00086     void dump(std::ostream& os, OA_ptr<IRHandlesIRInterface> ir);
00087 
00088   private:
00089     OA_ptr<DepDFSet> mProcDepDFSet;
00090     std::map<StmtHandle,OA_ptr<DepDFSet> > mDepDFSet;
00091 
00092     std::map<StmtHandle,OA_ptr<LocSet> > mMustDefMap;
00093 
00094 };
00095 
00096 
00097   } // end of Activity namespace
00098 } // end of OA namespace
00099 
00100 #endif
00101 

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