aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-12-11 00:13:43 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-12-11 00:13:43 -0500
commit2dd85d52cc4c4c6a32704f187b41a06401400f0c (patch)
tree9bb2423234eede3297d266c151f49bf89c0a89f0 /src/codegen.cpp
parent3cfbec3eef3e5949a457120287298233978cb236 (diff)
downloadzig-2dd85d52cc4c4c6a32704f187b41a06401400f0c.tar.gz
zig-2dd85d52cc4c4c6a32704f187b41a06401400f0c.zip
IR: fix implementation of parseh
libc hello world works now
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp8
1 files changed, 6 insertions, 2 deletions
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