mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-08 03:46:02 +03: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:
parent
f2662c3660
commit
0a376b9c71
3 changed files with 7 additions and 2 deletions
|
@ -583,7 +583,9 @@ DSliceValue* DtoNewDynArray(Loc& loc, Type* arrayType, DValue* dim, bool default
|
|||
defaultInit = false;
|
||||
bool zeroInit = eltType->isZeroInit();
|
||||
|
||||
const char* fnname = zeroInit ? "_d_newarrayT" : "_d_newarrayiT";
|
||||
const char* fnname = defaultInit ?
|
||||
(zeroInit ? "_d_newarrayT" : "_d_newarrayiT") :
|
||||
"_d_newarrayvT";
|
||||
LLFunction* fn = LLVM_D_GetRuntimeFunction(gIR->module, fnname);
|
||||
|
||||
// call allocator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue