beifg: Factorise code to count interference components.
[libfirm] / ir / ir / irprintf.c
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief   A little printf helper unterstanding firm types
9  * @author  Sebastian Hack
10  * @date    29.11.2004
11  */
12 #include "config.h"
13
14 #include <string.h>
15
16 #include <stdlib.h>
17 #include <stdio.h>
18 #include <stdarg.h>
19
20 #include <ctype.h>
21
22 #include "ident.h"
23 #include "irmode_t.h"
24 #include "irnode_t.h"
25 #include "entity_t.h"
26 #include "type_t.h"
27 #include "tv_t.h"
28 #include "irprintf.h"
29 #include "obst.h"
30 #include "pset.h"
31 #include "bitset.h"
32 #include "dbginfo_t.h"
33 #include "irargs_t.h"
34
35 void ir_printf(const char *fmt, ...)
36 {
37         va_list args;
38
39         va_start(args, fmt);
40         lc_evprintf(firm_get_arg_env(), fmt, args);
41         va_end(args);
42 }
43
44 void ir_fprintf(FILE *f, const char *fmt, ...)
45 {
46         va_list args;
47
48         va_start(args, fmt);
49         lc_evfprintf(firm_get_arg_env(), f, fmt, args);
50         va_end(args);
51 }
52
53 void ir_snprintf(char *buf, size_t n, const char *fmt, ...)
54 {
55         va_list args;
56
57         va_start(args, fmt);
58         lc_evsnprintf(firm_get_arg_env(), buf, n, fmt, args);
59         va_end(args);
60 }
61
62 void ir_vprintf(const char *fmt, va_list args)
63 {
64         lc_evprintf(firm_get_arg_env(), fmt, args);
65 }
66
67 void ir_vfprintf(FILE *f, const char *fmt, va_list args)
68 {
69         lc_evfprintf(firm_get_arg_env(), f, fmt, args);
70 }
71
72 void ir_vsnprintf(char *buf, size_t len, const char *fmt, va_list args)
73 {
74         lc_evsnprintf(firm_get_arg_env(), buf, len, fmt, args);
75 }
76
77 void ir_obst_vprintf(struct obstack *obst, const char *fmt, va_list args)
78 {
79         lc_evoprintf(firm_get_arg_env(), obst, fmt, args);
80 }