diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-01-22 22:02:07 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-01-22 22:02:07 -0700 |
| commit | 523e3b86af44b97bcf68e3eb0956ef297421ee10 (patch) | |
| tree | 61b3743aced3715ebc8f811cc3477fca45d0ad20 /src/codegen.cpp | |
| parent | 21fc5a6402c527675900397ea60f107730985f1c (diff) | |
| download | zig-523e3b86af44b97bcf68e3eb0956ef297421ee10.tar.gz zig-523e3b86af44b97bcf68e3eb0956ef297421ee10.zip | |
support statically initialized array literal
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
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; } |
