PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "genC.h"
#include "text.h"
#include "text-util.h"
#include "top-level.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "effects-util.h"
#include "misc.h"
Go to the source code of this file.
Functions | |
int | cell_reference_compare (reference *pr1, reference *pr2) |
compare.c More... | |
int | cell_compare (cell *c1, cell *c2) |
int | effect_compare (effect *peff1, effect *peff2) |
Compares two effects for sorting. More... | |
int | compare_effect_reference (effect *e1, effect *e2) |
int compare_effect_reference(e1, e2): More... | |
int | compare_effect_reference_in_common (effect *e1, effect *e2) |
int compare_effect_reference_in_common(e1, e2): More... | |
int | pointer_value_compare (cell_relation *ppv1, cell_relation *ppv2) |
Compares two pointer values for sorting. More... | |
int | is_inferior_cell_descriptor_pvarval (Pvecteur *pvarval1, Pvecteur *pvarval2) |
weight function for Pvecteur passed as argument to sc_lexicographic_sort in prettyprint functions involving cell descriptors. More... | |
c1 | 1 |
c2 | 2 |
Definition at line 168 of file compare.c.
References cell_gap_p, cell_reference, cell_reference_compare(), and pips_assert.
Referenced by effect_compare(), pointer_value_compare(), pv_cells_mergeable_p(), pv_cells_syntactically_equal_p(), pvs_union_combinable_p(), simple_pv_may_union(), and simple_pv_must_union().
result
same entity, sort on indices values
not same entity, sort on entity name
sort on module name
if same module name: sort on entity local name
else: current module and top_level come first, then others in lexicographic order
pr1 | r1 |
pr2 | r2 |
Definition at line 54 of file compare.c.
References CAR, current_mod, ENDP, entity_module_name(), entity_name, entity_user_name(), EXPRESSION, expression_integer_value(), expression_syntax, expression_to_string(), free(), gen_length(), get_current_module_entity(), intptr_t, module, module_local_name(), POP, reference_indices, reference_variable, s1, same_entity_p(), strdup(), syntax_reference, syntax_reference_p, top_level_entity_p(), and unbounded_expression_p().
Referenced by cell_compare(), and compare_effect_reference().
int compare_effect_reference(e1, e2):
returns -1 if "e1" is before "e2" in the alphabetic order, else +1. "e1" and "e2" are pointers to effect, we compare the names of their reference's entity.
e1 | 1 |
e2 | 2 |
Definition at line 210 of file compare.c.
References cell_reference_compare(), and effect_any_reference.
Referenced by create_step_regions(), and internal_compute_distribution_context().
int compare_effect_reference_in_common(e1, e2):
returns -1 if "e1" is before "e2" in the alphabetic order, else +1. "e1" and "e2" are pointers to effect, we compare the names of their reference's entity with the common name in first if the entity belongs to a common
e1 | 1 |
e2 | 2 |
Definition at line 224 of file compare.c.
References effect_any_reference, entity_and_common_name(), entity_in_common_p(), entity_name, free(), reference_variable, and strdup().
Compares two effects for sorting.
The first criterion is based on names. Local entities come first; then they are sorted according to the lexicographic order of the module name, and inside each module name class, according to the local name lexicographic order. Then for a given entity name, a read effect comes before a write effect. It is assumed that there is only one effect of each type per entity. bc.
same paths, sort on action, reads first
peff1 | eff1 |
peff2 | eff2 |
Definition at line 187 of file compare.c.
References cell_compare(), effect_cell, and effect_read_p.
weight function for Pvecteur passed as argument to sc_lexicographic_sort in prettyprint functions involving cell descriptors.
The strange argument type is required by qsort(), deep down in the calls. This function is an adaptation of is_inferior_pvarval in semantics
The constant term is given the highest weight to push constant terms at the end of the constraints and to make those easy to compare. If not, constant 0 will be handled differently from other constants. However, it would be nice to give constant terms the lowest weight to print simple constraints first...
Either I define two comparison functions, or I cheat somewhere else. Let's cheat?
pvarval1 | varval1 |
pvarval2 | varval2 |
Definition at line 305 of file compare.c.
References entity_name, term_cst, variable_phi_p, and vecteur_var.
Referenced by text_pointer_value(), and text_points_to_relation().
int pointer_value_compare | ( | cell_relation * | ppv1, |
cell_relation * | ppv2 | ||
) |
Compares two pointer values for sorting.
The first criterion is based on names. Local entities come first; then they are sorted according to the lexicographic order of the module name, and inside each module name class, according to the local name lexicographic order. Then for a given entity name, a read effect comes before a write effect. It is assumed that there is only one effect of each type per entity. bc.
result
compare first references of *ppv1 and *ppv2
same first cells
put second cells value_of before address_of
both are value_of or address_of
compare second cells
ppv1 | pv1 |
ppv2 | pv2 |
Definition at line 255 of file compare.c.
References cell_compare(), cell_preference_p, cell_relation_first_cell, cell_relation_first_value_of_p, cell_relation_second_cell, cell_relation_second_value_of_p, and pips_assert.
Referenced by simple_pvs_syntactically_equal_p(), and text_pointer_values().