summaryrefslogtreecommitdiffhomepage
path: root/ir/be/begnuas.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/begnuas.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/begnuas.c')
-rw-r--r--ir/be/begnuas.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ir/be/begnuas.c b/ir/be/begnuas.c
index 6cd6f14..17a193a 100644
--- a/ir/be/begnuas.c
+++ b/ir/be/begnuas.c
@@ -19,8 +19,10 @@
#include "be_t.h"
#include "bearch.h"
#include "bedwarf.h"
+#include "beemithlp.h"
#include "beemitter.h"
#include "bemodule.h"
+#include "dbginfo.h"
#include "entity_t.h"
#include "execfreq.h"
#include "iredges_t.h"
@@ -1705,6 +1707,24 @@ void be_gas_end_compilation_unit(const be_main_env_t *env)
be_dwarf_close();
}
+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();
+}
+
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_gas)
void be_init_gas(void)
{