From 773cf5ca08de0476b0b8b1ae4c25ac6da62a8059 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Fri, 7 Jul 2017 15:26:49 +0100 Subject: Add `-show-timings`; Clean up polymorphic procedure code a bit --- src/ir.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index d74307c81..9335a71fd 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -1249,8 +1249,8 @@ irValue *ir_add_module_constant(irModule *m, Type *type, ExactValue value) { irValue *ir_add_global_string_array(irModule *m, String string) { // TODO(bill): Should this use the arena allocator or the heap allocator? // Strings could be huge! - gbAllocator a = m->allocator; - // gbAllocator a = gb_heap_allocator(); + // gbAllocator a = m->allocator; + gbAllocator a = gb_heap_allocator(); isize max_len = 6+8+1; u8 *str = cast(u8 *)gb_alloc_array(a, u8, max_len); @@ -1260,12 +1260,12 @@ irValue *ir_add_global_string_array(irModule *m, String string) { String name = make_string(str, len-1); Token token = {Token_String}; token.string = name; - Type *type = make_type_array(a, t_u8, string.len); + Type *type = make_type_array(a, t_u8, string.len+1); ExactValue ev = exact_value_string(string); Entity *entity = make_entity_constant(a, nullptr, token, type, ev); irValue *g = ir_value_global(a, entity, ir_add_module_constant(m, type, ev)); g->Global.is_private = true; - // g->Global.is_unnamed_addr = true; + g->Global.is_unnamed_addr = true; // g->Global.is_constant = true; ir_module_add_value(m, entity, g); -- cgit v1.2.3