IR: add error for non static const on switch case range

This commit is contained in:
Andrew Kelley
2016-11-26 04:37:34 -05:00
parent 697c768730
commit 24b65e41ee
5 changed files with 80 additions and 38 deletions

View File

@@ -1681,6 +1681,7 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable,
case IrInstructionIdCompileVar:
case IrInstructionIdSizeOf:
case IrInstructionIdSwitchTarget:
case IrInstructionIdStaticEval:
zig_unreachable();
case IrInstructionIdReturn:
return ir_render_return(g, executable, (IrInstructionReturn *)instruction);
@@ -2968,7 +2969,7 @@ static void define_builtin_fns(CodeGen *g) {
create_builtin_fn_with_arg_count(g, BuiltinFnIdCDefine, "cDefine", 2);
create_builtin_fn_with_arg_count(g, BuiltinFnIdCUndef, "cUndef", 1);
create_builtin_fn_with_arg_count(g, BuiltinFnIdCompileVar, "compileVar", 1);
create_builtin_fn_with_arg_count(g, BuiltinFnIdConstEval, "constEval", 1);
create_builtin_fn_with_arg_count(g, BuiltinFnIdStaticEval, "staticEval", 1);
create_builtin_fn_with_arg_count(g, BuiltinFnIdCtz, "ctz", 1);
create_builtin_fn_with_arg_count(g, BuiltinFnIdClz, "clz", 1);
create_builtin_fn_with_arg_count(g, BuiltinFnIdImport, "import", 1);