summaryrefslogtreecommitdiff
path: root/asm/exprlib.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2017-02-28 18:13:43 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2017-02-28 18:13:43 -0800
commita5a56bd11758dd259d4370e388860012ec09f957 (patch)
tree2f7ff46ccb7902f1b33171005d58f1a7c5338228 /asm/exprlib.c
parent4d58a8fef5fd5d492a76521a5b4446f64069d2e2 (diff)
downloadnasm-a5a56bd11758dd259d4370e388860012ec09f957.tar.gz
exprlib: move dumping code to a separate C file
Most of the time we don't need the dumping code, so move it to a separate C file to the linker can exclude it. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'asm/exprlib.c')
-rw-r--r--asm/exprlib.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/asm/exprlib.c b/asm/exprlib.c
index a0a666ce..f7cfbcee 100644
--- a/asm/exprlib.c
+++ b/asm/exprlib.c
@@ -198,45 +198,3 @@ bool is_self_relative(const expr *vect)
return false;
}
-
-/*
- * Debug support: dump a description of an expression vector to stdout
- */
-static const char *expr_type(int32_t type)
-{
- static char seg_str[64];
-
- switch (type) {
- case 0:
- return "null";
- case EXPR_UNKNOWN:
- return "unknown";
- case EXPR_SIMPLE:
- return "simple";
- case EXPR_WRT:
- return "wrt";
- case EXPR_RDSAE:
- return "sae";
- default:
- break;
- }
-
- if (type >= EXPR_REG_START && type <= EXPR_REG_END) {
- return nasm_reg_names[type - EXPR_REG_START];
- } else if (type >= EXPR_SEGBASE) {
- snprintf(seg_str, sizeof seg_str, "%sseg %d",
- (type - EXPR_SEGBASE) == location.segment ? "this " : "",
- type - EXPR_SEGBASE);
- return seg_str;
- } else {
- return "ERR";
- }
-}
-
-void dump_expr(const expr *e)
-{
- printf("[");
- for (; e->type; e++)
- printf("<%s(%d),%"PRId64">", expr_type(e->type), e->type, e->value);
- printf("]\n");
-}