mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-01 12:33:13 +01:00
Push the context through StructType::get.
Requires LLVM >= 78258. Also remove old #if's.
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
#include "declaration.h"
|
||||
#include "mtype.h"
|
||||
|
||||
#include "gen/llvm-version.h"
|
||||
#include "gen/irstate.h"
|
||||
#include "gen/logger.h"
|
||||
#include "gen/tollvm.h"
|
||||
@@ -87,11 +86,7 @@ LLGlobalVariable * IrStruct::getClassInfoSymbol()
|
||||
mdVals[CD_Finalize] = LLConstantInt::get(LLType::Int1Ty, hasDestructor);
|
||||
mdVals[CD_CustomDelete] = LLConstantInt::get(LLType::Int1Ty, hasCustomDelete);
|
||||
// Construct the metadata
|
||||
#if LLVM_REV < 77733
|
||||
llvm::MetadataBase* metadata = gIR->context().getMDNode(mdVals, CD_NumFields);
|
||||
#else
|
||||
llvm::MetadataBase* metadata = llvm::MDNode::get(gIR->context(), mdVals, CD_NumFields);
|
||||
#endif
|
||||
// Insert it into the module
|
||||
std::string metaname = CD_PREFIX + initname;
|
||||
llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module);
|
||||
@@ -177,7 +172,7 @@ LLConstant * IrStruct::getVtblInit()
|
||||
}
|
||||
|
||||
// build the constant struct
|
||||
constVtbl = LLConstantStruct::get(constants, false);
|
||||
constVtbl = LLConstantStruct::get(gIR->context(), constants, false);
|
||||
|
||||
#if 0
|
||||
IF_LOG Logger::cout() << "constVtbl type: " << *constVtbl->getType() << std::endl;
|
||||
@@ -321,7 +316,7 @@ LLConstant * IrStruct::createClassDefaultInitializer()
|
||||
addBaseClassInits(constants, cd, offset, field_index);
|
||||
|
||||
// build the constant
|
||||
llvm::Constant* definit = LLConstantStruct::get(constants, false);
|
||||
llvm::Constant* definit = LLConstantStruct::get(gIR->context(), constants, false);
|
||||
|
||||
return definit;
|
||||
}
|
||||
@@ -389,7 +384,7 @@ llvm::GlobalVariable * IrStruct::getInterfaceVtbl(BaseClass * b, bool new_instan
|
||||
}
|
||||
|
||||
// build the vtbl constant
|
||||
llvm::Constant* vtbl_constant = LLConstantStruct::get(constants, false);
|
||||
llvm::Constant* vtbl_constant = LLConstantStruct::get(gIR->context(), constants, false);
|
||||
|
||||
// create the global variable to hold it
|
||||
llvm::GlobalValue::LinkageTypes _linkage = DtoExternalLinkage(aggrdecl);
|
||||
@@ -488,7 +483,7 @@ LLConstant * IrStruct::getClassInfoInterfaces()
|
||||
|
||||
// create Interface struct
|
||||
LLConstant* inits[3] = { ci, vtb, off };
|
||||
LLConstant* entry = LLConstantStruct::get(inits, 3);
|
||||
LLConstant* entry = LLConstantStruct::get(gIR->context(), inits, 3);
|
||||
constants.push_back(entry);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user