From 2dd85d52cc4c4c6a32704f187b41a06401400f0c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 11 Dec 2016 00:13:43 -0500 Subject: IR: fix implementation of parseh libc hello world works now --- src/codegen.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index c828b42ed1..e3e162173b 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1868,12 +1868,16 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable, case IrInstructionIdSizeOf: case IrInstructionIdSwitchTarget: case IrInstructionIdStaticEval: - case IrInstructionIdImport: case IrInstructionIdContainerInitFields: case IrInstructionIdMinValue: case IrInstructionIdMaxValue: case IrInstructionIdCompileErr: case IrInstructionIdArrayLen: + case IrInstructionIdImport: + case IrInstructionIdCImport: + case IrInstructionIdCInclude: + case IrInstructionIdCDefine: + case IrInstructionIdCUndef: zig_unreachable(); case IrInstructionIdReturn: return ir_render_return(g, executable, (IrInstructionReturn *)instruction); @@ -2346,7 +2350,7 @@ static void do_code_gen(CodeGen *g) { assert(var->decl_node->type == NodeTypeVariableDeclaration); LLVMValueRef global_value; - if (var->decl_node->data.variable_declaration.is_extern) { + if (var->is_extern) { global_value = LLVMAddGlobal(g->module, var->type->type_ref, buf_ptr(&var->name)); // TODO debug info for the extern variable -- cgit v1.2.3