refactor ir.cpp

Analysis functions no longer return `ZigType *`. Instead they
return `IrInstruction *`.
This commit is contained in:
Andrew Kelley
2018-10-04 14:32:55 -04:00
parent 31469daca3
commit 23b07ad8d2
4 changed files with 1716 additions and 2124 deletions

View File

@@ -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);