| Polaris: DefLoc.h Source File | ||
|
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members
DefLoc.hGo to the documentation of this file.00001 /// 00002 #ifndef _DEF_LOC_H 00003 #define _DEF_LOC_H 00004 /// 00005 /// \class DefLoc 00006 /// \brief Map entries which hold def place of a GSA variable 00007 /// \defgroup Polaris 00008 /// \ingroup Polaris 00009 /// C++ VDL 00010 /// \see DefLoc.cc 00011 /// \see DefLoc.h 00012 /// 00013 /// \endcode 00014 /// \section DESCRIPTION DESCRIPTION 00015 /// Make a map to hold definitions for each GSA variable 00016 /// 00017 /// 00018 class ProgramUnit; 00019 00020 #ifdef POLARIS_GNU_PRAGMAS 00021 #pragma interface 00022 #endif 00023 00024 #include "ClassNames.h" 00025 #include "Symbol/Symbol.h" 00026 #include "Statement/Statement.h" 00027 #include "Collection/RefElement.h" 00028 #include "p-assert.h" 00029 00030 class DefLocMap; 00031 class ProgramUnit; 00032 00033 class DefLoc : public Listable { 00034 friend ostream & operator << (ostream & o, const DefLoc & p); 00035 friend class DefLocMap; 00036 friend class DefLocMap * MakeDefMap(ProgramUnit & pgm); 00037 00038 private: 00039 00040 RefElement<Statement> _st; 00041 00042 public: 00043 00044 inline DefLoc(); 00045 00046 inline DefLoc(const DefLoc & other); 00047 00048 inline ~DefLoc(); 00049 00050 inline bool stmt_valid() const; 00051 00052 inline const Statement & stmt_guarded() const; 00053 inline Statement & stmt_guarded(); 00054 00055 virtual inline DefLoc * clone() const; 00056 00057 virtual Listable * listable_clone() const; 00058 00059 virtual int structures_OK() const; 00060 00061 virtual void print(ostream & o) const; 00062 00063 }; 00064 00065 00066 inline 00067 DefLoc::DefLoc() 00068 { 00069 #ifdef CLASS_INSTANCE_REGISTRY 00070 register_instance(DEFLOC, sizeof(DefLoc), this); 00071 #endif 00072 } 00073 00074 inline 00075 DefLoc::DefLoc(const DefLoc & other) 00076 : _st(other._st) 00077 { 00078 #ifdef CLASS_INSTANCE_REGISTRY 00079 register_instance(DEFLOC, sizeof(DefLoc), this); 00080 #endif 00081 } 00082 00083 inline 00084 DefLoc::~DefLoc() 00085 { 00086 #ifdef CLASS_INSTANCE_REGISTRY 00087 unregister_instance(DEFLOC, this); 00088 #endif 00089 } 00090 00091 inline bool 00092 DefLoc::stmt_valid() const 00093 { 00094 return _st.valid(); 00095 } 00096 00097 inline const Statement & 00098 DefLoc::stmt_guarded() const 00099 { 00100 return *_st; 00101 } 00102 00103 inline Statement & 00104 DefLoc::stmt_guarded() 00105 { 00106 return *_st; 00107 } 00108 00109 inline DefLoc * 00110 DefLoc::clone() const 00111 { 00112 return new DefLoc(*this); 00113 } 00114 00115 #endif |
||
|