mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 08:30:47 +03:00
Initialization of vector types with single value.
Fixes DMD testcase 'testargtypes'.
This commit is contained in:
parent
9ac1582726
commit
508652fd8b
1 changed files with 6 additions and 0 deletions
|
@ -1501,6 +1501,12 @@ LLConstant* DtoConstExpInit(Loc loc, Type* type, Expression* exp)
|
|||
Logger::println("type is a static array, building constant array initializer to single value");
|
||||
return expand_to_sarray(base, exp);
|
||||
}
|
||||
else if (base->ty == Tvector)
|
||||
{
|
||||
LLConstant* val = exp->toConstElem(gIR);
|
||||
TypeVector* tv = (TypeVector*)base;
|
||||
return llvm::ConstantVector::getSplat(tv->size(loc), val);
|
||||
}
|
||||
else
|
||||
{
|
||||
error("cannot yet convert default initializer %s of type %s to %s", exp->toChars(), exp->type->toChars(), type->toChars());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue