isl_tab_relax: prevent relaxation on dead or redundant constraints
[platform/upstream/isl.git] / print_templ.c
1 #define xCAT(A,B) A ## B
2 #define CAT(A,B) xCAT(A,B)
3 #undef TYPE
4 #define TYPE CAT(isl_,BASE)
5 #define xFN(TYPE,NAME) TYPE ## _ ## NAME
6 #define FN(TYPE,NAME) xFN(TYPE,NAME)
7
8 void FN(TYPE,dump)(__isl_keep TYPE *obj)
9 {
10         isl_printer *p;
11
12         if (!obj)
13                 return;
14         p = isl_printer_to_file(FN(TYPE,get_ctx)(obj), stderr);
15         p = FN(isl_printer_print,BASE)(p, obj);
16         p = isl_printer_end_line(p);
17         isl_printer_free(p);
18 }
19
20 __isl_give char *FN(TYPE,to_str)(__isl_keep TYPE *obj)
21 {
22         isl_printer *p;
23         char *s;
24
25         if (!obj)
26                 return NULL;
27         p = isl_printer_to_str(FN(TYPE,get_ctx)(obj));
28         p = FN(isl_printer_print,BASE)(p, obj);
29         s = isl_printer_get_str(p);
30         isl_printer_free(p);
31
32         return s;
33 }