2 * Author: Matthias Braun
4 * Copyright: (c) Universitaet Karlsruhe
5 * License: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
7 #ifndef BESPILLMORGAN_H_
8 #define BESPILLMORGAN_H_
17 /* framework for emitting data (usually the final assembly code) */
19 typedef struct be_emit_env_t {
25 static INLINE void be_emit_char(be_emit_env_t *env, char c)
27 obstack_1grow(&env->obst, c);
31 static INLINE void be_emit_string_len(be_emit_env_t *env, const char *str,
34 obstack_grow(&env->obst, str, l);
38 static INLINE void be_emit_string(be_emit_env_t *env, const char *str)
40 size_t len = strlen(str);
41 be_emit_string_len(env, str, len);
44 #define be_emit_cstring(env,x) { be_emit_string_len(env, x, sizeof(x)-1); }
46 void be_emit_init_env(be_emit_env_t *env, FILE *F);
47 void be_emit_destroy_env(be_emit_env_t *env);
49 void be_emit_ident(be_emit_env_t *env, ident *id);
50 void be_emit_irprintf(be_emit_env_t *env, const char *fmt, ...);
51 void be_emit_irvprintf(be_emit_env_t *env, const char *fmt, va_list args);
52 void be_emit_write_line(be_emit_env_t *env);
54 /* appends a gas-style comment with the node number and writes the line */
55 void be_emit_finish_line_gas(be_emit_env_t *env, const ir_node *node);
56 void be_emit_pad_comment(be_emit_env_t *env);