OSDN Git Service

* genattrtab.c (write_insn_cases): New function, split out from
[pf3gnuchains/gcc-fork.git] / libbanshee / engine / term-sort.h
1 /*
2  * Copyright (c) 2000-2001
3  *      The Regents of the University of California.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
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.
16  *
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
27  * SUCH DAMAGE.
28  *
29  */
30
31 #ifndef TERM_SORT_H
32 #define TERM_SORT_H
33
34 #include <stdio.h>
35 #include "banshee.h"
36 #include "termhash.h"
37 #include "term-var.h"
38
39 EXTERN_C_BEGIN
40
41 extern bool flag_occurs_check;
42 extern region term_sort_region;
43 extern term_hash term_sort_hash;
44
45 struct gen_term /* extends gen_e */
46 {
47 #ifdef NONSPEC
48   const sort_kind sort;
49 #endif
50   const int type;
51   const stamp st;
52 };
53
54 typedef struct gen_term *gen_term;
55
56 /* return TRUE if v occurs in e, fals otherwise */
57 typedef bool (* occurs_check_fn_ptr) (term_var v, gen_e e);
58
59 stamp term_get_stamp(gen_e e);
60
61 gen_e term_fresh(const char *name);
62 gen_e term_fresh_large(const char *name);
63 gen_e term_fresh_small(const char *name);
64 gen_e term_zero(void);
65 gen_e term_one(void);
66 gen_e term_constant(const char *name);
67
68 bool term_is_zero(gen_e e);
69 bool term_is_one(gen_e e);
70 bool term_is_var(gen_e e);
71 bool term_is_constant(gen_e e);
72
73 char *term_get_constant_name(gen_e e);
74 gen_e term_get_ecr(gen_e e);
75
76 void term_unify(con_match_fn_ptr con_match, occurs_check_fn_ptr occurs,
77                 gen_e e1, gen_e e2);
78 void term_cunify(con_match_fn_ptr con_match,  occurs_check_fn_ptr occurs,
79                  gen_e e1, gen_e e2);
80
81 void term_print_stats(FILE *f);
82 void term_print_constraint_graph(FILE *f);
83
84 void term_init(void);
85 void term_reset(void);
86
87 extern struct term_stats term_stats;
88
89 struct term_stats
90 {
91   int fresh;
92   int fresh_small;
93   int fresh_large;
94 };
95
96 EXTERN_C_END
97
98 #endif /* TERM_SORT_H */
99
100
101