# HG changeset patch # User Tomas Lindquist Olsen # Date 1222887313 -7200 # Node ID 607b6b5819a79d10f06b981a2d448f797f3bf2ec # Parent e3c46bcce65f1875913b2104a7454d1096c6996f Fixed issue with IsExpression and potential type mismatch for classes. diff -r e3c46bcce65f -r 607b6b5819a7 gen/llvm.h --- a/gen/llvm.h Wed Oct 01 20:32:12 2008 +0200 +++ b/gen/llvm.h Wed Oct 01 20:55:13 2008 +0200 @@ -17,6 +17,9 @@ #include "llvm/Support/IRBuilder.h" using llvm::IRBuilder; +// for WriteTypeSymbolic +#include "llvm/Assembly/Writer.h" + #define GET_INTRINSIC_DECL(_X) (llvm::Intrinsic::getDeclaration(gIR->module, llvm::Intrinsic:: _X )) // shortcuts for the common llvm types diff -r e3c46bcce65f -r 607b6b5819a7 gen/toir.cpp --- a/gen/toir.cpp Wed Oct 01 20:32:12 2008 +0200 +++ b/gen/toir.cpp Wed Oct 01 20:55:13 2008 +0200 @@ -1954,7 +1954,7 @@ ? p->ir->CreateFCmpOEQ(l,r,"tmp") : p->ir->CreateFCmpONE(l,r,"tmp"); } - else if (t1->ty == Tpointer) + else if (t1->ty == Tpointer || t1->ty == Tclass) { if (l->getType() != r->getType()) { if (v->isNull()) @@ -1967,6 +1967,7 @@ : p->ir->CreateICmpNE(l,r,"tmp"); } else { + assert(l->getType() == r->getType()); eval = (op == TOKidentity) ? p->ir->CreateICmpEQ(l,r,"tmp") : p->ir->CreateICmpNE(l,r,"tmp");