/* Static IDs for the special variables. Variable ID zero is unused
and used as terminator for the sub-variable chain. */
-enum { nothing_id = 1, anything_id = 2, readonly_id = 3,
+enum { nothing_id = 1, anything_id = 2, string_id = 3,
escaped_id = 4, nonlocal_id = 5,
storedanything_id = 6, integer_id = 7 };
cexpr.var = vi->id;
cexpr.type = SCALAR;
cexpr.offset = 0;
- /* If we determine the result is "anything", and we know this is readonly,
- say it points to readonly memory instead. */
- if (cexpr.var == anything_id && TREE_READONLY (t))
- {
- gcc_unreachable ();
- cexpr.type = ADDRESSOF;
- cexpr.var = readonly_id;
- }
/* If we are not taking the address of the constraint expr, add all
sub-fiels of the variable as well. */
return;
}
- /* String constants are read-only. */
+ /* String constants are read-only, ideally we'd have a CONST_DECL
+ for those. */
if (TREE_CODE (t) == STRING_CST)
{
- temp.var = readonly_id;
+ temp.var = string_id;
temp.type = SCALAR;
temp.offset = 0;
results->safe_push (temp);
else if (vi->is_heap_var)
/* We represent heapvars in the points-to set properly. */
;
- else if (vi->id == readonly_id)
- /* Nobody cares. */
+ else if (vi->id == string_id)
+ /* Nobody cares - STRING_CSTs are read-only entities. */
;
else if (vi->id == anything_id
|| vi->id == integer_id)
struct constraint_expr lhs, rhs;
varinfo_t var_anything;
varinfo_t var_nothing;
- varinfo_t var_readonly;
+ varinfo_t var_string;
varinfo_t var_escaped;
varinfo_t var_nonlocal;
varinfo_t var_storedanything;
but this one are redundant. */
constraints.safe_push (new_constraint (lhs, rhs));
- /* Create the READONLY variable, used to represent that a variable
- points to readonly memory. */
- var_readonly = new_var_info (NULL_TREE, "READONLY");
- gcc_assert (var_readonly->id == readonly_id);
- var_readonly->is_artificial_var = 1;
- var_readonly->offset = 0;
- var_readonly->size = ~0;
- var_readonly->fullsize = ~0;
- var_readonly->is_special_var = 1;
-
- /* readonly memory points to anything, in order to make deref
- easier. In reality, it points to anything the particular
- readonly variable can point to, but we don't track this
- separately. */
- lhs.type = SCALAR;
- lhs.var = readonly_id;
- lhs.offset = 0;
- rhs.type = ADDRESSOF;
- rhs.var = readonly_id; /* FIXME */
- rhs.offset = 0;
- process_constraint (new_constraint (lhs, rhs));
+ /* Create the STRING variable, used to represent that a variable
+ points to a string literal. String literals don't contain
+ pointers so STRING doesn't point to anything. */
+ var_string = new_var_info (NULL_TREE, "STRING");
+ gcc_assert (var_string->id == string_id);
+ var_string->is_artificial_var = 1;
+ var_string->offset = 0;
+ var_string->size = ~0;
+ var_string->fullsize = ~0;
+ var_string->is_special_var = 1;
+ var_string->may_have_pointers = 0;
/* Create the ESCAPED variable, used to represent the set of escaped
memory. */