diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-13 12:34:42 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-07-13 12:34:42 -0400 |
| commit | 5354d1f5fc496beb8313488ea1690e02e9c630fa (patch) | |
| tree | 4b46b803efbc09944d2a0cb47904b452ea666fbd /src/codegen.cpp | |
| parent | ac096c294976b7cb6433a7939adcd664af770201 (diff) | |
| download | zig-5354d1f5fc496beb8313488ea1690e02e9c630fa.tar.gz zig-5354d1f5fc496beb8313488ea1690e02e9c630fa.zip | |
allow == for comparing optional pointers
closes #658
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 54e2da7d61..3f54c120b4 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2249,10 +2249,8 @@ static LLVMValueRef ir_render_bin_op(CodeGen *g, IrExecutable *executable, return LLVMBuildICmp(g->builder, pred, op1_value, op2_value, ""); } else if (type_entry->id == TypeTableEntryIdEnum || type_entry->id == TypeTableEntryIdErrorSet || - type_entry->id == TypeTableEntryIdPointer || type_entry->id == TypeTableEntryIdBool || - type_entry->id == TypeTableEntryIdPromise || - type_entry->id == TypeTableEntryIdFn) + get_codegen_ptr_type(type_entry) != nullptr) { LLVMIntPredicate pred = cmp_op_to_int_predicate(op_id, false); return LLVMBuildICmp(g->builder, pred, op1_value, op2_value, ""); |
