Skip to content

Commit 0403a8e

Browse files
authored
Merge branch 'llvm:main' into pshuf-intrinsics-llvm
2 parents 1ddbdbb + 48a6f2f commit 0403a8e

File tree

172 files changed

+9511
-2591
lines changed

Some content is hidden

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

172 files changed

+9511
-2591
lines changed

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM docker.io/library/ubuntu:24.04 as base
1+
FROM docker.io/library/ubuntu:24.04 AS base
22
ENV LLVM_SYSROOT=/opt/llvm
33

4-
FROM base as stage1-toolchain
4+
FROM base AS stage1-toolchain
55
ENV LLVM_VERSION=21.1.1
66

77
RUN apt-get update && \
@@ -37,7 +37,7 @@ RUN cmake -B ./build -G Ninja ./llvm \
3737

3838
RUN ninja -C ./build stage2-clang-bolt stage2-install-distribution && ninja -C ./build install-distribution
3939

40-
FROM base as ci-container
40+
FROM base AS ci-container
4141

4242
COPY --from=stage1-toolchain $LLVM_SYSROOT $LLVM_SYSROOT
4343

@@ -62,6 +62,7 @@ RUN apt-get update && \
6262
# Having a symlink from python to python3 enables code sharing between
6363
# the Linux and Windows pipelines.
6464
python3-pip \
65+
python3-venv \
6566
file \
6667
tzdata \
6768
python-is-python3 && \
@@ -97,7 +98,7 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
9798
USER gha
9899
WORKDIR /home/gha
99100

100-
FROM ci-container as ci-container-agent
101+
FROM ci-container AS ci-container-agent
101102

102103
ENV GITHUB_RUNNER_VERSION=2.328.0
103104

clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ StatementMatcher makeCastSequenceMatcher(llvm::ArrayRef<StringRef> NameList) {
5353
unless(hasImplicitDestinationType(
5454
qualType(matchers::matchesAnyListedTypeName(NameList)))));
5555

56-
auto IsOrHasDescendant = [](auto InnerMatcher) {
56+
auto IsOrHasDescendant = [](const auto &InnerMatcher) {
5757
return anyOf(InnerMatcher, hasDescendant(InnerMatcher));
5858
};
5959

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ Changes in existing checks
329329
<clang-tidy/checks/modernize/use-designated-initializers>` check to
330330
suggest using designated initializers for aliased aggregate types.
331331

332+
- Improved :doc:`modernize-use-nullptr
333+
<clang-tidy/checks/modernize/use-nullptr>` check by fixing a crash
334+
on Windows when the check was enabled with a 32-bit :program:`clang-tidy`
335+
binary.
336+
332337
- Improved :doc:`modernize-use-std-format
333338
<clang-tidy/checks/modernize/use-std-format>` check to correctly match
334339
when the format string is converted to a different type by an implicit

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ Improvements to Clang's diagnostics
299299
"format specifies type 'unsigned int' but the argument has type 'int', which differs in signedness [-Wformat-signedness]"
300300
"signedness of format specifier 'u' is incompatible with 'c' [-Wformat-signedness]"
301301
and the API-visible diagnostic id will be appropriate.
302-
302+
- Clang now produces better diagnostics for template template parameter matching
303+
involving 'auto' template parameters.
303304
- Fixed false positives in ``-Waddress-of-packed-member`` diagnostics when
304305
potential misaligned members get processed before they can get discarded.
305306
(#GH144729)
@@ -360,6 +361,7 @@ Bug Fixes in This Version
360361
first parameter. (#GH113323).
361362
- Fixed a crash with incompatible pointer to integer conversions in designated
362363
initializers involving string literals. (#GH154046)
364+
- Fix crash on CTAD for alias template. (#GH131342)
363365
- Clang now emits a frontend error when a function marked with the `flatten` attribute
364366
calls another function that requires target features not enabled in the caller. This
365367
prevents a fatal error in the backend.

clang/include/clang/AST/ExprCXX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4714,7 +4714,7 @@ class SubstNonTypeTemplateParmExpr : public Expr {
47144714
// sugared: it doesn't need to be resugared later.
47154715
bool getFinal() const { return Final; }
47164716

4717-
NamedDecl *getParameter() const;
4717+
NonTypeTemplateParmDecl *getParameter() const;
47184718

47194719
bool isReferenceParameter() const { return AssociatedDeclAndRef.getInt(); }
47204720

clang/include/clang/AST/TypeBase.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3495,7 +3495,9 @@ class AdjustedType : public Type, public llvm::FoldingSetNode {
34953495

34963496
AdjustedType(TypeClass TC, QualType OriginalTy, QualType AdjustedTy,
34973497
QualType CanonicalPtr)
3498-
: Type(TC, CanonicalPtr, OriginalTy->getDependence()),
3498+
: Type(TC, CanonicalPtr,
3499+
AdjustedTy->getDependence() |
3500+
(OriginalTy->getDependence() & ~TypeDependence::Dependent)),
34993501
OriginalTy(OriginalTy), AdjustedTy(AdjustedTy) {}
35003502

35013503
public:

clang/include/clang/Basic/TargetInfo.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,10 @@ class TargetInfo : public TransferrableTargetInfo,
12591259
ArrayRef<ConstraintInfo> OutputConstraints,
12601260
unsigned &Index) const;
12611261

1262+
std::string
1263+
simplifyConstraint(StringRef Constraint,
1264+
SmallVectorImpl<ConstraintInfo> *OutCons = nullptr) const;
1265+
12621266
// Constraint parm will be left pointing at the last character of
12631267
// the constraint. In practice, it won't be changed unless the
12641268
// constraint is longer than one character.

clang/include/clang/Sema/Sema.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11714,6 +11714,23 @@ class Sema final : public SemaBase {
1171411714
const TemplateArgumentListInfo *TemplateArgs,
1171511715
bool IsAddressOfOperand);
1171611716

11717+
UnsignedOrNone getPackIndex(TemplateArgument Pack) const {
11718+
return Pack.pack_size() - 1 - *ArgPackSubstIndex;
11719+
}
11720+
11721+
TemplateArgument
11722+
getPackSubstitutedTemplateArgument(TemplateArgument Arg) const {
11723+
Arg = Arg.pack_elements()[*ArgPackSubstIndex];
11724+
if (Arg.isPackExpansion())
11725+
Arg = Arg.getPackExpansionPattern();
11726+
return Arg;
11727+
}
11728+
11729+
ExprResult BuildSubstNonTypeTemplateParmExpr(
11730+
Decl *AssociatedDecl, const NonTypeTemplateParmDecl *NTTP,
11731+
SourceLocation loc, TemplateArgument Replacement,
11732+
UnsignedOrNone PackIndex, bool Final);
11733+
1171711734
/// Form a template name from a name that is syntactically required to name a
1171811735
/// template, either due to use of the 'template' keyword or because a name in
1171911736
/// this syntactic context is assumed to name a template (C++

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2934,8 +2934,9 @@ bool Compiler<Emitter>::VisitMaterializeTemporaryExpr(
29342934
// For everyhing else, use local variables.
29352935
if (SubExprT) {
29362936
bool IsConst = SubExpr->getType().isConstQualified();
2937-
unsigned LocalIndex =
2938-
allocateLocalPrimitive(E, *SubExprT, IsConst, E->getExtendingDecl());
2937+
bool IsVolatile = SubExpr->getType().isVolatileQualified();
2938+
unsigned LocalIndex = allocateLocalPrimitive(
2939+
E, *SubExprT, IsConst, IsVolatile, E->getExtendingDecl());
29392940
if (!this->visit(SubExpr))
29402941
return false;
29412942
if (!this->emitSetLocal(*SubExprT, LocalIndex, E))
@@ -4452,6 +4453,9 @@ bool Compiler<Emitter>::visitAssignment(const Expr *LHS, const Expr *RHS,
44524453
if (!this->visit(LHS))
44534454
return false;
44544455

4456+
if (LHS->getType().isVolatileQualified())
4457+
return this->emitInvalidStore(LHS->getType().getTypePtr(), E);
4458+
44554459
// We don't support assignments in C.
44564460
if (!Ctx.getLangOpts().CPlusPlus && !this->emitInvalid(E))
44574461
return false;
@@ -4560,13 +4564,14 @@ bool Compiler<Emitter>::emitConst(const APSInt &Value, const Expr *E) {
45604564

45614565
template <class Emitter>
45624566
unsigned Compiler<Emitter>::allocateLocalPrimitive(
4563-
DeclTy &&Src, PrimType Ty, bool IsConst, const ValueDecl *ExtendingDecl,
4564-
ScopeKind SC, bool IsConstexprUnknown) {
4567+
DeclTy &&Src, PrimType Ty, bool IsConst, bool IsVolatile,
4568+
const ValueDecl *ExtendingDecl, ScopeKind SC, bool IsConstexprUnknown) {
45654569
// FIXME: There are cases where Src.is<Expr*>() is wrong, e.g.
45664570
// (int){12} in C. Consider using Expr::isTemporaryObject() instead
45674571
// or isa<MaterializeTemporaryExpr>().
45684572
Descriptor *D = P.createDescriptor(Src, Ty, nullptr, Descriptor::InlineDescMD,
4569-
IsConst, isa<const Expr *>(Src));
4573+
IsConst, isa<const Expr *>(Src),
4574+
/*IsMutable=*/false, IsVolatile);
45704575
D->IsConstexprUnknown = IsConstexprUnknown;
45714576
Scope::Local Local = this->createLocal(D);
45724577
if (auto *VD = dyn_cast_if_present<ValueDecl>(Src.dyn_cast<const Decl *>()))
@@ -4874,7 +4879,8 @@ Compiler<Emitter>::visitVarDecl(const VarDecl *VD, const Expr *Init,
48744879

48754880
if (VarT) {
48764881
unsigned Offset = this->allocateLocalPrimitive(
4877-
VD, *VarT, VD->getType().isConstQualified(), nullptr, ScopeKind::Block,
4882+
VD, *VarT, VD->getType().isConstQualified(),
4883+
VD->getType().isVolatileQualified(), nullptr, ScopeKind::Block,
48784884
IsConstexprUnknown);
48794885
if (Init) {
48804886
// If this is a toplevel declaration, create a scope for the

clang/lib/AST/ByteCode/Compiler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ class Compiler : public ConstStmtVisitor<Compiler<Emitter>, bool>,
327327

328328
/// Creates a local primitive value.
329329
unsigned allocateLocalPrimitive(DeclTy &&Decl, PrimType Ty, bool IsConst,
330+
bool IsVolatile = false,
330331
const ValueDecl *ExtendingDecl = nullptr,
331332
ScopeKind SC = ScopeKind::Block,
332333
bool IsConstexprUnknown = false);

0 commit comments

Comments
 (0)