From 60617d54449524823aef0ca254ffbe86cf9ec7a2 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Fri, 15 Aug 2008 22:41:47 +0200 Subject: [PATCH] Add interface comparison to EqualExp: just do pointer comparison. Fixes run/b/bug_e2ir_1786_B,C. --- gen/toir.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gen/toir.cpp b/gen/toir.cpp index 2b763a9a..4ec1eba6 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -1288,9 +1288,11 @@ DValue* EqualExp::toElem(IRState* p) LLValue* eval = 0; - if (t->isintegral() || t->ty == Tpointer) + // the Tclass catches interface comparisons, regular + // class equality should be rewritten as a.opEquals(b) by this time + if (t->isintegral() || t->ty == Tpointer || t->ty == Tclass) { - Logger::println("integral or pointer"); + Logger::println("integral or pointer or interface"); llvm::ICmpInst::Predicate cmpop; switch(op) {