From 523e3b86af44b97bcf68e3eb0956ef297421ee10 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 22 Jan 2016 22:02:07 -0700 Subject: support statically initialized array literal --- src/codegen.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index 467740e946..6a5008b94e 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2105,13 +2105,6 @@ static LLVMValueRef gen_const_val(CodeGen *g, TypeTableEntry *type_entry, ConstE return tag_value; } else { zig_panic("TODO"); - /* - LLVMValueRef fields[] = { - tag_value, - union_value, - }; - return LLVMConstStruct(fields, 2, false); - */ } } else if (type_entry->id == TypeTableEntryIdFn) { return const_val->data.x_fn->fn_value; @@ -2197,10 +2190,11 @@ static void do_code_gen(CodeGen *g) { } else { init_val = LLVMConstNull(var->type->type_ref); } - LLVMValueRef global_value = LLVMAddGlobal(g->module, LLVMTypeOf(init_val), ""); + LLVMValueRef global_value = LLVMAddGlobal(g->module, LLVMTypeOf(init_val), buf_ptr(&var->name)); LLVMSetInitializer(global_value, init_val); LLVMSetGlobalConstant(global_value, var->is_const); LLVMSetUnnamedAddr(global_value, true); + LLVMSetLinkage(global_value, LLVMInternalLinkage); var->value_ref = global_value; } -- cgit v1.2.3