From 23b07ad8d25809baa3169f64d9c7be980501352d Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 4 Oct 2018 14:32:55 -0400 Subject: refactor ir.cpp Analysis functions no longer return `ZigType *`. Instead they return `IrInstruction *`. --- src/codegen.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index de69b53388..e792fd77aa 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -7279,10 +7279,15 @@ static void init(CodeGen *g) { define_builtin_types(g); - g->invalid_instruction = allocate(1); + IrInstruction *sentinel_instructions = allocate(2); + g->invalid_instruction = &sentinel_instructions[0]; g->invalid_instruction->value.type = g->builtin_types.entry_invalid; g->invalid_instruction->value.global_refs = allocate(1); + g->unreach_instruction = &sentinel_instructions[1]; + g->unreach_instruction->value.type = g->builtin_types.entry_unreachable; + g->unreach_instruction->value.global_refs = allocate(1); + g->const_void_val.special = ConstValSpecialStatic; g->const_void_val.type = g->builtin_types.entry_void; g->const_void_val.global_refs = allocate(1); -- cgit v1.2.3