implement @const_eval

closes #73
This commit is contained in:
Andrew Kelley
2016-02-07 15:11:20 -07:00
parent 049e9e5819
commit 26ea20d88f
5 changed files with 36 additions and 1 deletions

View File

@@ -310,6 +310,7 @@ static LLVMValueRef gen_builtin_fn_call_expr(CodeGen *g, AstNode *node) {
case BuiltinFnIdMaxValue:
case BuiltinFnIdMemberCount:
case BuiltinFnIdCompileVar:
case BuiltinFnIdConstEval:
// caught by constant expression eval codegen
zig_unreachable();
}
@@ -3513,6 +3514,7 @@ static void define_builtin_fns(CodeGen *g) {
create_builtin_fn_with_arg_count(g, BuiltinFnIdCDefine, "c_define", 2);
create_builtin_fn_with_arg_count(g, BuiltinFnIdCUndef, "c_undef", 1);
create_builtin_fn_with_arg_count(g, BuiltinFnIdCompileVar, "compile_var", 1);
create_builtin_fn_with_arg_count(g, BuiltinFnIdConstEval, "const_eval", 1);
}