mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Replace SmallVector/vector with C array for type lists
This commit is contained in:
@@ -57,10 +57,8 @@ IrTypeBasic* IrTypeBasic::get(Type* dt)
|
||||
|
||||
LLType* IrTypeBasic::getComplexType(llvm::LLVMContext& ctx, LLType* type)
|
||||
{
|
||||
llvm::SmallVector<LLType*, 2> types;
|
||||
types.push_back(type);
|
||||
types.push_back(type);
|
||||
return llvm::StructType::get(ctx, types);
|
||||
llvm::Type *types[] = { type, type };
|
||||
return llvm::StructType::get(ctx, types, false);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -235,10 +233,8 @@ IrTypeArray* IrTypeArray::get(Type* dt)
|
||||
// just as for pointers.
|
||||
if (!dt->irtype)
|
||||
{
|
||||
llvm::SmallVector<LLType*, 2> types;
|
||||
types.push_back(DtoSize_t());
|
||||
types.push_back(llvm::PointerType::get(elemType, 0));
|
||||
LLType* at = llvm::StructType::get(llvm::getGlobalContext(), types/*, t->toChars()*/);
|
||||
llvm::Type *types[] = { DtoSize_t(), llvm::PointerType::get(elemType, 0) };
|
||||
LLType* at = llvm::StructType::get(llvm::getGlobalContext(), types, false);
|
||||
dt->irtype = new IrTypeArray(dt, at);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,10 +72,9 @@ IrTypeDelegate* IrTypeDelegate::get(Type* dt)
|
||||
"picked up random pre-existing type?"
|
||||
);
|
||||
|
||||
llvm::SmallVector<LLType*, 2> types;
|
||||
types.push_back(getVoidPtrType());
|
||||
types.push_back(getPtrToType(dt->nextOf()->irtype->getLLType()));
|
||||
LLStructType* lt = LLStructType::get(gIR->context(), types);
|
||||
llvm::Type *types[] = { getVoidPtrType(),
|
||||
getPtrToType(dt->nextOf()->irtype->getLLType()) };
|
||||
LLStructType* lt = LLStructType::get(gIR->context(), types, false);
|
||||
dt->irtype = new IrTypeDelegate(dt, lt);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user