using namespace pointer_analysis;
-/* Used for predecessor bitmaps. */
+/* Used for predecessor bitmaps. */
static bitmap_obstack predbitmap_obstack;
/* Used for per-solver-iteration bitmaps. */
nodes in the variable map. */
unsigned int size;
- /* Explicit successors of each node. */
+ /* Explicit successors of each node. */
bitmap *succs;
/* Implicit predecessors of each node (Used for variable
int *indirect_cycles;
/* Representative node for a node. rep[a] == a unless the node has
- been unified. */
+ been unified. */
unsigned int *rep;
/* Equivalence class representative for a label. This is used for
&& constraint_expr_equal (a.rhs, b.rhs);
}
-/* Find a constraint LOOKFOR in the sorted constraint vector VEC */
+/* Find a constraint LOOKFOR in the sorted constraint vector VEC. */
static constraint_t
constraint_vec_find (vec<constraint_t> vec,
process. */
static bool
-set_union_with_increment (bitmap to, bitmap delta, HOST_WIDE_INT inc,
- bitmap *expanded_delta)
+set_union_with_increment (bitmap to, bitmap delta, HOST_WIDE_INT inc,
+ bitmap *expanded_delta)
{
bool changed = false;
bitmap_iterator bi;
/* Condense two variable nodes into a single variable node, by moving
- all associated info from FROM to TO. Returns true if TO node's
+ all associated info from FROM to TO. Returns true if TO node's
constraint set changes after the merge. */
static bool
gcc_checking_assert (find (from) == to);
- /* Move all complex constraints from src node into to node */
+ /* Move all complex constraints from src node into to node. */
FOR_EACH_VEC_ELT (graph->complex[from], i, c)
{
/* In complex constraints for node FROM, we may have either
bitmap_set_bit (changed, to);
}
- /* Mark TO as changed if FROM was changed. If TO was already marked
+ /* Mark TO as changed if FROM was changed. If TO was already marked
as changed, decrease the changed count. */
if (update_changed
t = find (v->id);
- if (solve_add_graph_edge (graph, t, rhs))
+ if (solve_add_graph_edge (graph, t, rhs))
bitmap_set_bit (changed, t);
}
node_mapping[i] = i;
}
-/* Free an SCC info structure pointed to by SI */
+/* Free an SCC info structure pointed to by SI. */
scc_info::~scc_info ()
{
unsigned int size = graph->size;
scc_info si (size);
- for (i = 0; i < MIN (LAST_REF_NODE, size); i ++ )
+ for (i = 0; i < MIN (LAST_REF_NODE, size); i++)
if (!bitmap_bit_p (si.visited, i) && find (i) == i)
scc_visit (graph, &si, i);
}
classes. */
static hash_table<equiv_class_hasher> *location_equiv_class_table;
-/* Hash function for a equiv_class_label_t */
+/* Hash function for a equiv_class_label_t. */
inline hashval_t
equiv_class_hasher::hash (const equiv_class_label *ecl)
static cycles, and single entry subgraphs, in the constraint graph.
The technique is described in "Exploiting Pointer and Location
- Equivalence to Optimize Pointer Analysis. In the 14th International
+ Equivalence to Optimize Pointer Analysis. In the 14th International
Static Analysis Symposium (SAS), August 2007." It is known as the
"HU" algorithm, and is equivalent to value numbering the collapsed
constraint graph including evaluating unions.
if (!bitmap_bit_p (si->visited, w))
label_visit (graph, si, w);
- /* Skip unused edges */
+ /* Skip unused edges. */
if (w == n || graph->pointer_label[w] == 0)
continue;
if (from < FIRST_REF_NODE)
fprintf (file, "\"%s\"", get_varinfo (from)->name);
else
- fprintf (file, "\"*%s\"", get_varinfo (from - FIRST_REF_NODE)->name);
+ fprintf (file, "\"*%s\"",
+ get_varinfo (from - FIRST_REF_NODE)->name);
fprintf (file, " -> ");
if (i < FIRST_REF_NODE)
fprintf (file, "\"%s\"", get_varinfo (i)->name);
}
bitmap_clear (si->visited);
- /* Actually the label the nodes for pointer equivalences */
+ /* Actually the label the nodes for pointer equivalences. */
for (i = 1; i < FIRST_REF_NODE; i++)
if (!bitmap_bit_p (si->visited, si->node_mapping[i]))
label_visit (graph, si, si->node_mapping[i]);
/* We can't touch the solution set and call unify_nodes
at the same time, because unify_nodes is going to do
- bitmap unions into it. */
+ bitmap unions into it. */
EXECUTE_IF_SET_IN_BITMAP (get_varinfo (node)->solution, 0, i, bi)
{
solution = vi->solution;
solution_empty = bitmap_empty_p (solution);
- /* Process the complex constraints */
+ /* Process the complex constraints. */
hash_set<constraint_t> *cvisited = nullptr;
if (flag_checking)
cvisited = new hash_set<constraint_t>;
find_indirect_cycles (graph);
/* Implicit nodes and predecessors are no longer necessary at this
- point. */
+ point. */
remove_preds_and_fake_succs (graph);
if (dump_file && (dump_flags & TDF_GRAPH))
variables it ends up referring to.
IOW, in a deref constraint, we would deref, get the result set,
- then add OFFSET to each member. */
+ then add OFFSET to each member. */
HOST_WIDE_INT offset;
};
typedef struct constraint_expr ce_s;
struct variable_info
{
- /* ID of this variable */
+ /* ID of this variable. */
unsigned int id;
/* True if this is a variable created by the constraint analysis, such as
/* The ID of the variable for the first field in this structure. */
unsigned head;
- /* Offset of this variable, in bits, from the base variable */
+ /* Offset of this variable, in bits, from the base variable. */
unsigned HOST_WIDE_INT offset;
/* Size of the variable, in bits. */
function recursively. Zero if none is needed. */
unsigned int shadow_var_uid;
- /* Name of this variable */
+ /* Name of this variable. */
const char *name;
/* Tree that this variable is associated with. */
extern unsigned int *var_rep;
-/* Return the varmap element N */
+/* Return the varmap element N. */
inline varinfo_t
get_varinfo (unsigned int n)