aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorShawn Landden <shawn@git.icu>2019-05-06 11:41:15 -0500
committerShawn Landden <shawn@git.icu>2019-05-06 11:52:47 -0500
commitc19bdc2d370f3a72ef492e2f4e6264e2a0dd91ec (patch)
tree26c14f9b6b1b0edaee401842a7fe3af34a462ee8 /src/codegen.cpp
parent7a41af2632e693cd63476576bbbb965126e45b9b (diff)
downloadzig-c19bdc2d370f3a72ef492e2f4e6264e2a0dd91ec.tar.gz
zig-c19bdc2d370f3a72ef492e2f4e6264e2a0dd91ec.zip
stage1: add @hasField() built-in
This was quite straight-forward Closes: #1439
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 7dfdf71725..1253a6a6af 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -5530,6 +5530,7 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable,
case IrInstructionIdByteOffsetOf:
case IrInstructionIdBitOffsetOf:
case IrInstructionIdTypeInfo:
+ case IrInstructionIdHasField:
case IrInstructionIdTypeId:
case IrInstructionIdSetEvalBranchQuota:
case IrInstructionIdPtrType:
@@ -7271,6 +7272,7 @@ static void define_builtin_fns(CodeGen *g) {
create_builtin_fn(g, BuiltinFnIdMemberName, "memberName", 2);
create_builtin_fn(g, BuiltinFnIdField, "field", 2);
create_builtin_fn(g, BuiltinFnIdTypeInfo, "typeInfo", 1);
+ create_builtin_fn(g, BuiltinFnIdHasField, "hasField", 2);
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);