Skip to content

Commit c5d1d3d

Browse files
committed
Merge branch 'main' into sg_distr_minor_fixes
2 parents 8856e45 + 8917f84 commit c5d1d3d

File tree

186 files changed

+1757
-4068
lines changed

Some content is hidden

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

186 files changed

+1757
-4068
lines changed

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ Improvements to clang-doc
8888
Improvements to clang-query
8989
---------------------------
9090

91+
- Matcher queries interpreted by clang-query are now support trailing comma (,)
92+
in matcher arguments. Note that C++ still doesn't allow this in function
93+
arguments. So when porting a query to C++, remove all instances of trailing
94+
comma (otherwise C++ compiler will just complain about "expected expression").
95+
9196
Improvements to include-cleaner
9297
-------------------------------
9398
- Deprecated the ``-insert`` and ``-remove`` command line options, and added
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
void foo(void) {}
2+
// CHECK-OK: trailing-comma.c:1:1: note: "root" binds here
3+
// CHECK-ERR-COMMA: Invalid token <,> found when looking for a value.
4+
5+
// RUN: clang-query -c "match \
6+
// RUN: functionDecl( \
7+
// RUN: hasName( \
8+
// RUN: \"foo\", \
9+
// RUN: ), \
10+
// RUN: ) \
11+
// RUN: " %s | FileCheck --check-prefix=CHECK-OK %s
12+
13+
// Same with \n tokens
14+
// RUN: echo "match functionDecl( hasName( \"foo\" , ) , )" | sed "s/ /\n/g" >%t
15+
// RUN: clang-query -f %t %s | FileCheck --check-prefix=CHECK-OK %s
16+
17+
// RUN: not clang-query -c "match functionDecl(hasName(\"foo\"),,)" %s \
18+
// RUN: | FileCheck --check-prefix=CHECK-ERR-COMMA %s
19+
20+
// RUN: not clang-query -c "match functionDecl(,)" %s \
21+
// RUN: | FileCheck --check-prefix=CHECK-ERR-COMMA %s

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,8 @@ Bug Fixes in This Version
800800
declaration statements. Clang now emits a warning for these patterns. (#GH141659)
801801
- Fixed false positives for redeclaration errors of using enum in
802802
nested scopes. (#GH147495)
803+
- Fixed a failed assertion with an operator call expression which comes from a
804+
macro expansion when performing analysis for nullability attributes. (#GH138371)
803805

804806
Bug Fixes to Compiler Builtins
805807
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -967,6 +969,7 @@ Bug Fixes to C++ Support
967969
- Fix a crash with NTTP when instantiating local class.
968970
- Fixed a crash involving list-initialization of an empty class with a
969971
non-empty initializer list. (#GH147949)
972+
- Fixed constant evaluation of equality comparisons of constexpr-unknown references. (#GH147663)
970973

971974
Bug Fixes to AST Handling
972975
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/BuiltinsPPC.def

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,12 @@ UNALIASED_CUSTOM_BUILTIN(mma_dmxvi8gerx4spp, "vW1024*W256V", true,
10921092
"mma,paired-vector-memops")
10931093
UNALIASED_CUSTOM_BUILTIN(mma_pmdmxvi8gerx4spp, "vW1024*W256Vi255i15i15", true,
10941094
"mma,paired-vector-memops")
1095+
UNALIASED_CUSTOM_BUILTIN(mma_dmsetdmrz, "vW1024*", false,
1096+
"mma,isa-future-instructions")
1097+
UNALIASED_CUSTOM_BUILTIN(mma_dmmr, "vW1024*W1024*", false,
1098+
"mma,isa-future-instructions")
1099+
UNALIASED_CUSTOM_BUILTIN(mma_dmxor, "vW1024*W1024*", true,
1100+
"mma,isa-future-instructions")
10951101

10961102
// MMA builtins with positive/negative multiply/accumulate.
10971103
UNALIASED_CUSTOM_MMA_BUILTIN(mma_xvf16ger2, "vW512*VV",

clang/include/clang/Basic/TargetInfo.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,6 @@ class TargetInfo : public TransferrableTargetInfo,
337337
/// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055a/IHI0055A_aapcs64.pdf
338338
AArch64ABIBuiltinVaList,
339339

340-
/// __builtin_va_list as defined by the PNaCl ABI:
341-
/// http://www.chromium.org/nativeclient/pnacl/bitcode-abi#TOC-Machine-Types
342-
PNaClABIBuiltinVaList,
343-
344340
/// __builtin_va_list as defined by the Power ABI:
345341
/// https://www.power.org
346342
/// /resources/downloads/Power-Arch-32-bit-ABI-supp-1.0-Embedded.pdf

clang/lib/AST/ASTContext.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9998,14 +9998,6 @@ CreateX86_64ABIBuiltinVaListDecl(const ASTContext *Context) {
99989998
return Context->buildImplicitTypedef(VaListTagArrayType, "__builtin_va_list");
99999999
}
1000010000

10001-
static TypedefDecl *CreatePNaClABIBuiltinVaListDecl(const ASTContext *Context) {
10002-
// typedef int __builtin_va_list[4];
10003-
llvm::APInt Size(Context->getTypeSize(Context->getSizeType()), 4);
10004-
QualType IntArrayType = Context->getConstantArrayType(
10005-
Context->IntTy, Size, nullptr, ArraySizeModifier::Normal, 0);
10006-
return Context->buildImplicitTypedef(IntArrayType, "__builtin_va_list");
10007-
}
10008-
1000910001
static TypedefDecl *
1001010002
CreateAAPCSABIBuiltinVaListDecl(const ASTContext *Context) {
1001110003
// struct __va_list
@@ -10203,8 +10195,6 @@ static TypedefDecl *CreateVaListDecl(const ASTContext *Context,
1020310195
return CreatePowerABIBuiltinVaListDecl(Context);
1020410196
case TargetInfo::X86_64ABIBuiltinVaList:
1020510197
return CreateX86_64ABIBuiltinVaListDecl(Context);
10206-
case TargetInfo::PNaClABIBuiltinVaList:
10207-
return CreatePNaClABIBuiltinVaListDecl(Context);
1020810198
case TargetInfo::AAPCSABIBuiltinVaList:
1020910199
return CreateAAPCSABIBuiltinVaListDecl(Context);
1021010200
case TargetInfo::SystemZBuiltinVaList:

clang/lib/AST/ExprConstant.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14478,12 +14478,6 @@ EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E,
1447814478
if (!EvaluatePointer(E->getRHS(), RHSValue, Info) || !LHSOK)
1447914479
return false;
1448014480

14481-
// If we have Unknown pointers we should fail if they are not global values.
14482-
if (!(IsGlobalLValue(LHSValue.getLValueBase()) &&
14483-
IsGlobalLValue(RHSValue.getLValueBase())) &&
14484-
(LHSValue.AllowConstexprUnknown || RHSValue.AllowConstexprUnknown))
14485-
return false;
14486-
1448714481
// Reject differing bases from the normal codepath; we special-case
1448814482
// comparisons to null.
1448914483
if (!HasSameBase(LHSValue, RHSValue)) {
@@ -14545,6 +14539,10 @@ EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E,
1454514539
(LHSValue.Base && isZeroSized(RHSValue)))
1454614540
return DiagComparison(
1454714541
diag::note_constexpr_pointer_comparison_zero_sized);
14542+
if (LHSValue.AllowConstexprUnknown || RHSValue.AllowConstexprUnknown)
14543+
return DiagComparison(
14544+
diag::note_constexpr_pointer_comparison_unspecified);
14545+
// FIXME: Verify both variables are live.
1454814546
return Success(CmpResult::Unequal, E);
1454914547
}
1455014548

clang/lib/ASTMatchers/Dynamic/Parser.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,11 @@ bool Parser::parseMatcherBuilder(MatcherCtor Ctor, const TokenInfo &NameToken,
490490
<< CommaToken.Text;
491491
return false;
492492
}
493+
// Allow for a trailing , token and possibly a new line.
494+
Tokenizer->SkipNewlines();
495+
if (Tokenizer->nextTokenKind() == TokenInfo::TK_CloseParen) {
496+
continue;
497+
}
493498
}
494499

495500
Diagnostics::Context Ctx(Diagnostics::Context::MatcherArg, Error,
@@ -658,6 +663,11 @@ bool Parser::parseMatcherExpressionImpl(const TokenInfo &NameToken,
658663
<< CommaToken.Text;
659664
return false;
660665
}
666+
// Allow for a trailing , token and possibly a new line.
667+
Tokenizer->SkipNewlines();
668+
if (Tokenizer->nextTokenKind() == TokenInfo::TK_CloseParen) {
669+
continue;
670+
}
661671
}
662672

663673
Diagnostics::Context Ctx(Diagnostics::Context::MatcherArg, Error,

clang/lib/Basic/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ add_clang_library(clangBasic
111111
Targets/Mips.cpp
112112
Targets/NVPTX.cpp
113113
Targets/OSTargets.cpp
114-
Targets/PNaCl.cpp
115114
Targets/PPC.cpp
116115
Targets/RISCV.cpp
117116
Targets/SPIR.cpp

clang/lib/Basic/Targets.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "Targets/Mips.h"
3030
#include "Targets/NVPTX.h"
3131
#include "Targets/OSTargets.h"
32-
#include "Targets/PNaCl.h"
3332
#include "Targets/PPC.h"
3433
#include "Targets/RISCV.h"
3534
#include "Targets/SPIR.h"
@@ -228,8 +227,6 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
228227
return std::make_unique<RTEMSTargetInfo<ARMleTargetInfo>>(Triple, Opts);
229228
case llvm::Triple::Haiku:
230229
return std::make_unique<HaikuTargetInfo<ARMleTargetInfo>>(Triple, Opts);
231-
case llvm::Triple::NaCl:
232-
return std::make_unique<NaClTargetInfo<ARMleTargetInfo>>(Triple, Opts);
233230
case llvm::Triple::Win32:
234231
switch (Triple.getEnvironment()) {
235232
case llvm::Triple::Cygnus:
@@ -260,8 +257,6 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
260257
return std::make_unique<NetBSDTargetInfo<ARMbeTargetInfo>>(Triple, Opts);
261258
case llvm::Triple::RTEMS:
262259
return std::make_unique<RTEMSTargetInfo<ARMbeTargetInfo>>(Triple, Opts);
263-
case llvm::Triple::NaCl:
264-
return std::make_unique<NaClTargetInfo<ARMbeTargetInfo>>(Triple, Opts);
265260
default:
266261
return std::make_unique<ARMbeTargetInfo>(Triple, Opts);
267262
}
@@ -304,9 +299,6 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
304299
return std::make_unique<FreeBSDTargetInfo<MipsTargetInfo>>(Triple, Opts);
305300
case llvm::Triple::NetBSD:
306301
return std::make_unique<NetBSDTargetInfo<MipsTargetInfo>>(Triple, Opts);
307-
case llvm::Triple::NaCl:
308-
return std::make_unique<NaClTargetInfo<NaClMips32TargetInfo>>(Triple,
309-
Opts);
310302
case llvm::Triple::Win32:
311303
switch (Triple.getEnvironment()) {
312304
case llvm::Triple::GNU:
@@ -591,8 +583,6 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
591583
return std::make_unique<HaikuX86_32TargetInfo>(Triple, Opts);
592584
case llvm::Triple::RTEMS:
593585
return std::make_unique<RTEMSX86_32TargetInfo>(Triple, Opts);
594-
case llvm::Triple::NaCl:
595-
return std::make_unique<NaClTargetInfo<X86_32TargetInfo>>(Triple, Opts);
596586
case llvm::Triple::ELFIAMCU:
597587
return std::make_unique<MCUX86_32TargetInfo>(Triple, Opts);
598588
case llvm::Triple::Hurd:
@@ -652,8 +642,6 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
652642
}
653643
case llvm::Triple::Haiku:
654644
return std::make_unique<HaikuTargetInfo<X86_64TargetInfo>>(Triple, Opts);
655-
case llvm::Triple::NaCl:
656-
return std::make_unique<NaClTargetInfo<X86_64TargetInfo>>(Triple, Opts);
657645
case llvm::Triple::PS4:
658646
return std::make_unique<PS4OSTargetInfo<X86_64TargetInfo>>(Triple, Opts);
659647
case llvm::Triple::PS5:

0 commit comments

Comments
 (0)