37
38 bit_info->set = set;
39 bit_info->possible = possible;
40
41 return bit_info;
42 }
43
44 static struct smatch_state *alloc_bstate(unsigned long long set, unsigned long long possible)
45 {
46 struct smatch_state *state;
47 char buf[64];
48
49 state = __alloc_smatch_state(0);
50 snprintf(buf, sizeof(buf), "0x%llx + 0x%llx", set, possible);
51 state->name = alloc_sname(buf);
52 state->data = alloc_bit_info(set, possible);
53
54 return state;
55 }
56
57 static struct bit_info *rl_to_binfo(struct range_list *rl)
58 {
59 struct bit_info *ret = __alloc_bit_info(0);
60 sval_t sval;
61
62 if (rl_to_sval(rl, &sval)) {
63 ret->set = sval.uvalue;
64 ret->possible = sval.uvalue;
65
66 return ret;
67 }
68
69 ret->set = 0;
70 ret->possible = sval_fls_mask(rl_max(rl));
71 // FIXME: what about negatives?
72
73 return ret;
74 }
75
76 static int is_unknown_binfo(struct symbol *type, struct bit_info *binfo)
77 {
|
37
38 bit_info->set = set;
39 bit_info->possible = possible;
40
41 return bit_info;
42 }
43
44 static struct smatch_state *alloc_bstate(unsigned long long set, unsigned long long possible)
45 {
46 struct smatch_state *state;
47 char buf[64];
48
49 state = __alloc_smatch_state(0);
50 snprintf(buf, sizeof(buf), "0x%llx + 0x%llx", set, possible);
51 state->name = alloc_sname(buf);
52 state->data = alloc_bit_info(set, possible);
53
54 return state;
55 }
56
57 struct bit_info *rl_to_binfo(struct range_list *rl)
58 {
59 struct bit_info *ret = __alloc_bit_info(0);
60 sval_t sval;
61
62 if (rl_to_sval(rl, &sval)) {
63 ret->set = sval.uvalue;
64 ret->possible = sval.uvalue;
65
66 return ret;
67 }
68
69 ret->set = 0;
70 ret->possible = sval_fls_mask(rl_max(rl));
71 // FIXME: what about negatives?
72
73 return ret;
74 }
75
76 static int is_unknown_binfo(struct symbol *type, struct bit_info *binfo)
77 {
|