Mercurial > projects > ldc
changeset 516:eada571dc8ff
Fix delegate equality.
Fixes:
mini/delegate.d
run/d/delegate_17_A
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 16 Aug 2008 10:48:25 +0200 |
parents | e739ef5dfff0 |
children | 9534dbc70a56 |
files | gen/tollvm.cpp |
diffstat | 1 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/tollvm.cpp Fri Aug 15 23:15:21 2008 +0200 +++ b/gen/tollvm.cpp Sat Aug 16 10:48:25 2008 +0200 @@ -205,25 +205,24 @@ LLValue* DtoDelegateEquals(TOK op, LLValue* lhs, LLValue* rhs) { Logger::println("Doing delegate equality"); - llvm::ICmpInst::Predicate pred = (op == TOKequal || op == TOKidentity) ? llvm::ICmpInst::ICMP_EQ : llvm::ICmpInst::ICMP_NE; llvm::Value *b1, *b2; if (rhs == NULL) { LLValue* l = DtoLoad(DtoGEPi(lhs,0,0)); LLValue* r = llvm::Constant::getNullValue(l->getType()); - b1 = gIR->ir->CreateICmp(pred,l,r,"tmp"); + b1 = gIR->ir->CreateICmp(llvm::ICmpInst::ICMP_EQ,l,r,"tmp"); l = DtoLoad(DtoGEPi(lhs,0,1)); r = llvm::Constant::getNullValue(l->getType()); - b2 = gIR->ir->CreateICmp(pred,l,r,"tmp"); + b2 = gIR->ir->CreateICmp(llvm::ICmpInst::ICMP_EQ,l,r,"tmp"); } else { LLValue* l = DtoLoad(DtoGEPi(lhs,0,0)); LLValue* r = DtoLoad(DtoGEPi(rhs,0,0)); - b1 = gIR->ir->CreateICmp(pred,l,r,"tmp"); + b1 = gIR->ir->CreateICmp(llvm::ICmpInst::ICMP_EQ,l,r,"tmp"); l = DtoLoad(DtoGEPi(lhs,0,1)); r = DtoLoad(DtoGEPi(rhs,0,1)); - b2 = gIR->ir->CreateICmp(pred,l,r,"tmp"); + b2 = gIR->ir->CreateICmp(llvm::ICmpInst::ICMP_EQ,l,r,"tmp"); } LLValue* b = gIR->ir->CreateAnd(b1,b2,"tmp"); if (op == TOKnotequal || op == TOKnotidentity)