mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-05 09:31:03 +03:00
Push the context through StructType::get.
Requires LLVM >= 78258. Also remove old #if's.
This commit is contained in:
parent
de0d74dc68
commit
977fa551ee
22 changed files with 57 additions and 70 deletions
|
@ -36,6 +36,7 @@
|
||||||
#include "declaration.h"
|
#include "declaration.h"
|
||||||
#include "aggregate.h"
|
#include "aggregate.h"
|
||||||
|
|
||||||
|
#include "gen/irstate.h"
|
||||||
#include "gen/llvm.h"
|
#include "gen/llvm.h"
|
||||||
#include "gen/tollvm.h"
|
#include "gen/tollvm.h"
|
||||||
#include "gen/logger.h"
|
#include "gen/logger.h"
|
||||||
|
@ -281,7 +282,7 @@ namespace {
|
||||||
default:
|
default:
|
||||||
assert(0 && "Unanticipated argument class for second half");
|
assert(0 && "Unanticipated argument class for second half");
|
||||||
}
|
}
|
||||||
return LLStructType::get(parts);
|
return LLStructType::get(gIR->context(), parts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,12 +26,12 @@ const LLStructType* DtoArrayType(Type* arrayTy)
|
||||||
const LLType* elemty = DtoType(arrayTy->nextOf());
|
const LLType* elemty = DtoType(arrayTy->nextOf());
|
||||||
if (elemty == LLType::VoidTy)
|
if (elemty == LLType::VoidTy)
|
||||||
elemty = LLType::Int8Ty;
|
elemty = LLType::Int8Ty;
|
||||||
return LLStructType::get(DtoSize_t(), getPtrToType(elemty), NULL);
|
return LLStructType::get(gIR->context(), DtoSize_t(), getPtrToType(elemty), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
const LLStructType* DtoArrayType(const LLType* t)
|
const LLStructType* DtoArrayType(const LLType* t)
|
||||||
{
|
{
|
||||||
return LLStructType::get(DtoSize_t(), getPtrToType(t), NULL);
|
return LLStructType::get(gIR->context(), DtoSize_t(), getPtrToType(t), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -309,7 +309,7 @@ LLConstant* DtoConstArrayInitializer(ArrayInitializer* arrinit)
|
||||||
|
|
||||||
LLConstant* constarr;
|
LLConstant* constarr;
|
||||||
if (mismatch)
|
if (mismatch)
|
||||||
constarr = LLConstantStruct::get(initvals);
|
constarr = LLConstantStruct::get(gIR->context(), initvals);
|
||||||
else
|
else
|
||||||
constarr = LLConstantArray::get(LLArrayType::get(llelemty, arrlen), initvals);
|
constarr = LLConstantArray::get(LLArrayType::get(llelemty, arrlen), initvals);
|
||||||
|
|
||||||
|
@ -394,7 +394,7 @@ void DtoStaticArrayCopy(LLValue* dst, LLValue* src)
|
||||||
LLConstant* DtoConstSlice(LLConstant* dim, LLConstant* ptr)
|
LLConstant* DtoConstSlice(LLConstant* dim, LLConstant* ptr)
|
||||||
{
|
{
|
||||||
LLConstant* values[2] = { dim, ptr };
|
LLConstant* values[2] = { dim, ptr };
|
||||||
return LLConstantStruct::get(values, 2);
|
return LLConstantStruct::get(gIR->context(), values, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -16,7 +16,7 @@ const llvm::StructType* DtoComplexType(Type* type)
|
||||||
{
|
{
|
||||||
Type* t = type->toBasetype();
|
Type* t = type->toBasetype();
|
||||||
const LLType* base = DtoComplexBaseType(t);
|
const LLType* base = DtoComplexBaseType(t);
|
||||||
return llvm::StructType::get(base, base, NULL);
|
return llvm::StructType::get(gIR->context(), base, base, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
const LLType* DtoComplexBaseType(Type* t)
|
const LLType* DtoComplexBaseType(Type* t)
|
||||||
|
|
|
@ -23,13 +23,13 @@ void RegisterDwarfSymbols(llvm::Module* mod) {
|
||||||
std::vector<const Type*>StructTy_llvm_dbg_anchor_type_fields;
|
std::vector<const Type*>StructTy_llvm_dbg_anchor_type_fields;
|
||||||
StructTy_llvm_dbg_anchor_type_fields.push_back(IntegerType::get(32));
|
StructTy_llvm_dbg_anchor_type_fields.push_back(IntegerType::get(32));
|
||||||
StructTy_llvm_dbg_anchor_type_fields.push_back(IntegerType::get(32));
|
StructTy_llvm_dbg_anchor_type_fields.push_back(IntegerType::get(32));
|
||||||
StructType* StructTy_llvm_dbg_anchor_type = StructType::get(StructTy_llvm_dbg_anchor_type_fields, /*isPacked=*/false);
|
StructType* StructTy_llvm_dbg_anchor_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_anchor_type_fields, /*isPacked=*/false);
|
||||||
mod->addTypeName("llvm.dbg.anchor.type", StructTy_llvm_dbg_anchor_type);
|
mod->addTypeName("llvm.dbg.anchor.type", StructTy_llvm_dbg_anchor_type);
|
||||||
|
|
||||||
std::vector<const Type*>StructTy_llvm_dbg_basictype_type_fields;
|
std::vector<const Type*>StructTy_llvm_dbg_basictype_type_fields;
|
||||||
StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(32));
|
StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(32));
|
||||||
std::vector<const Type*>StructTy_1_fields;
|
std::vector<const Type*>StructTy_1_fields;
|
||||||
StructType* StructTy_1 = StructType::get(StructTy_1_fields, /*isPacked=*/false);
|
StructType* StructTy_1 = StructType::get(mod->getContext(), StructTy_1_fields, /*isPacked=*/false);
|
||||||
|
|
||||||
PointerType* PointerTy_0 = PointerType::get(StructTy_1,0);
|
PointerType* PointerTy_0 = PointerType::get(StructTy_1,0);
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ void RegisterDwarfSymbols(llvm::Module* mod) {
|
||||||
StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(64));
|
StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(64));
|
||||||
StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(32));
|
StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(32));
|
||||||
StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(32));
|
StructTy_llvm_dbg_basictype_type_fields.push_back(IntegerType::get(32));
|
||||||
StructType* StructTy_llvm_dbg_basictype_type = StructType::get(StructTy_llvm_dbg_basictype_type_fields, /*isPacked=*/false);
|
StructType* StructTy_llvm_dbg_basictype_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_basictype_type_fields, /*isPacked=*/false);
|
||||||
mod->addTypeName("llvm.dbg.basictype.type", StructTy_llvm_dbg_basictype_type);
|
mod->addTypeName("llvm.dbg.basictype.type", StructTy_llvm_dbg_basictype_type);
|
||||||
|
|
||||||
std::vector<const Type*>StructTy_llvm_dbg_compile_unit_type_fields;
|
std::vector<const Type*>StructTy_llvm_dbg_compile_unit_type_fields;
|
||||||
|
@ -54,7 +54,7 @@ void RegisterDwarfSymbols(llvm::Module* mod) {
|
||||||
StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2);
|
StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2);
|
||||||
StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2);
|
StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2);
|
||||||
StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2);
|
StructTy_llvm_dbg_compile_unit_type_fields.push_back(PointerTy_2);
|
||||||
StructType* StructTy_llvm_dbg_compile_unit_type = StructType::get(StructTy_llvm_dbg_compile_unit_type_fields, /*isPacked=*/false);
|
StructType* StructTy_llvm_dbg_compile_unit_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_compile_unit_type_fields, /*isPacked=*/false);
|
||||||
mod->addTypeName("llvm.dbg.compile_unit.type", StructTy_llvm_dbg_compile_unit_type);
|
mod->addTypeName("llvm.dbg.compile_unit.type", StructTy_llvm_dbg_compile_unit_type);
|
||||||
|
|
||||||
std::vector<const Type*>StructTy_llvm_dbg_compositetype_type_fields;
|
std::vector<const Type*>StructTy_llvm_dbg_compositetype_type_fields;
|
||||||
|
@ -69,7 +69,7 @@ void RegisterDwarfSymbols(llvm::Module* mod) {
|
||||||
StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(32));
|
StructTy_llvm_dbg_compositetype_type_fields.push_back(IntegerType::get(32));
|
||||||
StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0);
|
StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0);
|
||||||
StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0);
|
StructTy_llvm_dbg_compositetype_type_fields.push_back(PointerTy_0);
|
||||||
StructType* StructTy_llvm_dbg_compositetype_type = StructType::get(StructTy_llvm_dbg_compositetype_type_fields, /*isPacked=*/false);
|
StructType* StructTy_llvm_dbg_compositetype_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_compositetype_type_fields, /*isPacked=*/false);
|
||||||
mod->addTypeName("llvm.dbg.compositetype.type", StructTy_llvm_dbg_compositetype_type);
|
mod->addTypeName("llvm.dbg.compositetype.type", StructTy_llvm_dbg_compositetype_type);
|
||||||
|
|
||||||
std::vector<const Type*>StructTy_llvm_dbg_derivedtype_type_fields;
|
std::vector<const Type*>StructTy_llvm_dbg_derivedtype_type_fields;
|
||||||
|
@ -83,7 +83,7 @@ void RegisterDwarfSymbols(llvm::Module* mod) {
|
||||||
StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(64));
|
StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(64));
|
||||||
StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(32));
|
StructTy_llvm_dbg_derivedtype_type_fields.push_back(IntegerType::get(32));
|
||||||
StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_0);
|
StructTy_llvm_dbg_derivedtype_type_fields.push_back(PointerTy_0);
|
||||||
StructType* StructTy_llvm_dbg_derivedtype_type = StructType::get(StructTy_llvm_dbg_derivedtype_type_fields, /*isPacked=*/false);
|
StructType* StructTy_llvm_dbg_derivedtype_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_derivedtype_type_fields, /*isPacked=*/false);
|
||||||
mod->addTypeName("llvm.dbg.derivedtype.type", StructTy_llvm_dbg_derivedtype_type);
|
mod->addTypeName("llvm.dbg.derivedtype.type", StructTy_llvm_dbg_derivedtype_type);
|
||||||
|
|
||||||
std::vector<const Type*>StructTy_llvm_dbg_global_variable_type_fields;
|
std::vector<const Type*>StructTy_llvm_dbg_global_variable_type_fields;
|
||||||
|
@ -99,7 +99,7 @@ void RegisterDwarfSymbols(llvm::Module* mod) {
|
||||||
StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(1));
|
StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(1));
|
||||||
StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(1));
|
StructTy_llvm_dbg_global_variable_type_fields.push_back(IntegerType::get(1));
|
||||||
StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0);
|
StructTy_llvm_dbg_global_variable_type_fields.push_back(PointerTy_0);
|
||||||
StructType* StructTy_llvm_dbg_global_variable_type = StructType::get(StructTy_llvm_dbg_global_variable_type_fields, /*isPacked=*/false);
|
StructType* StructTy_llvm_dbg_global_variable_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_global_variable_type_fields, /*isPacked=*/false);
|
||||||
mod->addTypeName("llvm.dbg.global_variable.type", StructTy_llvm_dbg_global_variable_type);
|
mod->addTypeName("llvm.dbg.global_variable.type", StructTy_llvm_dbg_global_variable_type);
|
||||||
|
|
||||||
std::vector<const Type*>StructTy_llvm_dbg_subprogram_type_fields;
|
std::vector<const Type*>StructTy_llvm_dbg_subprogram_type_fields;
|
||||||
|
@ -114,7 +114,7 @@ void RegisterDwarfSymbols(llvm::Module* mod) {
|
||||||
StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0);
|
StructTy_llvm_dbg_subprogram_type_fields.push_back(PointerTy_0);
|
||||||
StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(1));
|
StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(1));
|
||||||
StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(1));
|
StructTy_llvm_dbg_subprogram_type_fields.push_back(IntegerType::get(1));
|
||||||
StructType* StructTy_llvm_dbg_subprogram_type = StructType::get(StructTy_llvm_dbg_subprogram_type_fields, /*isPacked=*/false);
|
StructType* StructTy_llvm_dbg_subprogram_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_subprogram_type_fields, /*isPacked=*/false);
|
||||||
mod->addTypeName("llvm.dbg.subprogram.type", StructTy_llvm_dbg_subprogram_type);
|
mod->addTypeName("llvm.dbg.subprogram.type", StructTy_llvm_dbg_subprogram_type);
|
||||||
|
|
||||||
std::vector<const Type*>StructTy_llvm_dbg_variable_type_fields;
|
std::vector<const Type*>StructTy_llvm_dbg_variable_type_fields;
|
||||||
|
@ -124,7 +124,7 @@ void RegisterDwarfSymbols(llvm::Module* mod) {
|
||||||
StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0);
|
StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0);
|
||||||
StructTy_llvm_dbg_variable_type_fields.push_back(IntegerType::get(32));
|
StructTy_llvm_dbg_variable_type_fields.push_back(IntegerType::get(32));
|
||||||
StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0);
|
StructTy_llvm_dbg_variable_type_fields.push_back(PointerTy_0);
|
||||||
StructType* StructTy_llvm_dbg_variable_type = StructType::get(StructTy_llvm_dbg_variable_type_fields, /*isPacked=*/false);
|
StructType* StructTy_llvm_dbg_variable_type = StructType::get(mod->getContext(), StructTy_llvm_dbg_variable_type_fields, /*isPacked=*/false);
|
||||||
mod->addTypeName("llvm.dbg.variable.type", StructTy_llvm_dbg_variable_type);
|
mod->addTypeName("llvm.dbg.variable.type", StructTy_llvm_dbg_variable_type);
|
||||||
|
|
||||||
std::vector<const Type*>FuncTy_3_args;
|
std::vector<const Type*>FuncTy_3_args;
|
||||||
|
|
|
@ -483,11 +483,7 @@ LDC_TARGETS
|
||||||
FeaturesStr = Features.getString();
|
FeaturesStr = Features.getString();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_REV < 77946
|
|
||||||
std::auto_ptr<llvm::TargetMachine> target(theTarget->createTargetMachine(mod, FeaturesStr));
|
|
||||||
#else
|
|
||||||
std::auto_ptr<llvm::TargetMachine> target(theTarget->createTargetMachine(mod.getTargetTriple(), FeaturesStr));
|
std::auto_ptr<llvm::TargetMachine> target(theTarget->createTargetMachine(mod.getTargetTriple(), FeaturesStr));
|
||||||
#endif
|
|
||||||
assert(target.get() && "Could not allocate target machine!");
|
assert(target.get() && "Could not allocate target machine!");
|
||||||
gTargetMachine = target.get();
|
gTargetMachine = target.get();
|
||||||
gTargetData = gTargetMachine->getTargetData();
|
gTargetData = gTargetMachine->getTargetData();
|
||||||
|
|
|
@ -447,7 +447,7 @@ void DtoCreateNestedContext(FuncDeclaration* fd) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const LLStructType* frameType = LLStructType::get(types);
|
const LLStructType* frameType = LLStructType::get(gIR->context(), types);
|
||||||
gIR->module->addTypeName(std::string("nest.") + fd->toChars(), frameType);
|
gIR->module->addTypeName(std::string("nest.") + fd->toChars(), frameType);
|
||||||
|
|
||||||
Logger::cout() << "frameType = " << *frameType << '\n';
|
Logger::cout() << "frameType = " << *frameType << '\n';
|
||||||
|
|
|
@ -142,7 +142,7 @@ void RTTIBuilder::push_funcptr(FuncDeclaration* fd, Type* castto)
|
||||||
void RTTIBuilder::finalize(IrGlobal* tid)
|
void RTTIBuilder::finalize(IrGlobal* tid)
|
||||||
{
|
{
|
||||||
// create the inititalizer
|
// create the inititalizer
|
||||||
LLConstant* tiInit = LLConstantStruct::get(&inits[0], inits.size(), false);
|
LLConstant* tiInit = LLConstantStruct::get(gIR->context(), &inits[0], inits.size(), false);
|
||||||
|
|
||||||
// refine global type
|
// refine global type
|
||||||
llvm::cast<llvm::OpaqueType>(tid->type.get())->refineAbstractTypeTo(tiInit->getType());
|
llvm::cast<llvm::OpaqueType>(tid->type.get())->refineAbstractTypeTo(tiInit->getType());
|
||||||
|
@ -154,5 +154,5 @@ void RTTIBuilder::finalize(IrGlobal* tid)
|
||||||
LLConstant* RTTIBuilder::get_constant()
|
LLConstant* RTTIBuilder::get_constant()
|
||||||
{
|
{
|
||||||
// just return the inititalizer
|
// just return the inititalizer
|
||||||
return LLConstantStruct::get(&inits[0], inits.size(), false);
|
return LLConstantStruct::get(gIR->context(), &inits[0], inits.size(), false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ static const LLType* rt_ptr(const LLType* t)
|
||||||
|
|
||||||
static const LLType* rt_array(const LLType* elemty)
|
static const LLType* rt_array(const LLType* elemty)
|
||||||
{
|
{
|
||||||
return llvm::StructType::get(DtoSize_t(), rt_ptr(elemty), NULL);
|
return llvm::StructType::get(gIR->context(), DtoSize_t(), rt_ptr(elemty), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const LLType* rt_dg1()
|
static const LLType* rt_dg1()
|
||||||
|
@ -133,7 +133,7 @@ static const LLType* rt_dg1()
|
||||||
types.push_back(rt_ptr(LLType::Int8Ty));
|
types.push_back(rt_ptr(LLType::Int8Ty));
|
||||||
types.push_back(rt_ptr(LLType::Int8Ty));
|
types.push_back(rt_ptr(LLType::Int8Ty));
|
||||||
const llvm::FunctionType* fty = llvm::FunctionType::get(LLType::Int32Ty, types, false);
|
const llvm::FunctionType* fty = llvm::FunctionType::get(LLType::Int32Ty, types, false);
|
||||||
return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL);
|
return llvm::StructType::get(gIR->context(), rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const LLType* rt_dg2()
|
static const LLType* rt_dg2()
|
||||||
|
@ -143,7 +143,7 @@ static const LLType* rt_dg2()
|
||||||
types.push_back(rt_ptr(LLType::Int8Ty));
|
types.push_back(rt_ptr(LLType::Int8Ty));
|
||||||
types.push_back(rt_ptr(LLType::Int8Ty));
|
types.push_back(rt_ptr(LLType::Int8Ty));
|
||||||
const llvm::FunctionType* fty = llvm::FunctionType::get(LLType::Int32Ty, types, false);
|
const llvm::FunctionType* fty = llvm::FunctionType::get(LLType::Int32Ty, types, false);
|
||||||
return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL);
|
return llvm::StructType::get(gIR->context(), rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LLVM_D_BuildRuntimeModule()
|
static void LLVM_D_BuildRuntimeModule()
|
||||||
|
@ -169,9 +169,9 @@ static void LLVM_D_BuildRuntimeModule()
|
||||||
else
|
else
|
||||||
realTy = LLType::DoubleTy;
|
realTy = LLType::DoubleTy;
|
||||||
|
|
||||||
const LLType* cfloatTy = llvm::StructType::get(floatTy, floatTy, NULL);
|
const LLType* cfloatTy = llvm::StructType::get(gIR->context(), floatTy, floatTy, NULL);
|
||||||
const LLType* cdoubleTy = llvm::StructType::get(doubleTy, doubleTy, NULL);
|
const LLType* cdoubleTy = llvm::StructType::get(gIR->context(), doubleTy, doubleTy, NULL);
|
||||||
const LLType* crealTy = llvm::StructType::get(realTy, realTy, NULL);
|
const LLType* crealTy = llvm::StructType::get(gIR->context(), realTy, realTy, NULL);
|
||||||
|
|
||||||
Logger::println("building aggr types");
|
Logger::println("building aggr types");
|
||||||
const LLType* voidPtrTy = rt_ptr(byteTy);
|
const LLType* voidPtrTy = rt_ptr(byteTy);
|
||||||
|
|
|
@ -825,7 +825,7 @@ void SwitchStatement::toIR(IRState* p)
|
||||||
std::vector<const LLType*> types;
|
std::vector<const LLType*> types;
|
||||||
types.push_back(DtoSize_t());
|
types.push_back(DtoSize_t());
|
||||||
types.push_back(elemPtrTy);
|
types.push_back(elemPtrTy);
|
||||||
const llvm::StructType* sTy = llvm::StructType::get(types);
|
const llvm::StructType* sTy = llvm::StructType::get(gIR->context(), types);
|
||||||
std::vector<LLConstant*> sinits;
|
std::vector<LLConstant*> sinits;
|
||||||
sinits.push_back(DtoConstSize_t(inits.size()));
|
sinits.push_back(DtoConstSize_t(inits.size()));
|
||||||
sinits.push_back(arrPtr);
|
sinits.push_back(arrPtr);
|
||||||
|
|
|
@ -362,7 +362,7 @@ LLType* DtoUnpaddedStructType(Type* dty) {
|
||||||
}
|
}
|
||||||
types.push_back(fty);
|
types.push_back(fty);
|
||||||
}
|
}
|
||||||
LLType* Ty = LLStructType::get(types);
|
LLType* Ty = LLStructType::get(gIR->context(), types);
|
||||||
cache.insert(std::make_pair(dty, Ty));
|
cache.insert(std::make_pair(dty, Ty));
|
||||||
return Ty;
|
return Ty;
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,11 +160,11 @@ void DtoBuildDVarArgList(std::vector<LLValue*>& args, std::vector<llvm::Attribut
|
||||||
gah.push_back(DtoSize_t());
|
gah.push_back(DtoSize_t());
|
||||||
gah_sz += PTRSIZE;
|
gah_sz += PTRSIZE;
|
||||||
}
|
}
|
||||||
vtypes.back() = LLStructType::get(gah, true);
|
vtypes.back() = LLStructType::get(gIR->context(), gah, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const LLStructType* vtype = LLStructType::get(vtypes);
|
const LLStructType* vtype = LLStructType::get(gIR->context(), vtypes);
|
||||||
|
|
||||||
if (Logger::enabled())
|
if (Logger::enabled())
|
||||||
Logger::cout() << "d-variadic argument struct type:\n" << *vtype << '\n';
|
Logger::cout() << "d-variadic argument struct type:\n" << *vtype << '\n';
|
||||||
|
@ -207,7 +207,7 @@ void DtoBuildDVarArgList(std::vector<LLValue*>& args, std::vector<llvm::Attribut
|
||||||
pinits.push_back(DtoConstSize_t(vtype->getNumElements()));
|
pinits.push_back(DtoConstSize_t(vtype->getNumElements()));
|
||||||
pinits.push_back(llvm::ConstantExpr::getBitCast(typeinfomem, getPtrToType(typeinfotype)));
|
pinits.push_back(llvm::ConstantExpr::getBitCast(typeinfomem, getPtrToType(typeinfotype)));
|
||||||
const LLType* tiarrty = DtoType(Type::typeinfo->type->arrayOf());
|
const LLType* tiarrty = DtoType(Type::typeinfo->type->arrayOf());
|
||||||
tiinits = LLConstantStruct::get(pinits);
|
tiinits = LLConstantStruct::get(gIR->context(), pinits);
|
||||||
LLValue* typeinfoarrayparam = new llvm::GlobalVariable(*gIR->module, tiarrty,
|
LLValue* typeinfoarrayparam = new llvm::GlobalVariable(*gIR->module, tiarrty,
|
||||||
true, llvm::GlobalValue::InternalLinkage, tiinits, "._arguments.array");
|
true, llvm::GlobalValue::InternalLinkage, tiinits, "._arguments.array");
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
using namespace llvm::dwarf;
|
using namespace llvm::dwarf;
|
||||||
|
|
||||||
#define DBG_NULL ( LLConstant::getNullValue(DBG_TYPE) )
|
#define DBG_NULL ( LLConstant::getNullValue(DBG_TYPE) )
|
||||||
#define DBG_TYPE ( getPtrToType(llvm::StructType::get(NULL,NULL)) )
|
#define DBG_TYPE ( getPtrToType(llvm::StructType::get(gIR->context(),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) ( llvm::ConstantExpr::getAdd( DtoConstUint( X ), DtoConstUint( llvm::LLVMDebugVersion ) ) )
|
||||||
|
|
|
@ -2517,7 +2517,7 @@ LLConstant* StructLiteralExp::toConstElem(IRState* p)
|
||||||
constvals[i] = llvm::cast<LLConstant>(values[i]);
|
constvals[i] = llvm::cast<LLConstant>(values[i]);
|
||||||
|
|
||||||
// return constant struct
|
// return constant struct
|
||||||
return LLConstantStruct::get(constvals, sd->ir.irStruct->packed);
|
return LLConstantStruct::get(gIR->context(), constvals, sd->ir.irStruct->packed);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -817,11 +817,11 @@ const LLStructType* DtoInterfaceInfoType()
|
||||||
vtbltypes.push_back(DtoSize_t());
|
vtbltypes.push_back(DtoSize_t());
|
||||||
const LLType* byteptrptrty = getPtrToType(getPtrToType(LLType::Int8Ty));
|
const LLType* byteptrptrty = getPtrToType(getPtrToType(LLType::Int8Ty));
|
||||||
vtbltypes.push_back(byteptrptrty);
|
vtbltypes.push_back(byteptrptrty);
|
||||||
types.push_back(LLStructType::get(vtbltypes));
|
types.push_back(LLStructType::get(gIR->context(), vtbltypes));
|
||||||
// int offset
|
// int offset
|
||||||
types.push_back(LLType::Int32Ty);
|
types.push_back(LLType::Int32Ty);
|
||||||
// create type
|
// create type
|
||||||
gIR->interfaceInfoType = LLStructType::get(types);
|
gIR->interfaceInfoType = LLStructType::get(gIR->context(), types);
|
||||||
|
|
||||||
return gIR->interfaceInfoType;
|
return gIR->interfaceInfoType;
|
||||||
}
|
}
|
||||||
|
@ -838,20 +838,20 @@ const LLStructType* DtoMutexType()
|
||||||
{
|
{
|
||||||
// CRITICAL_SECTION.sizeof == 68
|
// CRITICAL_SECTION.sizeof == 68
|
||||||
std::vector<const LLType*> types(17, LLType::Int32Ty);
|
std::vector<const LLType*> types(17, LLType::Int32Ty);
|
||||||
return LLStructType::get(types);
|
return LLStructType::get(gIR->context(), types);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FreeBSD
|
// FreeBSD
|
||||||
else if (global.params.os == OSFreeBSD) {
|
else if (global.params.os == OSFreeBSD) {
|
||||||
// Just a pointer
|
// Just a pointer
|
||||||
return LLStructType::get(DtoSize_t(), NULL);
|
return LLStructType::get(gIR->context(), DtoSize_t(), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// pthread_fastlock
|
// pthread_fastlock
|
||||||
std::vector<const LLType*> types2;
|
std::vector<const LLType*> types2;
|
||||||
types2.push_back(DtoSize_t());
|
types2.push_back(DtoSize_t());
|
||||||
types2.push_back(LLType::Int32Ty);
|
types2.push_back(LLType::Int32Ty);
|
||||||
const LLStructType* fastlock = LLStructType::get(types2);
|
const LLStructType* fastlock = LLStructType::get(gIR->context(), types2);
|
||||||
|
|
||||||
// pthread_mutex
|
// pthread_mutex
|
||||||
std::vector<const LLType*> types1;
|
std::vector<const LLType*> types1;
|
||||||
|
@ -860,7 +860,7 @@ const LLStructType* DtoMutexType()
|
||||||
types1.push_back(getVoidPtrType());
|
types1.push_back(getVoidPtrType());
|
||||||
types1.push_back(LLType::Int32Ty);
|
types1.push_back(LLType::Int32Ty);
|
||||||
types1.push_back(fastlock);
|
types1.push_back(fastlock);
|
||||||
const LLStructType* pmutex = LLStructType::get(types1);
|
const LLStructType* pmutex = LLStructType::get(gIR->context(), types1);
|
||||||
|
|
||||||
// D_CRITICAL_SECTION
|
// D_CRITICAL_SECTION
|
||||||
LLOpaqueType* opaque = LLOpaqueType::get();
|
LLOpaqueType* opaque = LLOpaqueType::get();
|
||||||
|
@ -869,7 +869,7 @@ const LLStructType* DtoMutexType()
|
||||||
types.push_back(pmutex);
|
types.push_back(pmutex);
|
||||||
|
|
||||||
// resolve type
|
// resolve type
|
||||||
pmutex = LLStructType::get(types);
|
pmutex = LLStructType::get(gIR->context(), types);
|
||||||
LLPATypeHolder pa(pmutex);
|
LLPATypeHolder pa(pmutex);
|
||||||
opaque->refineAbstractTypeTo(pa.get());
|
opaque->refineAbstractTypeTo(pa.get());
|
||||||
pmutex = isaStruct(pa.get());
|
pmutex = isaStruct(pa.get());
|
||||||
|
@ -895,7 +895,7 @@ const LLStructType* DtoModuleReferenceType()
|
||||||
types.push_back(DtoType(Module::moduleinfo->type));
|
types.push_back(DtoType(Module::moduleinfo->type));
|
||||||
|
|
||||||
// resolve type
|
// resolve type
|
||||||
const LLStructType* st = LLStructType::get(types);
|
const LLStructType* st = LLStructType::get(gIR->context(), types);
|
||||||
LLPATypeHolder pa(st);
|
LLPATypeHolder pa(st);
|
||||||
opaque->refineAbstractTypeTo(pa.get());
|
opaque->refineAbstractTypeTo(pa.get());
|
||||||
st = isaStruct(pa.get());
|
st = isaStruct(pa.get());
|
||||||
|
@ -917,7 +917,7 @@ LLValue* DtoAggrPair(const LLType* type, LLValue* V1, LLValue* V2, const char* n
|
||||||
|
|
||||||
LLValue* DtoAggrPair(LLValue* V1, LLValue* V2, const char* name)
|
LLValue* DtoAggrPair(LLValue* V1, LLValue* V2, const char* name)
|
||||||
{
|
{
|
||||||
const LLType* t = LLStructType::get(V1->getType(), V2->getType(), NULL);
|
const LLType* t = LLStructType::get(gIR->context(), V1->getType(), V2->getType(), NULL);
|
||||||
return DtoAggrPair(t, V1, V2, name);
|
return DtoAggrPair(t, V1, V2, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -405,7 +405,7 @@ void assemble(const llvm::sys::Path& asmpath, const llvm::sys::Path& objpath)
|
||||||
|
|
||||||
// the following code generates functions and needs to output
|
// the following code generates functions and needs to output
|
||||||
// debug info. these macros are useful for that
|
// debug info. these macros are useful for that
|
||||||
#define DBG_TYPE ( getPtrToType(llvm::StructType::get(NULL,NULL)) )
|
#define DBG_TYPE ( getPtrToType(llvm::StructType::get(gIR->context(),NULL,NULL)) )
|
||||||
#define DBG_CAST(X) ( llvm::ConstantExpr::getBitCast(X, DBG_TYPE) )
|
#define DBG_CAST(X) ( llvm::ConstantExpr::getBitCast(X, DBG_TYPE) )
|
||||||
|
|
||||||
// build module ctor
|
// build module ctor
|
||||||
|
@ -811,7 +811,7 @@ void Module::genmoduleinfo()
|
||||||
std::vector<const LLType*> magictypes;
|
std::vector<const LLType*> magictypes;
|
||||||
magictypes.push_back(LLType::Int32Ty);
|
magictypes.push_back(LLType::Int32Ty);
|
||||||
magictypes.push_back(getPtrToType(magicfty));
|
magictypes.push_back(getPtrToType(magicfty));
|
||||||
const LLStructType* magicsty = LLStructType::get(magictypes);
|
const LLStructType* magicsty = LLStructType::get(gIR->context(), magictypes);
|
||||||
|
|
||||||
// make the constant element
|
// make the constant element
|
||||||
std::vector<LLConstant*> magicconstants;
|
std::vector<LLConstant*> magicconstants;
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "gen/llvm.h"
|
#include "gen/llvm.h"
|
||||||
#include "gen/llvm-version.h"
|
|
||||||
|
|
||||||
#include "mars.h"
|
#include "mars.h"
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
|
@ -318,11 +317,7 @@ void DtoResolveTypeInfo(TypeInfoDeclaration* tid)
|
||||||
mdVals[TD_Confirm] = llvm::cast<MDNodeField>(irg->value);
|
mdVals[TD_Confirm] = llvm::cast<MDNodeField>(irg->value);
|
||||||
mdVals[TD_Type] = llvm::UndefValue::get(DtoType(tid->tinfo));
|
mdVals[TD_Type] = llvm::UndefValue::get(DtoType(tid->tinfo));
|
||||||
// Construct the metadata
|
// Construct the metadata
|
||||||
#if LLVM_REV < 77733
|
|
||||||
llvm::MetadataBase* metadata = gIR->context().getMDNode(mdVals, TD_NumFields);
|
|
||||||
#else
|
|
||||||
llvm::MetadataBase* metadata = llvm::MDNode::get(gIR->context(), mdVals, TD_NumFields);
|
llvm::MetadataBase* metadata = llvm::MDNode::get(gIR->context(), mdVals, TD_NumFields);
|
||||||
#endif
|
|
||||||
// Insert it into the module
|
// Insert it into the module
|
||||||
llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module);
|
llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include "declaration.h"
|
#include "declaration.h"
|
||||||
#include "mtype.h"
|
#include "mtype.h"
|
||||||
|
|
||||||
#include "gen/llvm-version.h"
|
|
||||||
#include "gen/irstate.h"
|
#include "gen/irstate.h"
|
||||||
#include "gen/logger.h"
|
#include "gen/logger.h"
|
||||||
#include "gen/tollvm.h"
|
#include "gen/tollvm.h"
|
||||||
|
@ -87,11 +86,7 @@ LLGlobalVariable * IrStruct::getClassInfoSymbol()
|
||||||
mdVals[CD_Finalize] = LLConstantInt::get(LLType::Int1Ty, hasDestructor);
|
mdVals[CD_Finalize] = LLConstantInt::get(LLType::Int1Ty, hasDestructor);
|
||||||
mdVals[CD_CustomDelete] = LLConstantInt::get(LLType::Int1Ty, hasCustomDelete);
|
mdVals[CD_CustomDelete] = LLConstantInt::get(LLType::Int1Ty, hasCustomDelete);
|
||||||
// Construct the metadata
|
// 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);
|
llvm::MetadataBase* metadata = llvm::MDNode::get(gIR->context(), mdVals, CD_NumFields);
|
||||||
#endif
|
|
||||||
// Insert it into the module
|
// Insert it into the module
|
||||||
std::string metaname = CD_PREFIX + initname;
|
std::string metaname = CD_PREFIX + initname;
|
||||||
llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module);
|
llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module);
|
||||||
|
@ -177,7 +172,7 @@ LLConstant * IrStruct::getVtblInit()
|
||||||
}
|
}
|
||||||
|
|
||||||
// build the constant struct
|
// build the constant struct
|
||||||
constVtbl = LLConstantStruct::get(constants, false);
|
constVtbl = LLConstantStruct::get(gIR->context(), constants, false);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
IF_LOG Logger::cout() << "constVtbl type: " << *constVtbl->getType() << std::endl;
|
IF_LOG Logger::cout() << "constVtbl type: " << *constVtbl->getType() << std::endl;
|
||||||
|
@ -321,7 +316,7 @@ LLConstant * IrStruct::createClassDefaultInitializer()
|
||||||
addBaseClassInits(constants, cd, offset, field_index);
|
addBaseClassInits(constants, cd, offset, field_index);
|
||||||
|
|
||||||
// build the constant
|
// build the constant
|
||||||
llvm::Constant* definit = LLConstantStruct::get(constants, false);
|
llvm::Constant* definit = LLConstantStruct::get(gIR->context(), constants, false);
|
||||||
|
|
||||||
return definit;
|
return definit;
|
||||||
}
|
}
|
||||||
|
@ -389,7 +384,7 @@ llvm::GlobalVariable * IrStruct::getInterfaceVtbl(BaseClass * b, bool new_instan
|
||||||
}
|
}
|
||||||
|
|
||||||
// build the vtbl constant
|
// 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
|
// create the global variable to hold it
|
||||||
llvm::GlobalValue::LinkageTypes _linkage = DtoExternalLinkage(aggrdecl);
|
llvm::GlobalValue::LinkageTypes _linkage = DtoExternalLinkage(aggrdecl);
|
||||||
|
@ -488,7 +483,7 @@ LLConstant * IrStruct::getClassInfoInterfaces()
|
||||||
|
|
||||||
// create Interface struct
|
// create Interface struct
|
||||||
LLConstant* inits[3] = { ci, vtb, off };
|
LLConstant* inits[3] = { ci, vtb, off };
|
||||||
LLConstant* entry = LLConstantStruct::get(inits, 3);
|
LLConstant* entry = LLConstantStruct::get(gIR->context(), inits, 3);
|
||||||
constants.push_back(entry);
|
constants.push_back(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ LLConstant * IrStruct::createStructDefaultInitializer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// build constant struct
|
// build constant struct
|
||||||
llvm::Constant* definit = LLConstantStruct::get(constants, packed);
|
llvm::Constant* definit = LLConstantStruct::get(gIR->context(), constants, packed);
|
||||||
#if 0
|
#if 0
|
||||||
IF_LOG Logger::cout() << "final default initializer: " << *definit << std::endl;
|
IF_LOG Logger::cout() << "final default initializer: " << *definit << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
@ -384,7 +384,7 @@ LLConstant * IrStruct::createStructInitializer(StructInitializer * si)
|
||||||
|
|
||||||
// build constant
|
// build constant
|
||||||
assert(!constants.empty());
|
assert(!constants.empty());
|
||||||
llvm::Constant* c = LLConstantStruct::get(&constants[0], constants.size(), packed);
|
llvm::Constant* c = LLConstantStruct::get(gIR->context(), &constants[0], constants.size(), packed);
|
||||||
IF_LOG Logger::cout() << "final struct initializer: " << *c << std::endl;
|
IF_LOG Logger::cout() << "final struct initializer: " << *c << std::endl;
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,17 +92,17 @@ const llvm::Type * IrTypeBasic::basic2llvm(Type* t)
|
||||||
|
|
||||||
case Tcomplex32:
|
case Tcomplex32:
|
||||||
t2 = llvm::Type::FloatTy;
|
t2 = llvm::Type::FloatTy;
|
||||||
return llvm::StructType::get(t2, t2, NULL);
|
return llvm::StructType::get(gIR->context(), t2, t2, NULL);
|
||||||
|
|
||||||
case Tcomplex64:
|
case Tcomplex64:
|
||||||
t2 = llvm::Type::DoubleTy;
|
t2 = llvm::Type::DoubleTy;
|
||||||
return llvm::StructType::get(t2, t2, NULL);
|
return llvm::StructType::get(gIR->context(), t2, t2, NULL);
|
||||||
|
|
||||||
case Tcomplex80:
|
case Tcomplex80:
|
||||||
t2 = (global.params.cpu == ARCHx86 || global.params.cpu == ARCHx86_64)
|
t2 = (global.params.cpu == ARCHx86 || global.params.cpu == ARCHx86_64)
|
||||||
? llvm::Type::X86_FP80Ty
|
? llvm::Type::X86_FP80Ty
|
||||||
: llvm::Type::DoubleTy;
|
: llvm::Type::DoubleTy;
|
||||||
return llvm::StructType::get(t2, t2, NULL);
|
return llvm::StructType::get(gIR->context(), t2, t2, NULL);
|
||||||
|
|
||||||
case Tbool:
|
case Tbool:
|
||||||
return llvm::Type::Int1Ty;
|
return llvm::Type::Int1Ty;
|
||||||
|
@ -204,7 +204,7 @@ const llvm::Type * IrTypeArray::array2llvm(Type * t)
|
||||||
elemType = llvm::PointerType::get(elemType, 0);
|
elemType = llvm::PointerType::get(elemType, 0);
|
||||||
|
|
||||||
// create struct type
|
// create struct type
|
||||||
const llvm::Type* at = llvm::StructType::get(DtoSize_t(), elemType, NULL);
|
const llvm::Type* at = llvm::StructType::get(gIR->context(), DtoSize_t(), elemType, NULL);
|
||||||
|
|
||||||
// name dynamic array types
|
// name dynamic array types
|
||||||
Type::sir->getState()->module->addTypeName(t->toChars(), at);
|
Type::sir->getState()->module->addTypeName(t->toChars(), at);
|
||||||
|
|
|
@ -258,7 +258,7 @@ const llvm::Type* IrTypeClass::buildType()
|
||||||
fatal();
|
fatal();
|
||||||
|
|
||||||
// build the llvm type
|
// build the llvm type
|
||||||
const llvm::Type* st = llvm::StructType::get(defaultTypes, false);
|
const llvm::Type* st = llvm::StructType::get(gIR->context(), defaultTypes, false);
|
||||||
|
|
||||||
// refine type
|
// refine type
|
||||||
llvm::cast<llvm::OpaqueType>(pa.get())->refineAbstractTypeTo(st);
|
llvm::cast<llvm::OpaqueType>(pa.get())->refineAbstractTypeTo(st);
|
||||||
|
@ -324,7 +324,7 @@ const llvm::Type* IrTypeClass::buildVtblType(Type* first, Array* vtbl_array)
|
||||||
}
|
}
|
||||||
|
|
||||||
// build the vtbl llvm type
|
// build the vtbl llvm type
|
||||||
return llvm::StructType::get(types, false);
|
return llvm::StructType::get(gIR->context(), types, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -39,7 +39,7 @@ const llvm::Type * IrTypeDelegate::buildType()
|
||||||
const LLType* i8ptr = getVoidPtrType();
|
const LLType* i8ptr = getVoidPtrType();
|
||||||
const LLType* func = DtoFunctionType(dtype->nextOf(), NULL, Type::tvoid->pointerTo());
|
const LLType* func = DtoFunctionType(dtype->nextOf(), NULL, Type::tvoid->pointerTo());
|
||||||
const LLType* funcptr = getPtrToType(func);
|
const LLType* funcptr = getPtrToType(func);
|
||||||
const LLStructType* dgtype = LLStructType::get(i8ptr, funcptr, NULL);
|
const LLStructType* dgtype = LLStructType::get(gIR->context(), i8ptr, funcptr, NULL);
|
||||||
gIR->module->addTypeName(dtype->toChars(), dgtype);
|
gIR->module->addTypeName(dtype->toChars(), dgtype);
|
||||||
|
|
||||||
llvm::cast<llvm::OpaqueType>(pa.get())->refineAbstractTypeTo(dgtype);
|
llvm::cast<llvm::OpaqueType>(pa.get())->refineAbstractTypeTo(dgtype);
|
||||||
|
|
|
@ -219,7 +219,7 @@ const llvm::Type* IrTypeStruct::buildType()
|
||||||
}
|
}
|
||||||
|
|
||||||
// build the llvm type
|
// build the llvm type
|
||||||
const llvm::Type* st = llvm::StructType::get(defaultTypes, packed);
|
const llvm::Type* st = llvm::StructType::get(gIR->context(), defaultTypes, packed);
|
||||||
|
|
||||||
// refine type
|
// refine type
|
||||||
llvm::cast<llvm::OpaqueType>(pa.get())->refineAbstractTypeTo(st);
|
llvm::cast<llvm::OpaqueType>(pa.get())->refineAbstractTypeTo(st);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue