Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef anl_common_INCLUDED
00037 #define anl_common_INCLUDED
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 #include "defs.h"
00052
00053 #include "config.h"
00054 #include "erglob.h"
00055 #include "glob.h"
00056 #include "wn.h"
00057 #include "wn_util.h"
00058 #include "symtab.h"
00059 #include "irbdata.h"
00060 #include "wintrinsic.h"
00061 #include "wn_pragmas.h"
00062 #include "cxx_memory.h"
00063
00064 #include "lwn_util.h"
00065 #include "flags.h"
00066 #include "file_util.h"
00067 #include "anl_diagnostics.h"
00068 #include "anl_cbuf.h"
00069 #include "anl_srcpos.h"
00070
00071
00072 typedef TYPE_ID MTYPE;
00073 typedef mINT64 STAB_OFFSET;
00074
00075 #define TY_IS_POINTER(ty) (TY_kind(ty) == KIND_POINTER)
00076 #define TY_IS_ARRAY(ty) (TY_kind(ty) == KIND_ARRAY)
00077
00078 #define ST_AT_FILE_SCOPE(st) Is_Global_Symbol(st)
00079
00080 #define ST_IS_VALID_BASE(st) \
00081 (ST_base(st) != NULL && \
00082 ST_base(st) != (st) && \
00083 ST_sym_class(ST_base(st)) != CLASS_BLOCK)
00084
00085 #define ST_IS_COMMON_BLOCK(st) \
00086 (PU_ftn_lang(Get_Current_PU()) && \
00087 (ST_sclass(st) == SCLASS_COMMON || \
00088 ST_sclass(st) == SCLASS_DGLOBAL) && \
00089 TY_kind(ST_type(st)) == KIND_STRUCT && \
00090 !ST_AT_FILE_SCOPE(st))
00091
00092 #define ST_IS_EQUIVALENCE_BLOCK(st) \
00093 (PU_ftn_lang(Get_Current_PU()) && \
00094 TY_kind(ST_type(st)) == KIND_STRUCT && \
00095 ST_sclass(st) != SCLASS_COMMON && \
00096 ! TY_fld(Ty_Table[ST_type(st)]).Is_Null() && \
00097 (FLD_equivalence(TY_fld(Ty_Table[ST_type(st)]))))
00098
00099 #define ST_IS_BASED_AT_COMMON_OR_EQUIVALENCE(st) \
00100 (ST_IS_VALID_BASE(st) && \
00101 (ST_IS_COMMON_BLOCK(ST_base(st)) || \
00102 ST_IS_EQUIVALENCE_BLOCK(ST_base(st))))
00103
00104 #define ST_NO_LINKAGE(st) \
00105 (ST_export(st) == EXPORT_LOCAL || \
00106 ST_export(st) == EXPORT_LOCAL_INTERNAL)
00107
00108 #define ST_EXTERNAL_LINKAGE(st) \
00109 (ST_export(st) == EXPORT_INTERNAL || \
00110 ST_export(st) == EXPORT_HIDDEN || \
00111 ST_export(st) == EXPORT_PROTECTED || \
00112 ST_export(st) == EXPORT_OPTIONAL || \
00113 ST_export(st) == EXPORT_PREEMPTIBLE)
00114
00115
00116 void
00117 Adjust_Srcpos_Range(WN *stmt,
00118 ANL_SRCPOS *min,
00119 ANL_SRCPOS *max);
00120
00121
00122 class COUNTER
00123 {
00124 private:
00125 INT64 _value;
00126 public:
00127 COUNTER(INT64 start): _value(start) {}
00128 void Reset(INT64 start) {_value = start;}
00129 INT64 Value() const {return _value;}
00130 INT64 Post_Incr() {return _value++;}
00131 INT64 Pre_Incr() {return ++_value;}
00132 };
00133
00134 #endif