aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-10-27 18:44:28 +0100
committergingerBill <bill@gingerbill.org>2018-10-27 18:44:28 +0100
commit2ddb27869bd704d28e4704648c26b17d00ba2ff5 (patch)
tree2059d031bcfb8d4c448448f90dada2bc85358ce2 /src/ir_print.cpp
parent5c608b01ba8b445511690fe499b811bb2ea15dbe (diff)
Built-in procedure `#defined`
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 7c01d6a46..177ae0aa1 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -221,9 +221,10 @@ bool ir_print_debug_location(irFileBuffer *f, irModule *m, irValue *v) {
GB_ASSERT(v->kind == irValue_Instr);
if (v->loc != nullptr) {
- GB_ASSERT(v->loc->kind == irDebugInfo_Location);
- ir_fprintf(f, ", !dbg !%d", v->loc->id);
- return true;
+ if (v->loc->kind == irDebugInfo_Location) {
+ ir_fprintf(f, ", !dbg !%d", v->loc->id);
+ return true;
+ }
} else {
irProcedure *proc = v->Instr.block->proc;
GB_ASSERT(proc->is_entry_point || (string_compare(proc->name, str_lit(IR_STARTUP_RUNTIME_PROC_NAME)) == 0));
@@ -1812,7 +1813,7 @@ void ir_print_instr(irFileBuffer *f, irModule *m, irValue *value) {
irDebugInfo **lookup_di = map_get(&m->debug_info, hash_entity(e));
GB_ASSERT_NOT_NULL(*lookup_di);
irDebugInfo* local_var_di = *lookup_di;
-
+
ir_write_str_lit(f, "call void @llvm.dbg.declare(");
ir_write_str_lit(f, "metadata ");
ir_print_type(f, m, vt);