diff gen/llvmhelpers.cpp @ 1534:8ca25bd765a3

Build fix for the latest LLVMContext changes (LLVM r75445) This shouldn't break the build with older LLVM revs. We include LLVMContext.h in gen/llvm.h now to make the transition a little bit easier.
author Benjamin Kramer <benny.kra@gmail.com>
date Mon, 13 Jul 2009 12:17:58 +0200
parents 0f08b145b878
children 61f12f4651b5
line wrap: on
line diff
--- a/gen/llvmhelpers.cpp	Sat Jul 11 14:19:21 2009 +0200
+++ b/gen/llvmhelpers.cpp	Mon Jul 13 12:17:58 2009 +0200
@@ -464,13 +464,13 @@
     if (basetype->iscomplex())
     {
         const LLType* basefp = DtoComplexBaseType(basetype);
-        LLValue* res = DtoAggrPair(DtoType(type), LLConstant::getNullValue(basefp), LLConstant::getNullValue(basefp));
+        LLValue* res = DtoAggrPair(DtoType(type), llvm::getGlobalContext().getNullValue(basefp), llvm::getGlobalContext().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, LLConstant::getNullValue(lltype));
+        return new DConstValue(type, llvm::getGlobalContext().getNullValue(lltype));
     }
     // dynamic array
     else if (basety == Tarray)
@@ -482,7 +482,7 @@
     // delegate
     else if (basety == Tdelegate)
     {
-        return new DNullValue(type, LLConstant::getNullValue(lltype));
+        return new DNullValue(type, llvm::getGlobalContext().getNullValue(lltype));
     }
 
     // unknown
@@ -577,7 +577,7 @@
     }
     else if (totype->ty == Tbool) {
         LLValue* src = val->getRVal();
-        LLValue* zero = LLConstant::getNullValue(src->getType());
+        LLValue* zero = llvm::getGlobalContext().getNullValue(src->getType());
         rval = gIR->ir->CreateICmpNE(src, zero, "tmp");
     }
     else if (totype->isintegral()) {
@@ -609,7 +609,7 @@
 
     if (totype->ty == Tbool) {
         rval = val->getRVal();
-        LLValue* zero = LLConstant::getNullValue(rval->getType());
+        LLValue* zero = llvm::getGlobalContext().getNullValue(rval->getType());
         rval = gIR->ir->CreateFCmpUNE(rval, zero, "tmp");
     }
     else if (totype->iscomplex()) {
@@ -1124,7 +1124,7 @@
     {
         Logger::println("const void initializer");
         const LLType* ty = DtoType(type);
-        _init = llvm::Constant::getNullValue(ty);
+        _init = llvm::getGlobalContext().getNullValue(ty);
     }
     else {
         Logger::println("unsupported const initializer: %s", init->toChars());