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 typedef struct tn {
00037 TN_NUM num;
00038 PQS_TN_MAP_TYPE m;
00039 } TN;
00040
00041 #define TN_number(x) ((x)->num)
00042
00043
00044 typedef struct op {
00045 PQS_ITYPE itype;
00046 TN * qual, *p1,*p2;
00047 PQS_NODE_IDX pqs_idx;
00048
00049 op() {
00050 itype = PQS_ITYPE_INVALID;
00051 qual = NULL;
00052 p1 = NULL;
00053 p2 = NULL;
00054 pqs_idx = PQS_IDX_INVALID ;
00055 }
00056
00057 op(PQS_ITYPE ity, TN *q, TN * p1, TN *p2) :
00058 itype(ity),qual(q),p1(p1),p2(p2) {}
00059 } OP;
00060
00061
00062
00063 static PQS_NODE_IDX PQS_TN_get_last_definition(TN * t) {return t->m.last_def;}
00064 static void PQS_TN_set_last_definition(TN *t, PQS_NODE_IDX p) {t->m.last_def = p;}
00065 static BOOL PQS_TN_used_as_qual_pred(const TN *t){return t->m.used_as_qual_pred;};
00066 static void PQS_TN_set_used_as_qual_pred(TN *t){t->m.used_as_qual_pred=TRUE;}
00067 static void PQS_TN_set_no_query(TN *t){t->m.no_query=TRUE;}
00068 static BOOL PQS_TN_no_query(const TN *t) {return t->m.no_query;}
00069
00070 static void PQS_OP_set_pqs_idx(OP *op, PQS_NODE_IDX p) {op->pqs_idx = p;}
00071
00072
00073 static PQS_ITYPE
00074 PQS_classify_instruction (OP * inst, TN * &qual, TN * &p1, TN * &p2, PQS_NODE_FLAGS &f)
00075 {
00076 qual = inst->qual;
00077 p1 = inst->p1;
00078 p2 = inst->p2;
00079 if (p1->num == 0) p1 = NULL;
00080 if (p2->num == 0) p2 = NULL;
00081 f = 0;
00082 return (inst->itype);
00083 }
00084
00085
00086
00087 struct lt_tn {
00088 inline bool operator()(const PQS_TN t1, const PQS_TN t2) const {
00089 return TN_number(t1) < TN_number(t2);
00090 }
00091 };
00092
00093 typedef PQS_SET<PQS_TN,lt_tn> PQS_TN_SET;
00094 typedef PQS_SET<PQS_TN,lt_tn>::set_type PQS_TN_SET_TYPE;