summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bedump.h
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2014-11-22 19:53:55 +0100
committerChristoph Mallon <mallon@cs.uni-saarland.de>2014-11-27 16:58:09 +0100
commita1855e226bfda3776be35e2de0ea2484014316e1 (patch)
tree581606032b9d69c7afd0ed8ed82b4ab319327b27 /ir/be/bedump.h
parentb745f81b62262c13dd5c9837a97427389df5eda4 (diff)
be: Factorise common dump formatters for booleans and registers.
This replaces several 1/0 and true/false by yes/no.
Diffstat (limited to 'ir/be/bedump.h')
-rw-r--r--ir/be/bedump.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/ir/be/bedump.h b/ir/be/bedump.h
index 6b0ce38..132c0ca 100644
--- a/ir/be/bedump.h
+++ b/ir/be/bedump.h
@@ -13,8 +13,8 @@
#include <stdio.h>
#include <stdbool.h>
-#include "firm_types.h"
-#include "be_types.h"
+
+#include "bearch.h"
/**
* Dump interference graph
@@ -42,4 +42,14 @@ void be_dump_liveness_block(be_lv_t *lv, FILE *F, const ir_node *block);
void be_dump_reqs_and_registers(FILE *F, const ir_node *node);
+static inline char const *be_dump_reg_name(arch_register_t const *const reg)
+{
+ return reg ? reg->name : "n/a";
+}
+
+static inline char const *be_dump_yesno(bool const b)
+{
+ return b ? "yes" : "no";
+}
+
#endif