Skip to content

Commit a7dcd1e

Browse files
author
Jenkins
committed
merge main into amd-staging
Change-Id: If68cd152b450fe33de82f8307b3f9f4b17d352aa
2 parents 74b6fb9 + 8b02d80 commit a7dcd1e

Some content is hidden

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

58 files changed

+202
-219
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,6 @@ b6262880b34629e9d7a72b5a42f315a3c9ed8139
9494
39c7dc7207e76e72da21cf4fedda21b5311bf62d
9595
e80bc777749331e9519575f416c342f7626dd14d
9696
7e5cd8f1b6c5263ed5e2cc03d60c8779a8d3e9f7
97+
98+
# NFC: clang-format test_demangle.pass.cpp but keep test "lines"
99+
d33bf2e9df578ff7e44fd22504d6ad5a122b7ee6

clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "../ClangTidyCheck.h"
1313
#include "clang/ASTMatchers/ASTMatchFinder.h"
1414
#include "clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h"
15-
#include <optional>
1615

1716
namespace clang::tidy::bugprone {
1817

@@ -26,8 +25,7 @@ class UncheckedOptionalAccessCheck : public ClangTidyCheck {
2625
public:
2726
UncheckedOptionalAccessCheck(StringRef Name, ClangTidyContext *Context)
2827
: ClangTidyCheck(Name, Context),
29-
ModelOptions{
30-
Options.getLocalOrGlobal("IgnoreSmartPointerDereference", false)} {}
28+
ModelOptions{Options.get("IgnoreSmartPointerDereference", false)} {}
3129
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3230
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
3331
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {

clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ ProTypeMemberInitCheck::ProTypeMemberInitCheck(StringRef Name,
277277
ClangTidyContext *Context)
278278
: ClangTidyCheck(Name, Context),
279279
IgnoreArrays(Options.get("IgnoreArrays", false)),
280-
UseAssignment(Options.getLocalOrGlobal("UseAssignment", false)) {}
280+
UseAssignment(Options.get("UseAssignment", false)) {}
281281

282282
void ProTypeMemberInitCheck::registerMatchers(MatchFinder *Finder) {
283283
auto IsUserProvidedNonDelegatingConstructor =

clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,10 @@ void RvalueReferenceParamNotMovedCheck::check(
119119
RvalueReferenceParamNotMovedCheck::RvalueReferenceParamNotMovedCheck(
120120
StringRef Name, ClangTidyContext *Context)
121121
: ClangTidyCheck(Name, Context),
122-
AllowPartialMove(Options.getLocalOrGlobal("AllowPartialMove", false)),
123-
IgnoreUnnamedParams(
124-
Options.getLocalOrGlobal("IgnoreUnnamedParams", false)),
122+
AllowPartialMove(Options.get("AllowPartialMove", false)),
123+
IgnoreUnnamedParams(Options.get("IgnoreUnnamedParams", false)),
125124
IgnoreNonDeducedTemplateTypes(
126-
Options.getLocalOrGlobal("IgnoreNonDeducedTemplateTypes", false)) {}
125+
Options.get("IgnoreNonDeducedTemplateTypes", false)) {}
127126

128127
void RvalueReferenceParamNotMovedCheck::storeOptions(
129128
ClangTidyOptions::OptionMap &Opts) {

clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ InefficientVectorOperationCheck::InefficientVectorOperationCheck(
7777
: ClangTidyCheck(Name, Context),
7878
VectorLikeClasses(utils::options::parseStringList(
7979
Options.get("VectorLikeClasses", "::std::vector"))),
80-
EnableProto(Options.getLocalOrGlobal("EnableProto", false)) {}
80+
EnableProto(Options.get("EnableProto", false)) {}
8181

8282
void InefficientVectorOperationCheck::storeOptions(
8383
ClangTidyOptions::OptionMap &Opts) {

clang-tools-extra/clang-tidy/readability/RedundantAccessSpecifiersCheck.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ class RedundantAccessSpecifiersCheck : public ClangTidyCheck {
2121
public:
2222
RedundantAccessSpecifiersCheck(StringRef Name, ClangTidyContext *Context)
2323
: ClangTidyCheck(Name, Context),
24-
CheckFirstDeclaration(
25-
Options.getLocalOrGlobal("CheckFirstDeclaration", false)) {}
24+
CheckFirstDeclaration(Options.get("CheckFirstDeclaration", false)) {}
2625
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
2726
return LangOpts.CPlusPlus;
2827
}

clang-tools-extra/clang-tidy/readability/RedundantCastingCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ RedundantCastingCheck::RedundantCastingCheck(StringRef Name,
9494
ClangTidyContext *Context)
9595
: ClangTidyCheck(Name, Context),
9696
IgnoreMacros(Options.getLocalOrGlobal("IgnoreMacros", true)),
97-
IgnoreTypeAliases(Options.getLocalOrGlobal("IgnoreTypeAliases", false)) {}
97+
IgnoreTypeAliases(Options.get("IgnoreTypeAliases", false)) {}
9898

9999
void RedundantCastingCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
100100
Options.store(Opts, "IgnoreMacros", IgnoreMacros);

clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ RenamerClangTidyCheck::RenamerClangTidyCheck(StringRef CheckName,
397397
ClangTidyContext *Context)
398398
: ClangTidyCheck(CheckName, Context),
399399
AggressiveDependentMemberLookup(
400-
Options.getLocalOrGlobal("AggressiveDependentMemberLookup", false)) {}
400+
Options.get("AggressiveDependentMemberLookup", false)) {}
401401
RenamerClangTidyCheck::~RenamerClangTidyCheck() = default;
402402

403403
void RenamerClangTidyCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {

clang/test/SemaCXX/msvc-pragma-function-no-builtin-attr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ int bar() {
1818

1919
struct A {
2020
int foo() = delete;
21-
// CHECK: CXXMethodDecl {{.*}} foo 'int ()' delete
21+
// CHECK: CXXMethodDecl {{.*}} foo {{.*}} delete
2222
// CHECK-NOT: NoBuiltinAttr
2323
A() = default;
24-
// CHECK: CXXConstructorDecl {{.*}} A 'void ()' default
24+
// CHECK: CXXConstructorDecl {{.*}} A {{.*}} default
2525
// CHECK-NOT: NoBuiltinAttr
2626
};
2727

libcxxabi/test/test_demangle.pass.cpp

Lines changed: 104 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
// This test is too big for most embedded devices.
1010
// XFAIL: LIBCXX-PICOLIBC-FIXME
1111

12-
// This test exercises support for char array initializer lists added in dd8b266ef.
12+
// This test exercises support for char array initializer lists added in
13+
// dd8b266ef.
1314
// UNSUPPORTED: using-built-library-before-llvm-20
1415

1516
// Android's long double on x86[-64] is (64/128)-bits instead of Linux's usual
@@ -32,9 +33,8 @@
3233
// Is long double fp128?
3334
#define LDBL_FP128 (__LDBL_MANT_DIG__ == 113)
3435

35-
// clang-format off
36-
const char* cases[][2] =
37-
{
36+
const char *cases[][2] = {
37+
// clang-format off
3838
{"_Z1A", "A"},
3939
{"_Z1Av", "A()"},
4040
{"_Z1A1B1C", "A(B, C)"},
@@ -30244,16 +30244,17 @@ const char* cases[][2] =
3024430244
{"_Z1fDSDRj", "f(_Sat unsigned _Fract)"},
3024530245
{"_Z1fDSDRl", "f(_Sat long _Fract)"},
3024630246
{"_Z1fDSDRm", "f(_Sat unsigned long _Fract)"},
30247+
// clang-format on
3024730248
};
30248-
// clang-format on
3024930249

3025030250
const unsigned N = sizeof(cases) / sizeof(cases[0]);
3025130251

3025230252
struct FPLiteralCase {
30253-
const char* mangled;
30253+
const char *mangled;
3025430254
// There are four possible demanglings of a given float.
3025530255
std::string expecting[4];
3025630256
} fp_literal_cases[] = {
30257+
// clang-format off
3025730258
{"_ZN5test01gIfEEvRAszplcvT__ELf40a00000E_c",
3025830259
{
3025930260
"void test0::g<float>(char (&) [sizeof ((float)() + 0x1.4p+2f)])",
@@ -30279,15 +30280,17 @@ struct FPLiteralCase {
3027930280
#endif
3028030281
#if LDBL_FP128
3028130282
// A 32-character FP literal of long double type
30282-
{"3FooILeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeEE", {"Foo<-0x1.eeeeeeeeeeeeeeeeeeeeeeeeeeeep+12015L>"}},
30283+
{"3FooILeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeEE",
30284+
{"Foo<-0x1.eeeeeeeeeeeeeeeeeeeeeeeeeeeep+12015L>"}},
3028330285
#endif
30286+
// clang-format on
3028430287
};
3028530288
const unsigned NF = sizeof(fp_literal_cases) / sizeof(fp_literal_cases[0]);
30286-
const unsigned NEF = sizeof(fp_literal_cases[0].expecting) / sizeof(fp_literal_cases[0].expecting[0]);
30289+
const unsigned NEF = sizeof(fp_literal_cases[0].expecting) /
30290+
sizeof(fp_literal_cases[0].expecting[0]);
3028730291

30288-
30289-
const char* invalid_cases[] =
30290-
{
30292+
const char *invalid_cases[] = {
30293+
// clang-format off
3029130294
"_ZIPPreEncode",
3029230295
"Agentt",
3029330296
"NSoERj5E=Y1[uM:ga",
@@ -30298,7 +30301,7 @@ const char* invalid_cases[] =
3029830301
#if !LDBL_FP80
3029930302
"_ZN5test01hIfEEvRAcvjplstT_Le4001a000000000000000E_c",
3030030303
#endif
30301-
// The following test cases were found by libFuzzer+ASAN
30304+
// The following test cases were found by libFuzzer+ASAN
3030230305
"\x44\x74\x70\x74\x71\x75\x34\x43\x41\x72\x4D\x6E\x65\x34\x9F\xC1\x43\x41\x72\x4D\x6E\x77\x38\x9A\x8E\x44\x6F\x64\x6C\x53\xF9\x5F\x70\x74\x70\x69\x45\x34\xD3\x73\x9E\x2A\x37",
3030330306
"\x4D\x41\x72\x63\x4E\x39\x44\x76\x72\x4D\x34\x44\x53\x4B\x6F\x44\x54\x6E\x61\x37\x47\x77\x78\x38\x43\x27\x41\x5F\x73\x70\x69\x45*",
3030430307
"\x41\x64\x6E\x32*",
@@ -30344,128 +30347,114 @@ const char* invalid_cases[] =
3034430347
"_ZGI3Foo",
3034530348
"_ZGIW3Foov",
3034630349
"W1x",
30350+
// clang-format on
3034730351
};
3034830352

3034930353
const unsigned NI = sizeof(invalid_cases) / sizeof(invalid_cases[0]);
3035030354

30351-
void test()
30352-
{
30353-
std::size_t len = 0;
30354-
char* buf = nullptr;
30355-
bool failed = false;
30356-
for (unsigned i = 0; i < N; ++i)
30357-
{
30358-
int status;
30359-
char* demang =
30360-
__cxxabiv1::__cxa_demangle(cases[i][0], buf, &len, &status);
30361-
if (!demang || std::strcmp(demang, cases[i][1]) != 0)
30362-
{
30363-
std::fprintf(stderr, "ERROR demangling %s\n"
30364-
"expected: %s\n"
30365-
"got: %d, %s\n",
30366-
cases[i][0], cases[i][1], status,
30367-
demang ? demang : "(null)");
30368-
failed = true;
30369-
}
30370-
if (demang)
30371-
buf = demang;
30355+
void test() {
30356+
std::size_t len = 0;
30357+
char *buf = nullptr;
30358+
bool failed = false;
30359+
for (unsigned i = 0; i < N; ++i) {
30360+
int status;
30361+
char *demang = __cxxabiv1::__cxa_demangle(cases[i][0], buf, &len, &status);
30362+
if (!demang || std::strcmp(demang, cases[i][1]) != 0) {
30363+
std::fprintf(stderr,
30364+
"ERROR demangling %s\n"
30365+
"expected: %s\n"
30366+
"got: %d, %s\n",
30367+
cases[i][0], cases[i][1], status,
30368+
demang ? demang : "(null)");
30369+
failed = true;
3037230370
}
30373-
free(buf);
30374-
assert(!failed && "demangle failed");
30371+
if (demang)
30372+
buf = demang;
30373+
}
30374+
free(buf);
30375+
assert(!failed && "demangle failed");
3037530376
}
3037630377

30377-
void test_invalid_cases()
30378-
{
30379-
std::size_t len = 0;
30380-
char* buf = nullptr;
30381-
bool passed = false;
30382-
for (unsigned i = 0; i < NI; ++i)
30383-
{
30384-
int status;
30385-
char* demang =
30386-
__cxxabiv1::__cxa_demangle(invalid_cases[i], buf, &len, &status);
30387-
if (status != -2)
30388-
{
30389-
std::printf("%s should be invalid but is not\n", invalid_cases[i]);
30390-
std::printf("Got: %d, %s\n", status, demang ? demang : "(null)");
30391-
passed = true;
30392-
}
30393-
if (demang)
30394-
buf = demang;
30378+
void test_invalid_cases() {
30379+
std::size_t len = 0;
30380+
char *buf = nullptr;
30381+
bool passed = false;
30382+
for (unsigned i = 0; i < NI; ++i) {
30383+
int status;
30384+
char *demang =
30385+
__cxxabiv1::__cxa_demangle(invalid_cases[i], buf, &len, &status);
30386+
if (status != -2) {
30387+
std::printf("%s should be invalid but is not\n", invalid_cases[i]);
30388+
std::printf("Got: %d, %s\n", status, demang ? demang : "(null)");
30389+
passed = true;
3039530390
}
30396-
free(buf);
30397-
assert(!passed && "demangle did not fail");
30391+
if (demang)
30392+
buf = demang;
30393+
}
30394+
free(buf);
30395+
assert(!passed && "demangle did not fail");
3039830396
}
3039930397

3040030398
const char *const xfail_cases[] = {
3040130399
// Sentinel value
30402-
nullptr
30400+
nullptr,
3040330401
};
3040430402

30405-
void test_xfail_cases()
30406-
{
30407-
std::size_t len = 0;
30408-
char* buf = nullptr;
30409-
for (const char *c_str : xfail_cases)
30410-
{
30411-
if (!c_str)
30412-
break;
30413-
int status;
30414-
char* demang = __cxxabiv1::__cxa_demangle(c_str, buf, &len, &status);
30415-
if (status != -2)
30416-
{
30417-
std::printf("%s was documented as xfail but passed\n", c_str);
30418-
std::printf("Got status = %d\n", status);
30419-
assert(status == -2);
30420-
}
30421-
else
30422-
{
30423-
buf = demang;
30424-
}
30403+
void test_xfail_cases() {
30404+
std::size_t len = 0;
30405+
char *buf = nullptr;
30406+
for (const char *c_str : xfail_cases) {
30407+
if (!c_str)
30408+
break;
30409+
int status;
30410+
char *demang = __cxxabiv1::__cxa_demangle(c_str, buf, &len, &status);
30411+
if (status != -2) {
30412+
std::printf("%s was documented as xfail but passed\n", c_str);
30413+
std::printf("Got status = %d\n", status);
30414+
assert(status == -2);
30415+
} else {
30416+
buf = demang;
3042530417
}
30426-
free(buf);
30418+
}
30419+
free(buf);
3042730420
}
3042830421

30429-
void testFPLiterals()
30430-
{
30431-
std::size_t len = 0;
30432-
char* buf = nullptr;
30433-
for (unsigned i = 0; i < NF; ++i)
30434-
{
30435-
FPLiteralCase *fpCase = fp_literal_cases+i;
30436-
int status;
30437-
char* demang = __cxxabiv1::__cxa_demangle(fpCase->mangled, buf, &len, &status);
30438-
if (demang == 0)
30439-
{
30440-
std::printf("%s -> %s\n", fpCase->mangled, fpCase->expecting[0].c_str());
30441-
std::printf("Got instead: NULL, %d\n", status);
30442-
assert(false);
30443-
continue;
30444-
}
30445-
std::string *e_beg = fpCase->expecting;
30446-
std::string *e_end = fpCase->expecting + NEF;
30447-
if (std::find(e_beg, e_end, demang) == e_end)
30448-
{
30449-
std::printf("%s -> %s\n", fpCase->mangled, fpCase->expecting[0].c_str());
30450-
std::printf("Got instead: %s\n", demang);
30451-
assert(false);
30452-
continue;
30453-
}
30454-
buf = demang;
30422+
void testFPLiterals() {
30423+
std::size_t len = 0;
30424+
char *buf = nullptr;
30425+
for (unsigned i = 0; i < NF; ++i) {
30426+
FPLiteralCase *fpCase = fp_literal_cases + i;
30427+
int status;
30428+
char *demang =
30429+
__cxxabiv1::__cxa_demangle(fpCase->mangled, buf, &len, &status);
30430+
if (demang == 0) {
30431+
std::printf("%s -> %s\n", fpCase->mangled, fpCase->expecting[0].c_str());
30432+
std::printf("Got instead: NULL, %d\n", status);
30433+
assert(false);
30434+
continue;
3045530435
}
30456-
free(buf);
30436+
std::string *e_beg = fpCase->expecting;
30437+
std::string *e_end = fpCase->expecting + NEF;
30438+
if (std::find(e_beg, e_end, demang) == e_end) {
30439+
std::printf("%s -> %s\n", fpCase->mangled, fpCase->expecting[0].c_str());
30440+
std::printf("Got instead: %s\n", demang);
30441+
assert(false);
30442+
continue;
30443+
}
30444+
buf = demang;
30445+
}
30446+
free(buf);
3045730447
}
3045830448

30459-
int main(int, char**)
30460-
{
30461-
std::printf("Testing %d symbols.\n", N);
30462-
{
30463-
timer t;
30464-
test();
30465-
test_invalid_cases();
30466-
test_xfail_cases();
30467-
testFPLiterals();
30468-
}
30449+
int main(int, char **) {
30450+
std::printf("Testing %d symbols.\n", N);
30451+
{
30452+
timer t;
30453+
test();
30454+
test_invalid_cases();
30455+
test_xfail_cases();
30456+
testFPLiterals();
30457+
}
3046930458
#if 0
3047030459
std::string input;
3047130460
while (std::cin)
@@ -30501,5 +30490,5 @@ int main(int, char**)
3050130490
}
3050230491
#endif
3050330492

30504-
return 0;
30493+
return 0;
3050530494
}

0 commit comments

Comments
 (0)