Build fix for LLVM r75546 and r75559

This commit is contained in:
Benjamin Kramer 2009-07-14 02:19:05 +02:00
parent 0075194b90
commit 076ef17159
3 changed files with 14 additions and 12 deletions

View file

@ -85,6 +85,7 @@ static void EmitMemZero(IRBuilder<>& B, Value* Dst, Value* Len,
namespace { namespace {
class FunctionInfo { class FunctionInfo {
protected: protected:
LLVMContext* Context;
const Type* Ty; const Type* Ty;
public: public:
@ -108,8 +109,8 @@ namespace {
return new AllocaInst(Ty, ".nongc_mem", Begin); // FIXME: align? return new AllocaInst(Ty, ".nongc_mem", Begin); // FIXME: align?
} }
FunctionInfo(unsigned typeInfoArgNr, bool safeToDelete) FunctionInfo(LLVMContext* context, unsigned typeInfoArgNr, bool safeToDelete)
: TypeInfoArgNr(typeInfoArgNr), SafeToDelete(safeToDelete) {} : Context(context), TypeInfoArgNr(typeInfoArgNr), SafeToDelete(safeToDelete) {}
}; };
class ArrayFI : public FunctionInfo { class ArrayFI : public FunctionInfo {
@ -118,9 +119,9 @@ namespace {
bool Initialized; bool Initialized;
public: public:
ArrayFI(unsigned tiArgNr, bool safeToDelete, bool initialized, ArrayFI(LLVMContext* context, unsigned tiArgNr, bool safeToDelete,
unsigned arrSizeArgNr) bool initialized, unsigned arrSizeArgNr)
: FunctionInfo(tiArgNr, safeToDelete), : FunctionInfo(context, tiArgNr, safeToDelete),
ArrSizeArgNr(arrSizeArgNr), ArrSizeArgNr(arrSizeArgNr),
Initialized(initialized) Initialized(initialized)
{} {}
@ -222,7 +223,7 @@ namespace {
if (hasDestructor == NULL || hasCustomDelete == NULL) if (hasDestructor == NULL || hasCustomDelete == NULL)
return false; return false;
if (ConstantExpr::getOr(hasDestructor, hasCustomDelete) if (Context->getConstantExprOr(hasDestructor, hasCustomDelete)
!= ConstantInt::getFalse()) != ConstantInt::getFalse())
return false; return false;
@ -232,7 +233,7 @@ namespace {
// The default promote() should be fine. // The default promote() should be fine.
AllocClassFI() : FunctionInfo(~0u, true) {} AllocClassFI(LLVMContext* context) : FunctionInfo(context, ~0u, true) {}
}; };
} }
@ -285,9 +286,10 @@ FunctionPass *createGarbageCollect2Stack() {
GarbageCollect2Stack::GarbageCollect2Stack() GarbageCollect2Stack::GarbageCollect2Stack()
: FunctionPass(&ID), : FunctionPass(&ID),
AllocMemoryT(0, true), AllocMemoryT(Context, 0, true),
NewArrayVT(0, true, false, 1), NewArrayVT(Context, 0, true, false, 1),
NewArrayT(0, true, true, 1) NewArrayT(Context, 0, true, true, 1),
AllocClass(Context)
{ {
KnownFunctions["_d_allocmemoryT"] = &AllocMemoryT; KnownFunctions["_d_allocmemoryT"] = &AllocMemoryT;
KnownFunctions["_d_newarrayvT"] = &NewArrayVT; KnownFunctions["_d_newarrayvT"] = &NewArrayVT;

View file

@ -23,7 +23,7 @@ using namespace llvm::dwarf;
#define DBG_TYPE ( getPtrToType(llvm::StructType::get(NULL,NULL)) ) #define DBG_TYPE ( getPtrToType(llvm::StructType::get(NULL,NULL)) )
#define DBG_CAST(X) ( llvm::ConstantExpr::getBitCast(X, DBG_TYPE) ) #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 ) ) )
////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -557,7 +557,7 @@ LLConstant* DtoConstFP(Type* t, long double value)
assert(llty->isFloatingPoint()); assert(llty->isFloatingPoint());
if(llty == LLType::FloatTy || llty == LLType::DoubleTy) if(llty == LLType::FloatTy || llty == LLType::DoubleTy)
return LLConstantFP::get(llty, value); return gIR->context().getConstantFP(llty, value);
else if(llty == LLType::X86_FP80Ty) { else if(llty == LLType::X86_FP80Ty) {
uint64_t bits[] = {0, 0}; uint64_t bits[] = {0, 0};
bits[0] = *(uint64_t*)&value; bits[0] = *(uint64_t*)&value;