diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-10-04 14:32:55 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-10-04 14:33:52 -0400 |
| commit | 23b07ad8d25809baa3169f64d9c7be980501352d (patch) | |
| tree | c2ccfa4832e4c2ac5517b937487fb378a3265ace /src/codegen.cpp | |
| parent | 31469daca397b7cdb8c348932a7a3c9e27354fa5 (diff) | |
| download | zig-23b07ad8d25809baa3169f64d9c7be980501352d.tar.gz zig-23b07ad8d25809baa3169f64d9c7be980501352d.zip | |
refactor ir.cpp
Analysis functions no longer return `ZigType *`. Instead they
return `IrInstruction *`.
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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<IrInstruction>(1); + IrInstruction *sentinel_instructions = allocate<IrInstruction>(2); + g->invalid_instruction = &sentinel_instructions[0]; g->invalid_instruction->value.type = g->builtin_types.entry_invalid; g->invalid_instruction->value.global_refs = allocate<ConstGlobalRefs>(1); + g->unreach_instruction = &sentinel_instructions[1]; + g->unreach_instruction->value.type = g->builtin_types.entry_unreachable; + g->unreach_instruction->value.global_refs = allocate<ConstGlobalRefs>(1); + g->const_void_val.special = ConstValSpecialStatic; g->const_void_val.type = g->builtin_types.entry_void; g->const_void_val.global_refs = allocate<ConstGlobalRefs>(1); |
