changeset 1539:6364e09628fd

Build fix for LLVM r75546 and r75559
author Benjamin Kramer <benny.kra@gmail.com>
date Tue, 14 Jul 2009 02:19:05 +0200
parents e4ff2e15cf5f
children a0114765fe34
files gen/passes/GarbageCollect2Stack.cpp gen/todebug.cpp gen/tollvm.cpp
diffstat 3 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/gen/passes/GarbageCollect2Stack.cpp	Tue Jul 14 18:24:40 2009 +0200
+++ b/gen/passes/GarbageCollect2Stack.cpp	Tue Jul 14 02:19:05 2009 +0200
@@ -85,6 +85,7 @@
 namespace {
     class FunctionInfo {
     protected:
+        LLVMContext* Context;
         const Type* Ty;
         
     public:
@@ -108,8 +109,8 @@
             return new AllocaInst(Ty, ".nongc_mem", Begin); // FIXME: align?
         }
         
-        FunctionInfo(unsigned typeInfoArgNr, bool safeToDelete)
-        : TypeInfoArgNr(typeInfoArgNr), SafeToDelete(safeToDelete) {}
+        FunctionInfo(LLVMContext* context, unsigned typeInfoArgNr, bool safeToDelete)
+        : Context(context), TypeInfoArgNr(typeInfoArgNr), SafeToDelete(safeToDelete) {}
     };
     
     class ArrayFI : public FunctionInfo {
@@ -118,9 +119,9 @@
         bool Initialized;
         
     public:
-        ArrayFI(unsigned tiArgNr, bool safeToDelete, bool initialized,
-                unsigned arrSizeArgNr)
-        : FunctionInfo(tiArgNr, safeToDelete),
+        ArrayFI(LLVMContext* context, unsigned tiArgNr, bool safeToDelete,
+                bool initialized, unsigned arrSizeArgNr)
+        : FunctionInfo(context, tiArgNr, safeToDelete),
           ArrSizeArgNr(arrSizeArgNr),
           Initialized(initialized)
         {}
@@ -222,7 +223,7 @@
             if (hasDestructor == NULL || hasCustomDelete == NULL)
                 return false;
             
-            if (ConstantExpr::getOr(hasDestructor, hasCustomDelete)
+            if (Context->getConstantExprOr(hasDestructor, hasCustomDelete)
                     != ConstantInt::getFalse())
                 return false;
             
@@ -232,7 +233,7 @@
         
         // The default promote() should be fine.
         
-        AllocClassFI() : FunctionInfo(~0u, true) {}
+        AllocClassFI(LLVMContext* context) : FunctionInfo(context, ~0u, true) {}
     };
 }
 
@@ -285,9 +286,10 @@
 
 GarbageCollect2Stack::GarbageCollect2Stack()
 : FunctionPass(&ID),
-  AllocMemoryT(0, true),
-  NewArrayVT(0, true, false, 1),
-  NewArrayT(0, true, true, 1)
+  AllocMemoryT(Context, 0, true),
+  NewArrayVT(Context, 0, true, false, 1),
+  NewArrayT(Context, 0, true, true, 1),
+  AllocClass(Context)
 {
     KnownFunctions["_d_allocmemoryT"] = &AllocMemoryT;
     KnownFunctions["_d_newarrayvT"] = &NewArrayVT;
--- a/gen/todebug.cpp	Tue Jul 14 18:24:40 2009 +0200
+++ b/gen/todebug.cpp	Tue Jul 14 02:19:05 2009 +0200
@@ -23,7 +23,7 @@
 #define DBG_TYPE    ( getPtrToType(llvm::StructType::get(NULL,NULL)) )
 #define DBG_CAST(X) ( llvm::ConstantExpr::getBitCast(X, DBG_TYPE) )
 
-#define DBG_TAG(X)  ( llvm::ConstantExpr::getAdd( DtoConstUint( X ), DtoConstUint( llvm::LLVMDebugVersion ) ) )
+#define DBG_TAG(X)  ( gIR->context().getConstantExprAdd( DtoConstUint( X ), DtoConstUint( llvm::LLVMDebugVersion ) ) )
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
--- a/gen/tollvm.cpp	Tue Jul 14 18:24:40 2009 +0200
+++ b/gen/tollvm.cpp	Tue Jul 14 02:19:05 2009 +0200
@@ -557,7 +557,7 @@
     assert(llty->isFloatingPoint());
 
     if(llty == LLType::FloatTy || llty == LLType::DoubleTy)
-        return LLConstantFP::get(llty, value);
+        return gIR->context().getConstantFP(llty, value);
     else if(llty == LLType::X86_FP80Ty) {
         uint64_t bits[] = {0, 0};
         bits[0] = *(uint64_t*)&value;