aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-11-04 16:19:43 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-11-04 16:20:02 -0400
commitf0d755153d90f35da612c8aa6f1853f5112f5cf1 (patch)
treed27f43804e4805b78c75443cdd4ec706d37c87d8 /src/codegen.cpp
parent4a6df04f7568dd84245b513bfd8d245f31fa8f04 (diff)
downloadzig-f0d755153d90f35da612c8aa6f1853f5112f5cf1.tar.gz
zig-f0d755153d90f35da612c8aa6f1853f5112f5cf1.zip
add compile-time reflection for function arg types
See #383
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 4a69f40da1..2a2cd3ba10 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -3401,6 +3401,7 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable,
case IrInstructionIdPtrTypeOf:
case IrInstructionIdOpaqueType:
case IrInstructionIdSetAlignStack:
+ case IrInstructionIdArgType:
zig_unreachable();
case IrInstructionIdReturn:
return ir_render_return(g, executable, (IrInstructionReturn *)instruction);
@@ -4866,7 +4867,7 @@ static void define_builtin_fns(CodeGen *g) {
create_builtin_fn(g, BuiltinFnIdMaxValue, "maxValue", 1);
create_builtin_fn(g, BuiltinFnIdMinValue, "minValue", 1);
create_builtin_fn(g, BuiltinFnIdMemberCount, "memberCount", 1);
- create_builtin_fn(g, BuiltinFnIdTypeof, "typeOf", 1);
+ create_builtin_fn(g, BuiltinFnIdTypeof, "typeOf", 1); // TODO rename to TypeOf
create_builtin_fn(g, BuiltinFnIdAddWithOverflow, "addWithOverflow", 4);
create_builtin_fn(g, BuiltinFnIdSubWithOverflow, "subWithOverflow", 4);
create_builtin_fn(g, BuiltinFnIdMulWithOverflow, "mulWithOverflow", 4);
@@ -4913,6 +4914,7 @@ static void define_builtin_fns(CodeGen *g) {
create_builtin_fn(g, BuiltinFnIdAlignCast, "alignCast", 2);
create_builtin_fn(g, BuiltinFnIdOpaqueType, "OpaqueType", 0);
create_builtin_fn(g, BuiltinFnIdSetAlignStack, "setAlignStack", 1);
+ create_builtin_fn(g, BuiltinFnIdArgType, "ArgType", 2);
}
static const char *bool_to_str(bool b) {