00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _GCCFE_WFE_OMP_CHECK_STACK_H_
00025 #define _GCCFE_WFE_OMP_CHECK_STACK_H_
00026
00027 typedef enum {
00028 wfe_unknown,
00029 wfe_cscf,
00030 wfe_other_ompscope,
00031 wfe_omp_parallel,
00032 wfe_omp_for,
00033 wfe_omp_single,
00034 wfe_omp_sections,
00035 wfe_omp_parallel_sections,
00036 wfe_omp_parallel_for,
00037 wfe_omp_section,
00038 wfe_omp_master,
00039 wfe_omp_critical,
00040 wfe_omp_ordered,
00041 wfe_omp_barrier,
00042 wfe_omp_flush,
00043 wfe_omp_atomic,
00044 wfe_omp_threadprivate
00045 } WFE_CHECK_KIND;
00046 typedef enum{
00047 clause_none =0x0 ,
00048 clause_default =0x1 ,
00049 clause_firstprivate =0x2 ,
00050 clause_if =0x4 ,
00051 clause_lastprivate =0x8 ,
00052 clause_copyin =0x10 ,
00053 clause_copyprivate =0x20,
00054 clause_ordered =0x40,
00055 clause_private =0x80,
00056 clause_reduction =0x100,
00057 clause_schedule =0x200,
00058 clause_shared =0x400
00059
00060 }WFE_CLAUSE_KIND;
00061
00062 typedef struct check_stmt
00063 {
00064 WFE_CHECK_KIND kind;
00065 char* name;
00066 int cflag;
00067 int linenum;
00068 int filenum;
00069 WN *wn_prag;
00070 WN *region;
00071 } CHECK_STMT;
00072
00073 static CHECK_STMT *omp_check_stack;
00074 static CHECK_STMT *omp_check_sp;
00075 static CHECK_STMT *omp_check_last;
00076 static int omp_check_size;
00077 static int omp_check_num;
00078
00079 #define ENLARGE(x) (x + (x >> 1))
00080 #define OMP_CHECK_STACK_SIZE 32
00081
00082 extern void WFE_CS_Init();
00083 extern void WFE_CS_push( WFE_CHECK_KIND kind,int lnum, int fnum);
00084 extern void SEtd(SRCPOS srcpos);
00085 extern CHECK_STMT *WFE_CS_top(void);
00086 extern CHECK_STMT *WFE_CS_enclose(void);
00087 extern WFE_CHECK_KIND WFE_CS_pop(WFE_CHECK_KIND kind);
00088 extern void WFE_Set_Prag(WN *omp_prag);
00089 extern void WFE_Set_Nameflag(char* name);
00090 extern void WFE_Set_Cflag(WFE_CLAUSE_KIND flag);
00091 extern void WFE_Set_LFnum(CHECK_STMT *cs,int lnum,int fnum);
00092 extern bool WFE_Check_Cflag(CHECK_STMT* cs, WFE_CLAUSE_KIND flag);
00093 extern void WFE_Set_Region (WN *);
00094
00095
00096 extern int WFE_CS_Find(WFE_CHECK_KIND kind);
00097 extern CHECK_STMT* WFE_CS_Find_Rtn(WFE_CHECK_KIND kind);
00098 extern int WFE_CS_Find_Cflag(WFE_CHECK_KIND kind,WFE_CLAUSE_KIND flag);
00099 extern int WFE_CS_Find_fgname(WFE_CHECK_KIND kind,char* name);
00100
00101
00102
00103 extern bool WFE_is_top(WFE_CHECK_KIND kind);
00104 extern bool WFE_is_top_next(WFE_CHECK_KIND kind);
00105
00106 extern bool WFE_bind_to_same(WFE_CHECK_KIND sub1,WFE_CHECK_KIND sub2,WFE_CHECK_KIND bind);
00107
00108 #endif