Skip to content

Commit 24ca959

Browse files
committed
merge main into amd-staging
Change-Id: Icc3b2b48138fba3291d0818c552353a6dd10590a
2 parents 871479d + ca260e1 commit 24ca959

File tree

171 files changed

+1734
-1031
lines changed

Some content is hidden

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

171 files changed

+1734
-1031
lines changed

clang-tools-extra/clang-tidy/bugprone/NonZeroEnumToBoolConversionCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void NonZeroEnumToBoolConversionCheck::registerMatchers(MatchFinder *Finder) {
6464
EnumIgnoreList)))
6565
.bind("enum"))))),
6666
unless(declRefExpr(to(enumConstantDecl()))),
67-
unless(ignoringImplicit(ExcludedOperators)))),
67+
unless(ignoringParenImpCasts(ExcludedOperators)))),
6868
unless(hasAncestor(staticAssertDecl())))
6969
.bind("cast"),
7070
this);

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ New check aliases
112112
Changes in existing checks
113113
^^^^^^^^^^^^^^^^^^^^^^^^^^
114114

115+
- Improved :doc:`bugprone-non-zero-enum-to-bool-conversion
116+
<clang-tidy/checks/bugprone/non-zero-enum-to-bool-conversion>` check by
117+
eliminating false positives resulting from direct usage of bitwise operators
118+
within parentheses.
119+
115120
- Improved :doc:`bugprone-suspicious-include
116121
<clang-tidy/checks/bugprone/suspicious-include>` check by replacing the local
117122
options `HeaderFileExtensions` and `ImplementationFileExtensions` by the

clang-tools-extra/test/clang-tidy/checkers/bugprone/non-zero-enum-to-bool-conversion.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ CustomOperatorEnum operator&(CustomOperatorEnum a, CustomOperatorEnum b) { retur
122122

123123
void testCustomOperator(CustomOperatorEnum e) {
124124
if (e & E1) {}
125+
if ((e & E1)) {}
126+
if (!(e & E1)) {}
125127
}
126128

127129
}

clang/lib/Format/QualifierAlignmentFixer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,8 @@ void LeftRightQualifierAlignmentFixer::fixQualifierAlignment(
561561

562562
for (const auto *Tok = First; Tok && Tok != Last && Tok->Next;
563563
Tok = Tok->Next) {
564+
if (Tok->MustBreakBefore)
565+
break;
564566
if (Tok->is(tok::comment))
565567
continue;
566568
if (RightAlign) {

clang/unittests/Format/QualifierFixerTest.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,19 @@ TEST_F(QualifierFixerTest, DontPushQualifierThroughNonSpecifiedTypes) {
11771177
verifyFormat("const inline static Foo;", Style);
11781178
}
11791179

1180+
TEST_F(QualifierFixerTest, QualifiersBrokenUpByPPDirectives) {
1181+
auto Style = getLLVMStyle();
1182+
Style.QualifierAlignment = FormatStyle::QAS_Custom;
1183+
Style.QualifierOrder = {"constexpr", "inline", "type"};
1184+
1185+
verifyFormat("inline\n"
1186+
"#if FOO\n"
1187+
" constexpr\n"
1188+
"#endif\n"
1189+
" int i = 0;",
1190+
Style);
1191+
}
1192+
11801193
TEST_F(QualifierFixerTest, UnsignedQualifier) {
11811194

11821195
FormatStyle Style = getLLVMStyle();

compiler-rt/lib/asan/asan_fuchsia.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ void AsanCheckDynamicRTPrereqs() {}
5757
void AsanCheckIncompatibleRT() {}
5858
void InitializeAsanInterceptors() {}
5959

60-
void *AsanDoesNotSupportStaticLinkage() { return nullptr; }
61-
6260
void InitializePlatformExceptionHandlers() {}
6361
void AsanOnDeadlySignal(int signo, void *siginfo, void *context) {
6462
UNIMPLEMENTED();

compiler-rt/lib/asan/asan_internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ void ReplaceSystemMalloc();
8080

8181
// asan_linux.cpp / asan_mac.cpp / asan_win.cpp
8282
uptr FindDynamicShadowStart();
83-
void *AsanDoesNotSupportStaticLinkage();
8483
void AsanCheckDynamicRTPrereqs();
8584
void AsanCheckIncompatibleRT();
8685

compiler-rt/lib/asan/asan_linux.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,12 @@
4747

4848
# if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS
4949
# include <ucontext.h>
50-
extern "C" void *_DYNAMIC;
5150
# elif SANITIZER_NETBSD
5251
# include <link_elf.h>
5352
# include <ucontext.h>
54-
extern Elf_Dyn _DYNAMIC;
5553
# else
5654
# include <link.h>
5755
# include <sys/ucontext.h>
58-
extern ElfW(Dyn) _DYNAMIC[];
5956
# endif
6057

6158
typedef enum {
@@ -76,11 +73,6 @@ void InitializePlatformInterceptors() {}
7673
void InitializePlatformExceptionHandlers() {}
7774
bool IsSystemHeapAddress(uptr addr) { return false; }
7875

79-
void *AsanDoesNotSupportStaticLinkage() {
80-
// This will fail to link with -static.
81-
return &_DYNAMIC;
82-
}
83-
8476
# if ASAN_PREMAP_SHADOW
8577
uptr FindPremappedShadowStart(uptr shadow_size_bytes) {
8678
uptr granularity = GetMmapGranularity();

compiler-rt/lib/asan/asan_mac.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ void InitializePlatformInterceptors() {}
4949
void InitializePlatformExceptionHandlers() {}
5050
bool IsSystemHeapAddress (uptr addr) { return false; }
5151

52-
// No-op. Mac does not support static linkage anyway.
53-
void *AsanDoesNotSupportStaticLinkage() {
54-
return 0;
55-
}
56-
5752
uptr FindDynamicShadowStart() {
5853
return MapDynamicShadow(MemToShadowSize(kHighMemEnd), ASAN_SHADOW_SCALE,
5954
/*min_shadow_base_alignment*/ 0, kHighMemEnd);

compiler-rt/lib/asan/asan_rtl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ static bool AsanInitInternal() {
449449
return false;
450450
}
451451

452+
// Make sure we are not statically linked.
453+
__interception::DoesNotSupportStaticLinking();
452454
AsanCheckIncompatibleRT();
453455
AsanCheckDynamicRTPrereqs();
454456
AvoidCVE_2016_2143();
@@ -460,9 +462,6 @@ static bool AsanInitInternal() {
460462

461463
InitializeHighMemEnd();
462464

463-
// Make sure we are not statically linked.
464-
AsanDoesNotSupportStaticLinkage();
465-
466465
// Install tool-specific callbacks in sanitizer_common.
467466
AddDieCallback(AsanDie);
468467
SetCheckUnwindCallback(CheckUnwind);

0 commit comments

Comments
 (0)