mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Fixed issue with IsExpression and potential type mismatch for classes.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1954,7 +1954,7 @@ DValue* IdentityExp::toElem(IRState* p)
|
||||
? 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 @@ DValue* IdentityExp::toElem(IRState* p)
|
||||
: 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");
|
||||
|
||||
Reference in New Issue
Block a user