summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaximilian Stemmer-Grabow <mail@mxsg.de>2021-05-26 14:23:00 +0200
committerAndreas Fried <andreas.fried@kit.edu>2021-12-02 12:57:28 +0100
commite34de48121f30fce7d5a6d0294eb0d01e3c96d4c (patch)
tree76b67d0f4d5034e48c8d0102d478eb7984fce8e3
parent2b067ecb799e4ba6ce72a971ade5039e456e57e4 (diff)
Output backend notes on nodes in verbose assembler output
-rw-r--r--ir/be/begnuas.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/ir/be/begnuas.c b/ir/be/begnuas.c
index 17f7adf..88d31fc 100644
--- a/ir/be/begnuas.c
+++ b/ir/be/begnuas.c
@@ -1677,14 +1677,32 @@ void be_emit_finish_line_gas(const ir_node *node)
{
if (node && be_options.verbose_asm) {
be_emit_pad_comment();
+
+ char* note = NULL;
+ backend_info_t *be_info = be_get_info(node);
+ if (be_info) {
+ note = be_info->note;
+ }
+
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);
+
+ if (note) {
+ char const *const fmt =
+ !loc.file ? "/* %+F %s */\n" :
+ loc.line == 0 ? "/* %+F %s %s */\n" :
+ loc.column == 0 ? "/* %+F %s %s:%u */\n" :
+ /* */ "/* %+F %s %s:%u:%u */\n";
+ be_emit_irprintf(fmt, node, note, loc.file, loc.line, loc.column);
+ }
+ else {
+ 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');
}