Mercurial > projects > ldc
diff gen/llvmhelpers.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/llvmhelpers.cpp Fri Jul 31 19:11:07 2009 +0200 +++ b/gen/llvmhelpers.cpp Fri Jul 31 23:01:29 2009 +0200 @@ -463,13 +463,13 @@ 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 @@ // 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 @@ } 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 @@ 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 @@ { 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());