really keep mux intact if KEEP_MUX is enabled; cleanup and improve some Mux optimisat...
[libfirm] / ir / ir / irprintf.c
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   A little printf helper unterstanding firm types
23  * @author  Sebastian Hack
24  * @date    29.11.2004
25  * @version $Id$
26  */
27 #include "config.h"
28
29 #include <string.h>
30
31 #include <stdlib.h>
32 #include <stdio.h>
33 #include <stdarg.h>
34
35 #include <ctype.h>
36
37 #include "ident.h"
38 #include "irmode_t.h"
39 #include "irnode_t.h"
40 #include "entity_t.h"
41 #include "type_t.h"
42 #include "tv_t.h"
43 #include "irprintf.h"
44 #include "obst.h"
45 #include "pset.h"
46 #include "iterator.h"
47 #include "bitset.h"
48 #include "dbginfo_t.h"
49 #include "irargs_t.h"
50
51 void ir_printf(const char *fmt, ...)
52 {
53         va_list args;
54
55         va_start(args, fmt);
56         lc_evprintf(firm_get_arg_env(), fmt, args);
57         va_end(args);
58 }
59
60 void ir_fprintf(FILE *f, const char *fmt, ...)
61 {
62         va_list args;
63
64         va_start(args, fmt);
65         lc_evfprintf(firm_get_arg_env(), f, fmt, args);
66         va_end(args);
67 }
68
69 void ir_snprintf(char *buf, size_t n, const char *fmt, ...)
70 {
71         va_list args;
72
73         va_start(args, fmt);
74         lc_evsnprintf(firm_get_arg_env(), buf, n, fmt, args);
75         va_end(args);
76 }
77
78 void ir_vprintf(const char *fmt, va_list args)
79 {
80         lc_evprintf(firm_get_arg_env(), fmt, args);
81 }
82
83 void ir_vfprintf(FILE *f, const char *fmt, va_list args)
84 {
85         lc_evfprintf(firm_get_arg_env(), f, fmt, args);
86 }
87
88 void ir_vsnprintf(char *buf, size_t len, const char *fmt, va_list args)
89 {
90         lc_evsnprintf(firm_get_arg_env(), buf, len, fmt, args);
91 }
92
93 void ir_obst_vprintf(struct obstack *obst, const char *fmt, va_list args)
94 {
95         lc_evoprintf(firm_get_arg_env(), obst, fmt, args);
96 }