Mercurial > projects > ldc
diff gen/classes.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 | 8d086d552909 |
line wrap: on
line diff
--- a/gen/classes.cpp Fri Jul 31 19:11:07 2009 +0200 +++ b/gen/classes.cpp Fri Jul 31 23:01:29 2009 +0200 @@ -211,7 +211,7 @@ // monitor always defaults to zero tmp = DtoGEPi(dst,0,1,"monitor"); - val = gIR->context().getNullValue(tmp->getType()->getContainedType(0)); + val = LLConstant::getNullValue(tmp->getType()->getContainedType(0)); DtoStore(val, tmp); // done? @@ -262,7 +262,7 @@ else if (to->ty == Tbool) { IF_LOG Logger::println("to bool"); LLValue* llval = val->getRVal(); - LLValue* zero = gIR->context().getNullValue(llval->getType()); + LLValue* zero = LLConstant::getNullValue(llval->getType()); return new DImValue(_to, gIR->ir->CreateICmpNE(llval, zero, "tmp")); } // class -> integer @@ -326,8 +326,8 @@ // Sure we could have jumped over the code above in this case, but // it's just a GEP and (maybe) a pointer-to-pointer BitCast, so it // should be pretty cheap and perfectly safe even if the original was null. - LLValue* isNull = gIR->ir->CreateICmpEQ(orig, gIR->context().getNullValue(orig->getType()), ".nullcheck"); - v = gIR->ir->CreateSelect(isNull, gIR->context().getNullValue(ifType), v, ".interface"); + LLValue* isNull = gIR->ir->CreateICmpEQ(orig, LLConstant::getNullValue(orig->getType()), ".nullcheck"); + v = gIR->ir->CreateSelect(isNull, LLConstant::getNullValue(ifType), v, ".interface"); // return r-value return new DImValue(_to, v); @@ -602,7 +602,7 @@ LLConstant* ptr; if (nvars == 0) - return gIR->context().getNullValue( arrayT ); + return LLConstant::getNullValue( arrayT ); // array type const llvm::ArrayType* arrTy = llvm::ArrayType::get(arrayInits[0]->getType(), nvars);