mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Merge commit 989879f8fded from llvm git (by Paul Walker):
[Clang] Allow C++11 style initialisation of SVE types. Fixes https://github.com/llvm/llvm-project/issues/63223 Differential Revision: https://reviews.llvm.org/D153560 Requested by: andrew MFC after: 3 days (cherry picked from commit 641efdd10cc3ad05fb7eaeeae20b15c5ad4128c8)
This commit is contained in:
parent
b277fb9996
commit
6bbffa1a32
1 changed files with 17 additions and 0 deletions
|
|
@ -1861,6 +1861,23 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr *E) {
|
|||
return Visit(E->getInit(0));
|
||||
}
|
||||
|
||||
if (isa<llvm::ScalableVectorType>(VType)) {
|
||||
if (NumInitElements == 0) {
|
||||
// C++11 value-initialization for the vector.
|
||||
return EmitNullValue(E->getType());
|
||||
}
|
||||
|
||||
if (NumInitElements == 1) {
|
||||
Expr *InitVector = E->getInit(0);
|
||||
|
||||
// Initialize from another scalable vector of the same type.
|
||||
if (InitVector->getType() == E->getType())
|
||||
return Visit(InitVector);
|
||||
}
|
||||
|
||||
llvm_unreachable("Unexpected initialization of a scalable vector!");
|
||||
}
|
||||
|
||||
unsigned ResElts = cast<llvm::FixedVectorType>(VType)->getNumElements();
|
||||
|
||||
// Loop over initializers collecting the Value for each, and remembering
|
||||
|
|
|
|||
Loading…
Reference in a new issue