getNullValue is in Constant again

Requires LLVM >= r77721
This commit is contained in:
Benjamin Kramer
2009-07-31 23:01:29 +02:00
parent 0a1d467ac7
commit 4c5457ba61
13 changed files with 35 additions and 35 deletions

View File

@@ -463,13 +463,13 @@ DValue* DtoNullValue(Type* type)
if (basetype->iscomplex())
{
const LLType* basefp = DtoComplexBaseType(basetype);
LLValue* res = DtoAggrPair(DtoType(type), gIR->context().getNullValue(basefp), gIR->context().getNullValue(basefp));
LLValue* res = DtoAggrPair(DtoType(type), LLConstant::getNullValue(basefp), LLConstant::getNullValue(basefp));
return new DImValue(type, res);
}
// integer, floating, pointer and class have no special representation
else if (basetype->isintegral() || basetype->isfloating() || basety == Tpointer || basety == Tclass)
{
return new DConstValue(type, gIR->context().getNullValue(lltype));
return new DConstValue(type, LLConstant::getNullValue(lltype));
}
// dynamic array
else if (basety == Tarray)
@@ -481,7 +481,7 @@ DValue* DtoNullValue(Type* type)
// delegate
else if (basety == Tdelegate)
{
return new DNullValue(type, gIR->context().getNullValue(lltype));
return new DNullValue(type, LLConstant::getNullValue(lltype));
}
// unknown
@@ -576,7 +576,7 @@ DValue* DtoCastPtr(Loc& loc, DValue* val, Type* to)
}
else if (totype->ty == Tbool) {
LLValue* src = val->getRVal();
LLValue* zero = gIR->context().getNullValue(src->getType());
LLValue* zero = LLConstant::getNullValue(src->getType());
rval = gIR->ir->CreateICmpNE(src, zero, "tmp");
}
else if (totype->isintegral()) {
@@ -608,7 +608,7 @@ DValue* DtoCastFloat(Loc& loc, DValue* val, Type* to)
if (totype->ty == Tbool) {
rval = val->getRVal();
LLValue* zero = gIR->context().getNullValue(rval->getType());
LLValue* zero = LLConstant::getNullValue(rval->getType());
rval = gIR->ir->CreateFCmpUNE(rval, zero, "tmp");
}
else if (totype->iscomplex()) {
@@ -1123,7 +1123,7 @@ LLConstant* DtoConstInitializer(Loc loc, Type* type, Initializer* init)
{
Logger::println("const void initializer");
const LLType* ty = DtoType(type);
_init = gIR->context().getNullValue(ty);
_init = LLConstant::getNullValue(ty);
}
else {
Logger::println("unsupported const initializer: %s", init->toChars());