LLVMContext changes up to r77366

This commit is contained in:
Benjamin Kramer
2009-07-30 15:25:10 +02:00
parent 3f0a0686a8
commit 66101517d7
19 changed files with 113 additions and 114 deletions

View File

@@ -82,8 +82,8 @@ LLGlobalVariable * IrStruct::getClassInfoSymbol()
// Construct the fields
MDNodeField* mdVals[CD_NumFields];
mdVals[CD_BodyType] = llvm::UndefValue::get(bodyType);
mdVals[CD_Finalize] = gIR->context().getConstantInt(LLType::Int1Ty, hasDestructor);
mdVals[CD_CustomDelete] = gIR->context().getConstantInt(LLType::Int1Ty, hasCustomDelete);
mdVals[CD_Finalize] = LLConstantInt::get(LLType::Int1Ty, hasDestructor);
mdVals[CD_CustomDelete] = LLConstantInt::get(LLType::Int1Ty, hasCustomDelete);
// Construct the metadata
llvm::MDNode* metadata = gIR->context().getMDNode(mdVals, CD_NumFields);
// Insert it into the module
@@ -170,7 +170,7 @@ LLConstant * IrStruct::getVtblInit()
}
// build the constant struct
constVtbl = gIR->context().getConstantStruct(constants, false);
constVtbl = LLConstantStruct::get(constants, false);
#if 0
IF_LOG Logger::cout() << "constVtbl type: " << *constVtbl->getType() << std::endl;
@@ -314,7 +314,7 @@ LLConstant * IrStruct::createClassDefaultInitializer()
addBaseClassInits(constants, cd, offset, field_index);
// build the constant
llvm::Constant* definit = gIR->context().getConstantStruct(constants, false);
llvm::Constant* definit = LLConstantStruct::get(constants, false);
return definit;
}
@@ -382,7 +382,7 @@ llvm::GlobalVariable * IrStruct::getInterfaceVtbl(BaseClass * b, bool new_instan
}
// build the vtbl constant
llvm::Constant* vtbl_constant = gIR->context().getConstantStruct(constants, false);
llvm::Constant* vtbl_constant = LLConstantStruct::get(constants, false);
// create the global variable to hold it
llvm::GlobalValue::LinkageTypes _linkage = DtoExternalLinkage(aggrdecl);
@@ -481,7 +481,7 @@ LLConstant * IrStruct::getClassInfoInterfaces()
// create Interface struct
LLConstant* inits[3] = { ci, vtb, off };
LLConstant* entry = gIR->context().getConstantStruct(inits, 3);
LLConstant* entry = LLConstantStruct::get(inits, 3);
constants.push_back(entry);
}
@@ -490,7 +490,7 @@ LLConstant * IrStruct::getClassInfoInterfaces()
constants[0]->getType(),
n);
LLConstant* arr = gIR->context().getConstantArray(
LLConstant* arr = LLConstantArray::get(
array_type,
&constants[0],
n);

View File

@@ -133,7 +133,7 @@ void IRLandingPad::constructLandingPad(llvm::BasicBlock* inBB)
}
// if there's a finally, the eh table has to have a 0 action
if(hasFinally)
selectorargs.push_back(gIR->context().getConstantInt(LLType::Int32Ty, 0));
selectorargs.push_back(LLConstantInt::get(LLType::Int32Ty, 0));
// personality fn
llvm::Function* personality_fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_eh_personality");
@@ -186,7 +186,7 @@ void IRLandingPad::constructLandingPad(llvm::BasicBlock* inBB)
}
// dubious comment
// catches matched first get the largest switchval, so do size - unique int
llvm::ConstantInt* switchval = gIR->context().getConstantInt(DtoSize_t(), catchToInt[rit->catchType]);
llvm::ConstantInt* switchval = LLConstantInt::get(DtoSize_t(), catchToInt[rit->catchType]);
// and make sure we don't add the same switchval twice, may happen with nested trys
if(!switchinst->findCaseValue(switchval))
switchinst->addCase(switchval, rit->target);

View File

@@ -195,7 +195,7 @@ LLConstant * IrStruct::createStructDefaultInitializer()
}
// build constant struct
llvm::Constant* definit = gIR->context().getConstantStruct(constants, packed);
llvm::Constant* definit = LLConstantStruct::get(constants, packed);
#if 0
IF_LOG Logger::cout() << "final default initializer: " << *definit << std::endl;
#endif
@@ -384,7 +384,7 @@ LLConstant * IrStruct::createStructInitializer(StructInitializer * si)
// build constant
assert(!constants.empty());
llvm::Constant* c = gIR->context().getConstantStruct(&constants[0], constants.size(), packed);
llvm::Constant* c = LLConstantStruct::get(&constants[0], constants.size(), packed);
IF_LOG Logger::cout() << "final struct initializer: " << *c << std::endl;
return c;
}