2 * Copyright (c) 2000-2001
3 * The Regents of the University of California. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the University nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 #include "setif-var.h"
40 struct setif_term
/* extends gen_e */
49 typedef struct setif_term
*setif_term
;
51 extern bool flag_merge_projections
;
52 extern bool flag_eliminate_cycles
;
54 extern region setif_region
;
55 extern term_hash setif_hash
;
57 typedef bool (*res_proj_fn_ptr
) (setif_var v
,gen_e proj
) deletes
;
58 typedef gen_e (*proj_con_fn_ptr
) (gen_e
) deletes
;
60 stamp
setif_get_stamp(gen_e e
);
61 void setif_inclusion(con_match_fn_ptr
,res_proj_fn_ptr
, gen_e
, gen_e
) deletes
;
63 bool setif_proj_merge(setif_var v
, gen_e se
, get_proj_fn_ptr get_proj
,
64 proj_con_fn_ptr make_proj
,fresh_large_fn_ptr fresh_var
,
65 incl_fn_ptr sort_incl
, incl_fn_ptr set_incl
) deletes
;
67 gen_e
setif_zero(void);
68 gen_e
setif_one(void);
69 gen_e
setif_fresh(const char *name
);
70 gen_e
setif_fresh_large(const char *name
);
71 gen_e
setif_fresh_small(const char *name
);
72 gen_e
setif_constant(const char *name
) deletes
;
73 gen_e
setif_union(gen_e_list exprs
) deletes
;
74 gen_e
setif_inter(gen_e_list exprs
) deletes
;
75 bool setif_is_zero(gen_e e
);
76 bool setif_is_one(gen_e e
);
77 bool setif_is_var(gen_e e
);
78 bool setif_is_union(gen_e e
);
79 bool setif_is_inter(gen_e e
);
80 bool setif_is_constant(gen_e e
);
81 char *setif_get_constant_name(gen_e e
);
83 gen_e_list
setif_get_union(gen_e e
);
84 gen_e_list
setif_get_inter(gen_e e
);
86 gen_e_list
setif_tlb(gen_e e
) deletes
;
88 void setif_set_proj_cache(gen_e e
, gen_e elem
);
89 gen_e_list
setif_get_proj_cache(gen_e e
);
91 void setif_init(void);
92 void setif_reset(void) deletes
;
93 void setif_print_stats(FILE *f
);
94 void setif_print_constraint_graph(FILE *f
);
96 extern struct setif_stats setif_stats
;
103 int distinct_constructors
;
104 int hashed_constructors
;
105 int distinct_constants
;
106 int hashed_constants
;
110 int distinct_intersections
;
111 int filtered_intersections
;
112 int hashed_intersections
;
116 int redundant_source
;
124 int cycles_searched_forward
;
125 int cycles_searched_backward
;
127 int cycles_collapsed_forward
;
128 int cycles_collapsed_backward
;
130 int cycles_length_forward
;
131 int cycles_length_backward
;
134 #endif /* SETIF_SORT_H */