summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beemitter.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-02-08 04:58:42 +0100
committerMatthias Braun <matze@braunis.de>2016-02-08 05:00:27 +0100
commita6aacda304195e4097a0fa120baab462abcbaa83 (patch)
treec45be0be89226b181fd08a0aa8f69e46738bc793 /ir/be/beemitter.c
parentfeb0f2ad5a8d87dd82179919b40ef2f621b4b231 (diff)
beemitter: Move helper function to beemithlp
Only keep the basics necessary to emit text lines in beemitter.[ch] and move all the other convenience stuff to beemithlp.[ch].
Diffstat (limited to 'ir/be/beemitter.c')
-rw-r--r--ir/be/beemitter.c57
1 files changed, 1 insertions, 56 deletions
diff --git a/ir/be/beemitter.c b/ir/be/beemitter.c
index ce1f0c5..f267727 100644
--- a/ir/be/beemitter.c
+++ b/ir/be/beemitter.c
@@ -9,17 +9,10 @@
* @author Matthias Braun
* @date 12.03.2007
*/
-#include "bedwarf.h"
#include "beemitter.h"
-#include "benode.h"
-#include "be_t.h"
-#include "debug.h"
+
#include "panic.h"
-#include "irnode_t.h"
#include "irprintf.h"
-#include "tv.h"
-#include "dbginfo.h"
-#include "util.h"
static FILE *emit_file;
struct obstack emit_obst;
@@ -55,51 +48,3 @@ void be_emit_write_line(void)
fwrite(line, 1, len, emit_file);
obstack_free(&emit_obst, line);
}
-
-void be_emit_pad_comment(void)
-{
- size_t len = obstack_object_size(&emit_obst);
- len = MIN(len, 30);
- /* 34 spaces */
- be_emit_string_len(" ", 34 - len);
-}
-
-void be_emit_finish_line_gas(const ir_node *node)
-{
- if (node && be_options.verbose_asm) {
- be_emit_pad_comment();
- dbg_info *const dbg = get_irn_dbg_info(node);
- src_loc_t const loc = ir_retrieve_dbg_info(dbg);
- char const *const fmt =
- !loc.file ? "/* %+F */\n" :
- loc.line == 0 ? "/* %+F %s */\n" :
- loc.column == 0 ? "/* %+F %s:%u */\n" :
- /* */ "/* %+F %s:%u:%u */\n";
- be_emit_irprintf(fmt, node, loc.file, loc.line, loc.column);
- } else {
- be_emit_char('\n');
- }
- be_emit_write_line();
-}
-
-void be_init_emitters(void)
-{
- ir_clear_opcodes_generic_func();
- be_set_emitter(op_Phi, be_emit_nothing);
- be_set_emitter(op_be_Keep, be_emit_nothing);
- be_set_emitter(op_be_Start, be_emit_nothing);
-}
-
-void be_emit_nothing(ir_node const *const node)
-{
- (void)node;
-}
-
-void be_emit_node(ir_node const *const node)
-{
- be_dwarf_location(get_irn_dbg_info(node));
- ir_op *const op = get_irn_op(node);
- emit_func *const emit = get_generic_function_ptr(emit_func, op);
- DEBUG_ONLY(if (!emit) panic("no emit handler for node %+F (%+G, graph %+F)", node, node, get_irn_irg(node));)
- emit(node);
-}