mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-25 16:45:21 +02:00
LLVMContext changes up to r77366
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user