comparison gen/tollvm.cpp @ 1560:1d5c3354b3c2

getNullValue is in Constant again Requires LLVM >= r77721
author Benjamin Kramer <benny.kra@gmail.com>
date Fri, 31 Jul 2009 23:01:29 +0200
parents d6e8d5db259f
children 755abafbf25d
comparison
equal deleted inserted replaced
1559:06d5cc873350 1560:1d5c3354b3c2
210 { 210 {
211 Logger::println("Doing delegate equality"); 211 Logger::println("Doing delegate equality");
212 llvm::Value *b1, *b2; 212 llvm::Value *b1, *b2;
213 if (rhs == NULL) 213 if (rhs == NULL)
214 { 214 {
215 rhs = gIR->context().getNullValue(lhs->getType()); 215 rhs = LLConstant::getNullValue(lhs->getType());
216 } 216 }
217 217
218 LLValue* l = gIR->ir->CreateExtractValue(lhs, 0); 218 LLValue* l = gIR->ir->CreateExtractValue(lhs, 0);
219 LLValue* r = gIR->ir->CreateExtractValue(rhs, 0); 219 LLValue* r = gIR->ir->CreateExtractValue(rhs, 0);
220 b1 = gIR->ir->CreateICmp(llvm::ICmpInst::ICMP_EQ,l,r,"tmp"); 220 b1 = gIR->ir->CreateICmp(llvm::ICmpInst::ICMP_EQ,l,r,"tmp");
738 return llvm::ConstantPointerNull::get(pt); 738 return llvm::ConstantPointerNull::get(pt);
739 } 739 }
740 740
741 LLConstant* getNullValue(const LLType* t) 741 LLConstant* getNullValue(const LLType* t)
742 { 742 {
743 return gIR->context().getNullValue(t); 743 return LLConstant::getNullValue(t);
744 } 744 }
745 745
746 ////////////////////////////////////////////////////////////////////////////////////////// 746 //////////////////////////////////////////////////////////////////////////////////////////
747 747
748 size_t getTypeBitSize(const LLType* t) 748 size_t getTypeBitSize(const LLType* t)