/* Used for points-to sets. */
bitmap_obstack pta_obstack;
-/* Used for oldsolution members of variables. */
+/* Used for oldsolution members of variables. */
bitmap_obstack oldpta_obstack;
/* Table of variable info structures for constraint variables.
return *slot;
}
-/* Return a printable name for DECL */
+/* Return a printable name for DECL. */
static const char *
alias_get_name (tree decl)
if (!get_varinfo (lhs.var)->may_have_pointers)
return;
- /* This can happen in our IR with things like n->a = *p */
+ /* This can happen in our IR with things like n->a = *p. */
if (rhs.type == DEREF && lhs.type == DEREF && rhs.var != anything_id)
{
- /* Split into tmp = *rhs, *lhs = tmp */
+ /* Split into tmp = *rhs, *lhs = tmp. */
struct constraint_expr tmplhs;
tmplhs = new_scalar_tmp_constraint_exp ("doubledereftmp", true);
process_constraint (new_constraint (tmplhs, rhs));
}
else if ((rhs.type != SCALAR || rhs.offset != 0) && lhs.type == DEREF)
{
- /* Split into tmp = &rhs, *lhs = tmp */
+ /* Split into tmp = &rhs, *lhs = tmp. */
struct constraint_expr tmplhs;
tmplhs = new_scalar_tmp_constraint_exp ("derefaddrtmp", true);
process_constraint (new_constraint (tmplhs, rhs));
tree forzero;
/* Some people like to do cute things like take the address of
- &0->a.b */
+ &0->a.b. */
forzero = t;
while (handled_component_p (forzero)
|| INDIRECT_REF_P (forzero)
{
/* In languages like C, you can access one past the end of an
array. You aren't allowed to dereference it, so we can
- ignore this constraint. When we handle pointer subtraction,
+ ignore this constraint. When we handle pointer subtraction,
we may have to do something cute here. */
if (maybe_lt (poly_uint64 (bitpos), get_varinfo (result.var)->fullsize)
results->safe_push (cexpr);
}
else if (results->length () == 0)
- /* Assert that we found *some* field there. The user couldn't be
+ /* Assert that we found *some* field there. The user couldn't be
accessing *only* padding. */
/* Still the user could access one past the end of an array
embedded in a struct resulting in accessing *only* padding. */
/* Dereference the constraint expression CONS, and return the result.
DEREF (ADDRESSOF) = SCALAR
DEREF (SCALAR) = DEREF
- DEREF (DEREF) = (temp = DEREF1; result = DEREF(temp))
+ DEREF (DEREF) = (temp = DEREF1; result = DEREF (temp))
This is needed so that we can handle dereferencing DEREF constraints. */
static void
point to anything by itself. That is, of course, unless it is an
integer constant being treated as a pointer, in which case, we
will return that this is really the addressof anything. This
- happens below, since it will fall into the default case. The only
+ happens below, since it will fall into the default case. The only
case we know something about an integer treated like a pointer is
when it is the NULL pointer, and then we just say it points to
NULL.
tmp.truncate (0);
}
/* We do not know whether the constructor was complete,
- so technically we have to add &NOTHING or &ANYTHING
+ so technically we have to add &NOTHING or &ANYTHING
like we do for an empty constructor as well. */
return;
}
/* Produce constraints for argument ARG of call STMT with eaf flags
FLAGS. RESULTS is array holding constraints for return value.
CALLESCAPE_ID is variable where call loocal escapes are added.
- WRITES_GLOVEL_MEMORY is true if callee may write global memory. */
+ WRITES_GLOVEL_MEMORY is true if callee may write global memory. */
static void
handle_call_arg (gcall *stmt, tree arg, vec<ce_s> *results, int flags,
rhsc.truncate (0);
vi = make_heapvar ("HEAP", true);
/* We are marking allocated storage local, we deal with it becoming
- global by escaping and setting of vars_contains_escaped_heap. */
+ global by escaping and setting of vars_contains_escaped_heap. */
DECL_EXTERNAL (vi->decl) = 0;
vi->is_global_var = 0;
/* If this is not a real malloc call assume the memory was
}
case BUILT_IN_STACK_SAVE:
case BUILT_IN_STACK_RESTORE:
- /* Nothing interesting happens. */
- return true;
+ /* Nothing interesting happens. */
+ return true;
case BUILT_IN_ALLOCA:
case BUILT_IN_ALLOCA_WITH_ALIGN:
case BUILT_IN_ALLOCA_WITH_ALIGN_AND_MAX:
return true;
}
case BUILT_IN_POSIX_MEMALIGN:
- {
+ {
tree ptrptr = gimple_call_arg (t, 0);
get_constraint_for (ptrptr, &lhsc);
do_deref (&lhsc);
}
break;
/* String / character search functions return a pointer into the
- source string or NULL. */
+ source string or NULL. */
case BUILT_IN_INDEX:
case BUILT_IN_STRCHR:
case BUILT_IN_STRRCHR:
}
return true;
/* Pure functions that return something not based on any object and
- that use the memory pointed to by their arguments (but not
+ that use the memory pointed to by their arguments (but not
transitively). */
case BUILT_IN_STRCMP:
case BUILT_IN_STRCMP_EQ:
}
}
/* In IPA mode, we need to generate constraints to pass call
- arguments through their calls. There are two cases,
+ arguments through their calls. There are two cases,
either a GIMPLE_CALL returning a value, or just a plain
GIMPLE_CALL when we are not.
|| (TREE_CODE (tem) == MEM_REF
&& !(TREE_CODE (TREE_OPERAND (tem, 0)) == ADDR_EXPR
&& auto_var_in_fn_p
- (TREE_OPERAND (TREE_OPERAND (tem, 0), 0), fn->decl))))
+ (TREE_OPERAND (TREE_OPERAND (tem, 0), 0), fn->decl))))
{
struct constraint_expr lhsc, *rhsp;
unsigned i;
|| (TREE_CODE (tem) == MEM_REF
&& !(TREE_CODE (TREE_OPERAND (tem, 0)) == ADDR_EXPR
&& auto_var_in_fn_p
- (TREE_OPERAND (TREE_OPERAND (tem, 0), 0), fn->decl))))
+ (TREE_OPERAND (TREE_OPERAND (tem, 0), 0), fn->decl))))
{
struct constraint_expr lhs, *rhsp;
unsigned i;
typedef struct fieldoff fieldoff_s;
-/* qsort comparison function for two fieldoff's PA and PB */
+/* qsort comparison function for two fieldoff's PA and PB. */
static int
fieldoff_compare (const void *pa, const void *pb)
const shared_bitmap_info *);
};
-/* Hash function for a shared_bitmap_info_t */
+/* Hash function for a shared_bitmap_info_t. */
inline hashval_t
shared_bitmap_hasher::hash (const shared_bitmap_info *bi)
return bi->hashcode;
}
-/* Equality function for two shared_bitmap_info_t's. */
+/* Equality function for two shared_bitmap_info_t's. */
inline bool
shared_bitmap_hasher::equal (const shared_bitmap_info *sbi1,
|| pt->nonlocal
|| pt->vars_contains_nonlocal
/* The following is a hack to make the malloc escape hack work.
- In reality we'd need different sets for escaped-through-return
+ In reality we'd need different sets for escaped-through-return
and escaped-to-callees and passes would need to be updated. */
|| pt->vars_contains_escaped_heap)
return true;
process_constraint (new_constraint (lhs, rhs));
}
-/* Initialize things necessary to perform PTA */
+/* Initialize things necessary to perform PTA. */
static void
init_alias_vars (void)
}
/* Do not overwrite existing cliques (that includes clique, base
- pairs we just set). */
+ pairs we just set). */
if (MR_DEPENDENCE_CLIQUE (base) == 0)
{
MR_DEPENDENCE_CLIQUE (base) = clique;
maybe_set_dependence_info);
if (used)
{
- /* Add all subvars to the set of restrict pointed-to set. */
+ /* Add all subvars to the set of restrict pointed-to set. */
for (unsigned sv = restrict_var->head; sv != 0;
sv = get_varinfo (sv)->next)
bitmap_set_bit (rvars, sv);
= { true, false, false, false, false, false,
false, false, false, false, false, NULL };
-/* Associate node with varinfo DATA. Worker for
+/* Associate node with varinfo DATA. Worker for
cgraph_for_symbol_thunks_and_aliases. */
static bool
associate_varinfo_to_alias (struct cgraph_node *node, void *data)
varinfo_t vi = get_vi_for_tree (var->decl);
/* For the purpose of IPA PTA unit-local globals are not
- escape points. */
+ escape points. */
bool nonlocal_p = (DECL_EXTERNAL (var->decl)
|| TREE_PUBLIC (var->decl)
|| var->used_from_other_partition
}
}
/* As well as global variables which are another way of passing
- arguments to recursive invocations. */
+ arguments to recursive invocations. */
else if (fi->is_global_var)
{
for (varinfo_t ai = fi; ai; ai = vi_next (ai))
{
*gimple_call_clobber_set (stmt)
= find_what_var_points_to
- (node->decl, first_vi_for_offset (fi, fi_clobbers));
+ (node->decl, first_vi_for_offset (fi, fi_clobbers));
*gimple_call_use_set (stmt)
= find_what_var_points_to
- (node->decl, first_vi_for_offset (fi, fi_uses));
+ (node->decl, first_vi_for_offset (fi, fi_uses));
}
/* Handle direct calls to external functions. */
else if (decl && (!fi || fi->decl))
}
pt = gimple_call_clobber_set (stmt);
- if (gimple_call_flags (stmt) & (ECF_CONST|ECF_PURE|ECF_NOVOPS))
+ if (gimple_call_flags (stmt) &
+ (ECF_CONST|ECF_PURE|ECF_NOVOPS))
memset (pt, 0, sizeof (struct pt_solution));
else if ((vi = lookup_call_clobber_vi (stmt)) != NULL)
{
fn->gimple_df->ipa_pta = true;
/* We have to re-set the final-solution cache after each function
- because what is a "global" is dependent on function context. */
+ because what is a "global" is dependent on function context. */
final_solutions->empty ();
obstack_free (&final_solutions_obstack, NULL);
gcc_obstack_init (&final_solutions_obstack);