mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 16:11:08 +03:00
Use llvm.memset
instead of _d_array_init_i1
and _d_array_init_i8
.
This exposes what's happening to LLVM, and memset is probably faster than the runtime functions we were using anyway.
This commit is contained in:
parent
1958e17734
commit
f79e40a491
4 changed files with 22 additions and 22 deletions
|
@ -112,15 +112,16 @@ void DtoArrayInit(Loc& loc, DValue* array, DValue* value)
|
|||
switch (arrayelemty->ty)
|
||||
{
|
||||
case Tbool:
|
||||
funcname = "_d_array_init_i1";
|
||||
break;
|
||||
val = gIR->ir->CreateZExt(val, LLType::Int8Ty, ".bool");
|
||||
// fall through
|
||||
|
||||
case Tvoid:
|
||||
case Tchar:
|
||||
case Tint8:
|
||||
case Tuns8:
|
||||
funcname = "_d_array_init_i8";
|
||||
break;
|
||||
Logger::println("Using memset for array init");
|
||||
DtoMemSet(ptr, val, dim);
|
||||
return;
|
||||
|
||||
case Twchar:
|
||||
case Tint16:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue