Skip to content

Commit 4186f00

Browse files
authored
Merge branch 'main' into main
2 parents 43fbfa2 + b975a7b commit 4186f00

File tree

175 files changed

+4287
-1207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+4287
-1207
lines changed

clang/cmake/caches/Fuchsia.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
179179
set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
180180

181181
if(FUCHSIA_ENABLE_PGO)
182-
set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "")
182+
set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED IR CACHE BOOL "")
183183

184184
set(_FUCHSIA_BOOTSTRAP_TARGETS
185185
generate-profdata

clang/cmake/caches/PGO.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set(LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "")
55
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
66

77
set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
8-
set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "")
8+
set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED IR CACHE BOOL "")
99
set(CLANG_BOOTSTRAP_TARGETS
1010
generate-profdata
1111
stage2

clang/docs/LanguageExtensions.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -950,16 +950,31 @@ argument is always boolean mask vector. The ``__builtin_masked_load`` builtin
950950
takes an optional third vector argument that will be used for the result of the
951951
masked-off lanes. These builtins assume the memory is always aligned.
952952

953+
The ``__builtin_masked_expand_load`` and ``__builtin_masked_compress_store``
954+
builtins have the same interface but store the result in consecutive indices.
955+
Effectively this performs the ``if (mask[i]) val[i] = ptr[j++]`` and ``if
956+
(mask[i]) ptr[j++] = val[i]`` pattern respectively.
957+
953958
Example:
954959

955960
.. code-block:: c++
956961

957962
using v8b = bool [[clang::ext_vector_type(8)]];
958963
using v8i = int [[clang::ext_vector_type(8)]];
959964

960-
v8i load(v8b m, v8i *p) { return __builtin_masked_load(m, p); }
961-
962-
void store(v8b m, v8i v, v8i *p) { __builtin_masked_store(m, v, p); }
965+
v8i load(v8b mask, v8i *ptr) { return __builtin_masked_load(mask, ptr); }
966+
967+
v8i load_expand(v8b mask, v8i *ptr) {
968+
return __builtin_masked_expand_load(mask, ptr);
969+
}
970+
971+
void store(v8b mask, v8i val, v8i *ptr) {
972+
__builtin_masked_store(mask, val, ptr);
973+
}
974+
975+
void store_compress(v8b mask, v8i val, v8i *ptr) {
976+
__builtin_masked_compress_store(mask, val, ptr);
977+
}
963978
964979

965980
Matrix Types

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,10 @@ Non-comprehensive list of changes in this release
169169
- A vector of booleans is now a valid condition for the ternary ``?:`` operator.
170170
This binds to a simple vector select operation.
171171

172-
- Added ``__builtin_masked_load`` and ``__builtin_masked_store`` for conditional
173-
memory loads from vectors. Binds to the LLVM intrinsic of the same name.
172+
- Added ``__builtin_masked_load``, ``__builtin_masked_expand_load``,
173+
``__builtin_masked_store``, ``__builtin_masked_compress_store`` for
174+
conditional memory loads from vectors. Binds to the LLVM intrinsics of the
175+
same name.
174176

175177
- The ``__builtin_popcountg``, ``__builtin_ctzg``, and ``__builtin_clzg``
176178
functions now accept fixed-size boolean vectors.

clang/include/clang/Basic/Builtins.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,18 @@ def MaskedStore : Builtin {
12441244
let Prototype = "void(...)";
12451245
}
12461246

1247+
def MaskedExpandLoad : Builtin {
1248+
let Spellings = ["__builtin_masked_expand_load"];
1249+
let Attributes = [NoThrow, CustomTypeChecking];
1250+
let Prototype = "void(...)";
1251+
}
1252+
1253+
def MaskedCompressStore : Builtin {
1254+
let Spellings = ["__builtin_masked_compress_store"];
1255+
let Attributes = [NoThrow, CustomTypeChecking];
1256+
let Prototype = "void(...)";
1257+
}
1258+
12471259
def AllocaUninitialized : Builtin {
12481260
let Spellings = ["__builtin_alloca_uninitialized"];
12491261
let Attributes = [FunctionWithBuiltinPrefix, NoThrow];

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 58 additions & 98 deletions
Large diffs are not rendered by default.

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 55 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2565,10 +2565,34 @@ static bool interp__builtin_elementwise_int_binop(
25652565
return true;
25662566
}
25672567

2568+
const auto *VT = Call->getArg(0)->getType()->castAs<VectorType>();
2569+
assert(VT->getElementType()->isIntegralOrEnumerationType());
2570+
PrimType ElemT = *S.getContext().classify(VT->getElementType());
2571+
unsigned NumElems = VT->getNumElements();
2572+
bool DestUnsigned = Call->getType()->isUnsignedIntegerOrEnumerationType();
2573+
2574+
// Vector + Scalar case.
2575+
if (!Call->getArg(1)->getType()->isVectorType()) {
2576+
assert(Call->getArg(1)->getType()->isIntegralOrEnumerationType());
2577+
2578+
APSInt RHS = popToAPSInt(
2579+
S.Stk, *S.getContext().classify(Call->getArg(1)->getType()));
2580+
const Pointer &LHS = S.Stk.pop<Pointer>();
2581+
const Pointer &Dst = S.Stk.peek<Pointer>();
2582+
2583+
for (unsigned I = 0; I != NumElems; ++I) {
2584+
INT_TYPE_SWITCH_NO_BOOL(ElemT, {
2585+
Dst.elem<T>(I) = static_cast<T>(
2586+
APSInt(Fn(LHS.elem<T>(I).toAPSInt(), RHS), DestUnsigned));
2587+
});
2588+
}
2589+
Dst.initializeAllElements();
2590+
return true;
2591+
}
2592+
25682593
// Vector case.
25692594
assert(Call->getArg(0)->getType()->isVectorType() &&
25702595
Call->getArg(1)->getType()->isVectorType());
2571-
const auto *VT = Call->getArg(0)->getType()->castAs<VectorType>();
25722596
assert(VT->getElementType() ==
25732597
Call->getArg(1)->getType()->castAs<VectorType>()->getElementType());
25742598
assert(VT->getNumElements() ==
@@ -2578,22 +2602,12 @@ static bool interp__builtin_elementwise_int_binop(
25782602
const Pointer &RHS = S.Stk.pop<Pointer>();
25792603
const Pointer &LHS = S.Stk.pop<Pointer>();
25802604
const Pointer &Dst = S.Stk.peek<Pointer>();
2581-
PrimType ElemT = *S.getContext().classify(VT->getElementType());
2582-
unsigned NumElems = VT->getNumElements();
25832605
for (unsigned I = 0; I != NumElems; ++I) {
2584-
APSInt Elem1;
2585-
APSInt Elem2;
25862606
INT_TYPE_SWITCH_NO_BOOL(ElemT, {
2587-
Elem1 = LHS.elem<T>(I).toAPSInt();
2588-
Elem2 = RHS.elem<T>(I).toAPSInt();
2607+
APSInt Elem1 = LHS.elem<T>(I).toAPSInt();
2608+
APSInt Elem2 = RHS.elem<T>(I).toAPSInt();
2609+
Dst.elem<T>(I) = static_cast<T>(APSInt(Fn(Elem1, Elem2), DestUnsigned));
25892610
});
2590-
2591-
APSInt Result =
2592-
APSInt(Fn(Elem1, Elem2),
2593-
Call->getType()->isUnsignedIntegerOrEnumerationType());
2594-
2595-
INT_TYPE_SWITCH_NO_BOOL(ElemT,
2596-
{ Dst.elem<T>(I) = static_cast<T>(Result); });
25972611
}
25982612
Dst.initializeAllElements();
25992613

@@ -3254,6 +3268,15 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
32543268
case clang::X86::BI__builtin_ia32_psllv4di:
32553269
case clang::X86::BI__builtin_ia32_psllv4si:
32563270
case clang::X86::BI__builtin_ia32_psllv8si:
3271+
case clang::X86::BI__builtin_ia32_psllwi128:
3272+
case clang::X86::BI__builtin_ia32_psllwi256:
3273+
case clang::X86::BI__builtin_ia32_psllwi512:
3274+
case clang::X86::BI__builtin_ia32_pslldi128:
3275+
case clang::X86::BI__builtin_ia32_pslldi256:
3276+
case clang::X86::BI__builtin_ia32_pslldi512:
3277+
case clang::X86::BI__builtin_ia32_psllqi128:
3278+
case clang::X86::BI__builtin_ia32_psllqi256:
3279+
case clang::X86::BI__builtin_ia32_psllqi512:
32573280
return interp__builtin_elementwise_int_binop(
32583281
S, OpPC, Call, BuiltinID, [](const APSInt &LHS, const APSInt &RHS) {
32593282
if (RHS.uge(LHS.getBitWidth())) {
@@ -3264,6 +3287,15 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
32643287

32653288
case clang::X86::BI__builtin_ia32_psrav4si:
32663289
case clang::X86::BI__builtin_ia32_psrav8si:
3290+
case clang::X86::BI__builtin_ia32_psrawi128:
3291+
case clang::X86::BI__builtin_ia32_psrawi256:
3292+
case clang::X86::BI__builtin_ia32_psrawi512:
3293+
case clang::X86::BI__builtin_ia32_psradi128:
3294+
case clang::X86::BI__builtin_ia32_psradi256:
3295+
case clang::X86::BI__builtin_ia32_psradi512:
3296+
case clang::X86::BI__builtin_ia32_psraqi128:
3297+
case clang::X86::BI__builtin_ia32_psraqi256:
3298+
case clang::X86::BI__builtin_ia32_psraqi512:
32673299
return interp__builtin_elementwise_int_binop(
32683300
S, OpPC, Call, BuiltinID, [](const APSInt &LHS, const APSInt &RHS) {
32693301
if (RHS.uge(LHS.getBitWidth())) {
@@ -3276,6 +3308,15 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
32763308
case clang::X86::BI__builtin_ia32_psrlv4di:
32773309
case clang::X86::BI__builtin_ia32_psrlv4si:
32783310
case clang::X86::BI__builtin_ia32_psrlv8si:
3311+
case clang::X86::BI__builtin_ia32_psrlwi128:
3312+
case clang::X86::BI__builtin_ia32_psrlwi256:
3313+
case clang::X86::BI__builtin_ia32_psrlwi512:
3314+
case clang::X86::BI__builtin_ia32_psrldi128:
3315+
case clang::X86::BI__builtin_ia32_psrldi256:
3316+
case clang::X86::BI__builtin_ia32_psrldi512:
3317+
case clang::X86::BI__builtin_ia32_psrlqi128:
3318+
case clang::X86::BI__builtin_ia32_psrlqi256:
3319+
case clang::X86::BI__builtin_ia32_psrlqi512:
32793320
return interp__builtin_elementwise_int_binop(
32803321
S, OpPC, Call, BuiltinID, [](const APSInt &LHS, const APSInt &RHS) {
32813322
if (RHS.uge(LHS.getBitWidth())) {

clang/lib/AST/ExprConstant.cpp

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11632,7 +11632,38 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
1163211632
case clang::X86::BI__builtin_ia32_psrlv2di:
1163311633
case clang::X86::BI__builtin_ia32_psrlv4di:
1163411634
case clang::X86::BI__builtin_ia32_psrlv4si:
11635-
case clang::X86::BI__builtin_ia32_psrlv8si:{
11635+
case clang::X86::BI__builtin_ia32_psrlv8si:
11636+
11637+
case clang::X86::BI__builtin_ia32_psllwi128:
11638+
case clang::X86::BI__builtin_ia32_pslldi128:
11639+
case clang::X86::BI__builtin_ia32_psllqi128:
11640+
case clang::X86::BI__builtin_ia32_psllwi256:
11641+
case clang::X86::BI__builtin_ia32_pslldi256:
11642+
case clang::X86::BI__builtin_ia32_psllqi256:
11643+
case clang::X86::BI__builtin_ia32_psllwi512:
11644+
case clang::X86::BI__builtin_ia32_pslldi512:
11645+
case clang::X86::BI__builtin_ia32_psllqi512:
11646+
11647+
case clang::X86::BI__builtin_ia32_psrlwi128:
11648+
case clang::X86::BI__builtin_ia32_psrldi128:
11649+
case clang::X86::BI__builtin_ia32_psrlqi128:
11650+
case clang::X86::BI__builtin_ia32_psrlwi256:
11651+
case clang::X86::BI__builtin_ia32_psrldi256:
11652+
case clang::X86::BI__builtin_ia32_psrlqi256:
11653+
case clang::X86::BI__builtin_ia32_psrlwi512:
11654+
case clang::X86::BI__builtin_ia32_psrldi512:
11655+
case clang::X86::BI__builtin_ia32_psrlqi512:
11656+
11657+
case clang::X86::BI__builtin_ia32_psrawi128:
11658+
case clang::X86::BI__builtin_ia32_psradi128:
11659+
case clang::X86::BI__builtin_ia32_psraqi128:
11660+
case clang::X86::BI__builtin_ia32_psrawi256:
11661+
case clang::X86::BI__builtin_ia32_psradi256:
11662+
case clang::X86::BI__builtin_ia32_psraqi256:
11663+
case clang::X86::BI__builtin_ia32_psrawi512:
11664+
case clang::X86::BI__builtin_ia32_psradi512:
11665+
case clang::X86::BI__builtin_ia32_psraqi512: {
11666+
1163611667
APValue SourceLHS, SourceRHS;
1163711668
if (!EvaluateAsRValue(Info, E->getArg(0), SourceLHS) ||
1163811669
!EvaluateAsRValue(Info, E->getArg(1), SourceRHS))
@@ -11646,6 +11677,64 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
1164611677

1164711678
for (unsigned EltNum = 0; EltNum < SourceLen; ++EltNum) {
1164811679
APSInt LHS = SourceLHS.getVectorElt(EltNum).getInt();
11680+
11681+
if (SourceRHS.isInt()) {
11682+
const unsigned LaneBitWidth = LHS.getBitWidth();
11683+
const unsigned ShiftAmount = SourceRHS.getInt().getZExtValue();
11684+
11685+
switch (E->getBuiltinCallee()) {
11686+
case clang::X86::BI__builtin_ia32_psllwi128:
11687+
case clang::X86::BI__builtin_ia32_psllwi256:
11688+
case clang::X86::BI__builtin_ia32_psllwi512:
11689+
case clang::X86::BI__builtin_ia32_pslldi128:
11690+
case clang::X86::BI__builtin_ia32_pslldi256:
11691+
case clang::X86::BI__builtin_ia32_pslldi512:
11692+
case clang::X86::BI__builtin_ia32_psllqi128:
11693+
case clang::X86::BI__builtin_ia32_psllqi256:
11694+
case clang::X86::BI__builtin_ia32_psllqi512:
11695+
if (ShiftAmount >= LaneBitWidth) {
11696+
ResultElements.push_back(
11697+
APValue(APSInt(APInt::getZero(LaneBitWidth), DestUnsigned)));
11698+
} else {
11699+
ResultElements.push_back(
11700+
APValue(APSInt(LHS.shl(ShiftAmount), DestUnsigned)));
11701+
}
11702+
break;
11703+
case clang::X86::BI__builtin_ia32_psrlwi128:
11704+
case clang::X86::BI__builtin_ia32_psrlwi256:
11705+
case clang::X86::BI__builtin_ia32_psrlwi512:
11706+
case clang::X86::BI__builtin_ia32_psrldi128:
11707+
case clang::X86::BI__builtin_ia32_psrldi256:
11708+
case clang::X86::BI__builtin_ia32_psrldi512:
11709+
case clang::X86::BI__builtin_ia32_psrlqi128:
11710+
case clang::X86::BI__builtin_ia32_psrlqi256:
11711+
case clang::X86::BI__builtin_ia32_psrlqi512:
11712+
if (ShiftAmount >= LaneBitWidth) {
11713+
ResultElements.push_back(
11714+
APValue(APSInt(APInt::getZero(LaneBitWidth), DestUnsigned)));
11715+
} else {
11716+
ResultElements.push_back(
11717+
APValue(APSInt(LHS.lshr(ShiftAmount), DestUnsigned)));
11718+
}
11719+
break;
11720+
case clang::X86::BI__builtin_ia32_psrawi128:
11721+
case clang::X86::BI__builtin_ia32_psrawi256:
11722+
case clang::X86::BI__builtin_ia32_psrawi512:
11723+
case clang::X86::BI__builtin_ia32_psradi128:
11724+
case clang::X86::BI__builtin_ia32_psradi256:
11725+
case clang::X86::BI__builtin_ia32_psradi512:
11726+
case clang::X86::BI__builtin_ia32_psraqi128:
11727+
case clang::X86::BI__builtin_ia32_psraqi256:
11728+
case clang::X86::BI__builtin_ia32_psraqi512:
11729+
ResultElements.push_back(
11730+
APValue(APSInt(LHS.ashr(std::min(ShiftAmount, LaneBitWidth - 1)),
11731+
DestUnsigned)));
11732+
break;
11733+
default:
11734+
llvm_unreachable("Unexpected builtin callee");
11735+
}
11736+
continue;
11737+
}
1164911738
APSInt RHS = SourceRHS.getVectorElt(EltNum).getInt();
1165011739
switch (E->getBuiltinCallee()) {
1165111740
case Builtin::BI__builtin_elementwise_add_sat:

clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ class ComplexExprEmitter : public StmtVisitor<ComplexExprEmitter, mlir::Value> {
178178
mlir::Value VisitBinMulAssign(const CompoundAssignOperator *e) {
179179
return emitCompoundAssign(e, &ComplexExprEmitter::emitBinMul);
180180
}
181+
182+
mlir::Value VisitBinDivAssign(const CompoundAssignOperator *e) {
183+
return emitCompoundAssign(e, &ComplexExprEmitter::emitBinDiv);
184+
}
181185
};
182186
} // namespace
183187

@@ -865,6 +869,10 @@ mlir::Value ComplexExprEmitter::emitBinDiv(const BinOpInfo &op) {
865869
assert(!cir::MissingFeatures::fastMathFlags());
866870
assert(!cir::MissingFeatures::cgFPOptionsRAII());
867871

872+
// Handle division between two complex values. In the case of complex integer
873+
// types mixed with scalar integers, the scalar integer type will always be
874+
// promoted to a complex integer value with a zero imaginary component when
875+
// the AST is formed.
868876
if (mlir::isa<cir::ComplexType>(op.lhs.getType()) &&
869877
mlir::isa<cir::ComplexType>(op.rhs.getType())) {
870878
cir::ComplexRangeKind rangeKind =
@@ -873,8 +881,24 @@ mlir::Value ComplexExprEmitter::emitBinDiv(const BinOpInfo &op) {
873881
rangeKind);
874882
}
875883

876-
cgf.cgm.errorNYI("ComplexExprEmitter::emitBinDiv between Complex & Scalar");
877-
return {};
884+
// The C99 standard (G.5.1) defines division of a complex value by a real
885+
// value in the following simplified form.
886+
if (mlir::isa<cir::ComplexType>(op.lhs.getType())) {
887+
assert(mlir::cast<cir::ComplexType>(op.lhs.getType()).getElementType() ==
888+
op.rhs.getType());
889+
mlir::Value real = builder.createComplexReal(op.loc, op.lhs);
890+
mlir::Value imag = builder.createComplexImag(op.loc, op.lhs);
891+
mlir::Value newReal = builder.createFDiv(op.loc, real, op.rhs);
892+
mlir::Value newImag = builder.createFDiv(op.loc, imag, op.rhs);
893+
return builder.createComplexCreate(op.loc, newReal, newImag);
894+
}
895+
896+
assert(mlir::isa<cir::ComplexType>(op.rhs.getType()));
897+
cir::ConstantOp nullValue = builder.getNullValue(op.lhs.getType(), op.loc);
898+
mlir::Value lhs = builder.createComplexCreate(op.loc, op.lhs, nullValue);
899+
cir::ComplexRangeKind rangeKind =
900+
getComplexRangeAttr(op.fpFeatures.getComplexRange());
901+
return cir::ComplexDivOp::create(builder, op.loc, lhs, op.rhs, rangeKind);
878902
}
879903

880904
LValue CIRGenFunction::emitComplexAssignmentLValue(const BinaryOperator *e) {
@@ -903,7 +927,7 @@ static CompoundFunc getComplexOp(BinaryOperatorKind op) {
903927
case BO_MulAssign:
904928
return &ComplexExprEmitter::emitBinMul;
905929
case BO_DivAssign:
906-
llvm_unreachable("getComplexOp: BO_DivAssign");
930+
return &ComplexExprEmitter::emitBinDiv;
907931
case BO_SubAssign:
908932
return &ComplexExprEmitter::emitBinSub;
909933
case BO_AddAssign:

clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
9292
mlir::Value value, CastKind kind,
9393
QualType destTy);
9494

95+
mlir::Value emitNullValue(QualType ty, mlir::Location loc) {
96+
return cgf.cgm.emitNullConstant(ty, loc);
97+
}
98+
9599
mlir::Value emitPromotedValue(mlir::Value result, QualType promotionType) {
96100
return builder.createFloatingCast(result, cgf.convertType(promotionType));
97101
}
@@ -182,6 +186,13 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
182186
return builder.getBool(e->getValue(), cgf.getLoc(e->getExprLoc()));
183187
}
184188

189+
mlir::Value VisitCXXScalarValueInitExpr(const CXXScalarValueInitExpr *e) {
190+
if (e->getType()->isVoidType())
191+
return {};
192+
193+
return emitNullValue(e->getType(), cgf.getLoc(e->getSourceRange()));
194+
}
195+
185196
mlir::Value VisitCastExpr(CastExpr *e);
186197
mlir::Value VisitCallExpr(const CallExpr *e);
187198

@@ -1966,11 +1977,9 @@ mlir::Value ScalarExprEmitter::VisitInitListExpr(InitListExpr *e) {
19661977
cgf.getLoc(e->getSourceRange()), vectorType, elements);
19671978
}
19681979

1969-
if (numInitElements == 0) {
1970-
cgf.cgm.errorNYI(e->getSourceRange(),
1971-
"InitListExpr Non VectorType with 0 init elements");
1972-
return {};
1973-
}
1980+
// C++11 value-initialization for the scalar.
1981+
if (numInitElements == 0)
1982+
return emitNullValue(e->getType(), cgf.getLoc(e->getExprLoc()));
19741983

19751984
return Visit(e->getInit(0));
19761985
}

0 commit comments

Comments
 (0)