Mercurial > projects > ldc
diff gen/runtime.cpp @ 1633:5c0cebff9be8
Improve array append performance.
Actually use the appropriate runtime function, instead of just
growing the array by one!
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 14 Feb 2010 10:11:05 +0100 |
parents | 30bdcfb8299e |
children |
line wrap: on
line diff
--- a/gen/runtime.cpp Sun Sep 13 22:15:33 2009 +0300 +++ b/gen/runtime.cpp Sun Feb 14 10:11:05 2010 +0100 @@ -326,6 +326,17 @@ 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");