aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/print_llvm.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-09-23 14:59:58 +0100
committerGinger Bill <bill@gingerbill.org>2016-09-23 14:59:58 +0100
commita31bab5aae10757f5029b00e39beb0e3815b92b1 (patch)
treeb7d2f888cc553f4d6e4b47ff1470c303c5d05c7e /src/codegen/print_llvm.cpp
parentee0aa7b9de907e70e00ca3ab891087c2ee86a31b (diff)
Unicode file loading; push_allocator & push_context
Diffstat (limited to 'src/codegen/print_llvm.cpp')
-rw-r--r--src/codegen/print_llvm.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/codegen/print_llvm.cpp b/src/codegen/print_llvm.cpp
index 313299552..9b90106df 100644
--- a/src/codegen/print_llvm.cpp
+++ b/src/codegen/print_llvm.cpp
@@ -84,8 +84,11 @@ void ssa_print_escape_string(ssaFileBuffer *f, String name, b32 print_quotes) {
char hex_table[] = "0123456789ABCDEF";
isize buf_len = name.len + extra + 2;
- u8 *buf = gb_alloc_array(gb_heap_allocator(), u8, buf_len);
- defer (gb_free(gb_heap_allocator(), buf));
+
+ gbTempArenaMemory tmp = gb_temp_arena_memory_begin(&string_buffer_arena);
+ defer (gb_temp_arena_memory_end(tmp));
+
+ u8 *buf = gb_alloc_array(string_buffer_allocator, u8, buf_len);
isize j = 0;
@@ -809,9 +812,11 @@ void ssa_print_proc(ssaFileBuffer *f, ssaModule *m, ssaProcedure *proc) {
if (proc->module->generate_debug_info && proc->entity != NULL) {
- ssaDebugInfo *di = *map_get(&proc->module->debug_info, hash_pointer(proc->entity));
- GB_ASSERT(di->kind == ssaDebugInfo_Proc);
- ssa_fprintf(f, "!dbg !%d ", di->id);
+ if (proc->body != NULL) {
+ ssaDebugInfo *di = *map_get(&proc->module->debug_info, hash_pointer(proc->entity));
+ GB_ASSERT(di->kind == ssaDebugInfo_Proc);
+ ssa_fprintf(f, "!dbg !%d ", di->id);
+ }
}