LoopAbstraction.hpp

Go to the documentation of this file.
00001 
00014 #ifndef LoopAbstraction_hpp
00015 #define LoopAbstraction_hpp
00016 
00017 #include <OpenAnalysis/IRInterface/IRHandles.hpp>
00018 #include <OpenAnalysis/Utils/SetIterator.hpp>
00019 #include <OpenAnalysis/Utils/OA_ptr.hpp>
00020 #include <OpenAnalysis/OABase/Annotation.hpp>
00021 #include <OpenAnalysis/Utils/GenOutputTool.hpp>
00022 #include <OpenAnalysis/Utils/Iterator.hpp>
00023 #include "LoopIndex.hpp"
00024 #include <list>
00025 using namespace std;
00026 
00027 namespace OA {
00028   namespace Loop {
00029 
00030 typedef SetIterator<StmtHandle> StmtIterator;
00031 
00037 class LoopAbstraction : public virtual Annotation {
00038   public:
00039   //[Construction]
00042     LoopAbstraction(
00043         OA_ptr<LoopIndex> loopIndex,
00044         StmtHandle loopStmt,
00045         StmtHandle endStmt,
00046         OA_ptr<LoopAbstraction> parent);
00047 
00048   //[Accessor methods]
00050     StmtHandle getLoopStatement() { return mLoopStatement; }
00051 
00053     StmtHandle getEndStatement() { return mEndStatement; }
00054 
00056     OA_ptr<LoopIndex> getLoopIndex() { return mLoopIndex; }
00057 
00060     OA_ptr<LoopAbstraction> getParent() { return mParent; }
00061 
00062   //[Ordering operators]
00064     virtual bool operator<(LoopAbstraction &other);
00065 
00067     virtual bool operator==(LoopAbstraction &other);
00068     
00070     bool operator!=(LoopAbstraction& other) { return ! ((*this)==other); }
00071 
00072   //[Output methods] (derived from Annotation)
00073     virtual void output(IRHandlesIRInterface &ir);
00074 
00075 
00076   private:
00077   OUTPUT
00078     GENOUT  StmtHandle mLoopStatement;
00079     GENOUT  StmtHandle mEndStatement;
00080     GENOUT  OA_ptr<LoopIndex>  mLoopIndex;
00081     GENOUT  OA_ptr<LoopAbstraction> mParent;
00082     int mOrder;
00083     static int sAbstractionsBuilt;
00084 };
00085 
00086 } } // namespaces
00087 
00088 #endif
00089