OpenADFortTk (basic)
src/whirl2xaif/XlationContext.h
Go to the documentation of this file.
00001 // -*-Mode: C++;-*-
00002 // $Header: /m_home/m_utkej/Argonne/cvs2svn/cvs/OpenADFortTk/src/whirl2xaif/XlationContext.h,v 1.23 2007-10-08 18:28:34 utke Exp $
00003 
00004 #ifndef XlationContext_INCLUDED
00005 #define XlationContext_INCLUDED
00006 
00007 //************************** System Include Files ***************************
00008 
00009 #include <list>
00010 #include <iostream>
00011 
00012 #include "Open64IRInterface/Open64BasicTypes.h"
00013 #include "WhirlParentize.h"
00014 #include "WhirlIDMaps.h"
00015 #include "OAMaps.h"
00016 #include "Open64IRInterface/SymTab.h"
00017 #include "ScalarizedRefTab.h"
00018 
00019 namespace whirl2xaif{
00020 
00026   class XlationContext {
00027   public: 
00028 
00029     XlationContext(unsigned int aStackPosition=0);
00030   
00031     ~XlationContext();
00032   
00033     WN* getWN() const;
00034     bool hasWN() const;
00035     void setWN(WN* aWNp);
00036 
00040     unsigned int getNewVertexId();
00041 
00045     unsigned int getVertexId() const;
00046 
00050     unsigned int peekVertexId() const;
00051 
00055     unsigned int getNewEdgeId();
00056 
00060     unsigned int getEdgeId() const;
00061 
00065     unsigned int peekEdgeId() const;
00066 
00067     std::string toString() const;
00068   
00069     void dump(std::ostream& o, const std::string& indent) const;
00070 
00071     void ddump() const;
00072 
00073     enum Flags_E {
00074       NOFLAG               = 0x00000000, // for initialization
00075       ASSIGN               = 0x00000001, // within xaif:Assignment;        inherited
00076       VARREF               = 0x00000002, // within xaif:VariableReference; inherited
00077       DEREF_ADDR           = 0x00000004, 
00078       HAS_LOGICAL_ARG      = 0x00000200, 
00079       IS_LOGICAL_ARG       = 0x00000400,
00080       IS_LOGICAL_OPERATION = 0x00000800,
00081       IO_STMT              = 0x00004000, // candidate for removal
00082       DEREF_IO_ITEM        = 0x00008000, // candidate for removal
00083       ORIGFMT_IOCTRL       = 0x00010000, // candidate for removal
00084       FMT_IO               = 0x00020000, // candidate for removal
00085       CRAY_IO              = 0x00040000, // candidate for removal
00086       HAS_NO_ARR_ELMT      = 0x00200000  // inherited
00087     };
00088 
00089     static std::string flagToString(Flags_E aFlag);
00090 
00091     bool isFlag(Flags_E f) const ;
00092     void setFlag(Flags_E f);
00093     void unsetFlag(Flags_E f);
00094     void inheritFlags(const XlationContext& parentContext);
00095   
00096   private:
00097 
00101     WN* myWNp;
00102 
00106     unsigned int myNextVertexId; 
00107 
00111     unsigned int myNextEdgeId;
00112 
00116     unsigned int myFlags;
00117 
00121     unsigned int myStackPosition;
00122 
00123   };
00124 
00125 }// end namespace
00126 
00127 #endif 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines