mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-05 06:23:13 +01:00
Avoid unnecessary memset when allocating array literals.
This completes the merge of pull request #294. Thanks a lot to Chris Holdsworth who originally wrote the patch! GitHub: Fixes #294. GitHub: Fixes #141.
This commit is contained in:
@@ -342,13 +342,16 @@ static void LLVM_D_BuildRuntimeModule()
|
||||
}
|
||||
// void[] _d_newarrayT(TypeInfo ti, size_t length)
|
||||
// void[] _d_newarrayiT(TypeInfo ti, size_t length)
|
||||
// void[] _d_newarrayvT(TypeInfo ti, size_t length)
|
||||
{
|
||||
llvm::StringRef fname("_d_newarrayT");
|
||||
llvm::StringRef fname2("_d_newarrayiT");
|
||||
llvm::StringRef fname3("_d_newarrayvT");
|
||||
LLType *types[] = { typeInfoTy, sizeTy };
|
||||
LLFunctionType* fty = llvm::FunctionType::get(voidArrayTy, types, false);
|
||||
llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M);
|
||||
llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M);
|
||||
llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname3, M);
|
||||
}
|
||||
// void[] _d_newarraymT(TypeInfo ti, size_t length, size_t* dims)
|
||||
// void[] _d_newarraymiT(TypeInfo ti, size_t length, size_t* dims)
|
||||
|
||||
Reference in New Issue
Block a user