Improve array append performance.

Actually use the appropriate runtime function, instead of just
growing the array by one!
This commit is contained in:
Christian Kamm
2010-02-14 10:11:05 +01:00
parent e53b6a20f3
commit 9cd32549c4
5 changed files with 95 additions and 31 deletions

View File

@@ -326,6 +326,17 @@ static void LLVM_D_BuildRuntimeModule()
llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M);
}
// void* _d_arrayappendcT(TypeInfo ti, void* array, void* element)
{
llvm::StringRef fname("_d_arrayappendcT");
std::vector<const LLType*> types;
types.push_back(typeInfoTy);
types.push_back(voidPtrTy);
types.push_back(voidPtrTy);
const llvm::FunctionType* fty = llvm::FunctionType::get(rt_array(byteTy), types, false);
llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M);
}
// Object _d_allocclass(ClassInfo ci)
{
llvm::StringRef fname("_d_allocclass");