aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-07-07 15:26:49 +0100
committerGinger Bill <bill@gingerbill.org>2017-07-07 15:26:49 +0100
commit773cf5ca08de0476b0b8b1ae4c25ac6da62a8059 (patch)
tree203717ab20c5772f5b4ae720ed8f92df504f6340 /src/ir.cpp
parent2db03cb4a54eaa594ca0d3ccb6819a8d56e7efed (diff)
Add `-show-timings`; Clean up polymorphic procedure code a bit
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp8
1 files changed, 4 insertions, 4 deletions
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);