Skip to content

Commit 618812c

Browse files
author
Jenkins
committed
merge main into amd-staging
Change-Id: Idc26316f6726973754291e1e5aad2af90d479a40
2 parents f9a8177 + 7d55b91 commit 618812c

File tree

310 files changed

+8092
-3401
lines changed

Some content is hidden

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

310 files changed

+8092
-3401
lines changed

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

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,16 @@ AST_MATCHER_P(FunctionDecl, isInstantiatedFrom, Matcher<FunctionDecl>,
3131
Finder, Builder);
3232
}
3333

34-
AST_MATCHER_P(CXXMethodDecl, isOperatorOverloading,
35-
llvm::SmallVector<OverloadedOperatorKind>, Kinds) {
36-
return llvm::is_contained(Kinds, Node.getOverloadedOperator());
34+
constexpr std::initializer_list<OverloadedOperatorKind>
35+
AssignmentOverloadedOperatorKinds = {
36+
OO_Equal, OO_PlusEqual, OO_MinusEqual, OO_StarEqual,
37+
OO_SlashEqual, OO_PercentEqual, OO_CaretEqual, OO_AmpEqual,
38+
OO_PipeEqual, OO_LessLessEqual, OO_GreaterGreaterEqual, OO_PlusPlus,
39+
OO_MinusMinus};
40+
41+
AST_MATCHER(FunctionDecl, isAssignmentOverloadedOperator) {
42+
return llvm::is_contained(AssignmentOverloadedOperatorKinds,
43+
Node.getOverloadedOperator());
3744
}
3845
} // namespace
3946

@@ -164,22 +171,18 @@ void UnusedReturnValueCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
164171
}
165172

166173
void UnusedReturnValueCheck::registerMatchers(MatchFinder *Finder) {
167-
auto MatchedDirectCallExpr = expr(
168-
callExpr(
169-
callee(functionDecl(
170-
// Don't match void overloads of checked functions.
171-
unless(returns(voidType())),
172-
// Don't match copy or move assignment operator.
173-
unless(cxxMethodDecl(isOperatorOverloading(
174-
{OO_Equal, OO_PlusEqual, OO_MinusEqual, OO_StarEqual,
175-
OO_SlashEqual, OO_PercentEqual, OO_CaretEqual, OO_AmpEqual,
176-
OO_PipeEqual, OO_LessLessEqual, OO_GreaterGreaterEqual}))),
177-
anyOf(
178-
isInstantiatedFrom(
179-
matchers::matchesAnyListedName(CheckedFunctions)),
180-
returns(hasCanonicalType(hasDeclaration(namedDecl(
181-
matchers::matchesAnyListedName(CheckedReturnTypes)))))))))
182-
.bind("match"));
174+
auto MatchedDirectCallExpr =
175+
expr(callExpr(callee(functionDecl(
176+
// Don't match copy or move assignment operator.
177+
unless(isAssignmentOverloadedOperator()),
178+
// Don't match void overloads of checked functions.
179+
unless(returns(voidType())),
180+
anyOf(isInstantiatedFrom(matchers::matchesAnyListedName(
181+
CheckedFunctions)),
182+
returns(hasCanonicalType(hasDeclaration(
183+
namedDecl(matchers::matchesAnyListedName(
184+
CheckedReturnTypes)))))))))
185+
.bind("match"));
183186

184187
auto CheckCastToVoid =
185188
AllowCastToVoid ? castExpr(unless(hasCastKind(CK_ToVoid))) : castExpr();

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ void fixGenericExprCastToBool(DiagnosticBuilder &Diag,
8181

8282
const Expr *SubExpr = Cast->getSubExpr();
8383

84-
bool NeedInnerParens =
85-
SubExpr != nullptr && utils::fixit::areParensNeededForStatement(*SubExpr);
84+
bool NeedInnerParens = utils::fixit::areParensNeededForStatement(*SubExpr);
8685
bool NeedOuterParens =
8786
Parent != nullptr && utils::fixit::areParensNeededForStatement(*Parent);
8887

clang-tools-extra/test/clang-tidy/checkers/bugprone/unused-return-value-avoid-assignment.cpp

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,53 @@
33
// RUN: {bugprone-unused-return-value.CheckedFunctions: "::*"}}' \
44
// RUN: --
55

6-
struct S {
7-
S(){};
8-
S(S const &);
9-
S(S &&);
10-
S &operator=(S const &);
11-
S &operator=(S &&);
12-
S &operator+=(S);
6+
struct S1 {
7+
S1(){};
8+
S1(S1 const &);
9+
S1(S1 &&);
10+
S1 &operator=(S1 const &);
11+
S1 &operator=(S1 &&);
12+
S1 &operator+=(S1);
13+
S1 &operator++();
14+
S1 &operator++(int);
15+
S1 &operator--();
16+
S1 &operator--(int);
1317
};
1418

15-
S returnValue();
16-
S const &returnRef();
19+
struct S2 {
20+
S2(){};
21+
S2(S2 const &);
22+
S2(S2 &&);
23+
};
24+
25+
S2 &operator-=(S2&, int);
26+
S2 &operator++(S2 &);
27+
S2 &operator++(S2 &, int);
28+
29+
S1 returnValue();
30+
S1 const &returnRef();
1731

1832
void bar() {
1933
returnValue();
2034
// CHECK-MESSAGES: [[@LINE-1]]:3: warning: the value returned by this function should not be disregarded; neglecting it may lead to errors
2135

22-
S a{};
36+
S1 a{};
2337
a = returnValue();
2438
a.operator=(returnValue());
2539

2640
a = returnRef();
2741
a.operator=(returnRef());
2842

2943
a += returnRef();
44+
45+
a++;
46+
++a;
47+
a--;
48+
--a;
49+
50+
S2 b{};
51+
52+
b -= 1;
53+
b++;
54+
++b;
3055
}

clang/bindings/python/clang/cindex.py

Lines changed: 172 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,29 @@ def __repr__(self):
10911091
# Represents an @available(...) check.
10921092
CursorKind.OBJC_AVAILABILITY_CHECK_EXPR = CursorKind(148)
10931093

1094+
# Fixed point literal.
1095+
CursorKind.FIXED_POINT_LITERAL = CursorKind(149)
1096+
1097+
# OpenMP 5.0 [2.1.4, Array Shaping].
1098+
CursorKind.OMP_ARRAY_SHAPING_EXPR = CursorKind(150)
1099+
1100+
# OpenMP 5.0 [2.1.6 Iterators].
1101+
CursorKind.OMP_ITERATOR_EXPR = CursorKind(151)
1102+
1103+
# OpenCL's addrspace_cast<> expression.
1104+
CursorKind.CXX_ADDRSPACE_CAST_EXPR = CursorKind(152)
1105+
1106+
# Expression that references a C++20 concept.
1107+
CursorKind.CONCEPT_SPECIALIZATION_EXPR = CursorKind(153)
1108+
1109+
# Expression that references a C++20 requires expression.
1110+
CursorKind.REQUIRES_EXPR = CursorKind(154)
1111+
1112+
# Expression that references a C++20 parenthesized list aggregate initializer.
1113+
CursorKind.CXX_PAREN_LIST_INIT_EXPR = CursorKind(155)
1114+
1115+
# Represents a C++26 pack indexing expression.
1116+
CursorKind.PACK_INDEXING_EXPR = CursorKind(156)
10941117

10951118
# A statement whose specific kind is not exposed via this interface.
10961119
#
@@ -1312,6 +1335,114 @@ def __repr__(self):
13121335
# OpenMP teams distribute directive.
13131336
CursorKind.OMP_TEAMS_DISTRIBUTE_DIRECTIVE = CursorKind(271)
13141337

1338+
# OpenMP teams distribute simd directive.
1339+
CursorKind.OMP_TEAMS_DISTRIBUTE_DIRECTIVE = CursorKind(272)
1340+
1341+
# OpenMP teams distribute parallel for simd directive.
1342+
CursorKind.OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE = CursorKind(273)
1343+
1344+
# OpenMP teams distribute parallel for directive.
1345+
CursorKind.OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE = CursorKind(274)
1346+
1347+
# OpenMP target teams directive.
1348+
CursorKind.OMP_TARGET_TEAMS_DIRECTIVE = CursorKind(275)
1349+
1350+
# OpenMP target teams distribute directive.
1351+
CursorKind.OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE = CursorKind(276)
1352+
1353+
# OpenMP target teams distribute parallel for directive.
1354+
CursorKind.OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE = CursorKind(277)
1355+
1356+
# OpenMP target teams distribute parallel for simd directive.
1357+
CursorKind.OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE = CursorKind(278)
1358+
1359+
# OpenMP target teams distribute simd directive.
1360+
CursorKind.OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE = CursorKind(279)
1361+
1362+
# C++2a std::bit_cast expression.
1363+
CursorKind.BUILTIN_BIT_CAST_EXPR = CursorKind(280)
1364+
1365+
# OpenMP master taskloop directive.
1366+
CursorKind.OMP_MASTER_TASK_LOOP_DIRECTIVE = CursorKind(281)
1367+
1368+
# OpenMP parallel master taskloop directive.
1369+
CursorKind.OMP_PARALLEL_MASTER_TASK_LOOP_DIRECTIVE = CursorKind(282)
1370+
1371+
# OpenMP master taskloop simd directive.
1372+
CursorKind.OMP_MASTER_TASK_LOOP_SIMD_DIRECTIVE = CursorKind(283)
1373+
1374+
# OpenMP parallel master taskloop simd directive.
1375+
CursorKind.OMP_PARALLEL_MASTER_TASK_LOOP_SIMD_DIRECTIVE = CursorKind(284)
1376+
1377+
# OpenMP parallel master directive.
1378+
CursorKind.OMP_PARALLEL_MASTER_DIRECTIVE = CursorKind(285)
1379+
1380+
# OpenMP depobj directive.
1381+
CursorKind.OMP_DEPOBJ_DIRECTIVE = CursorKind(286)
1382+
1383+
# OpenMP scan directive.
1384+
CursorKind.OMP_SCAN_DIRECTIVE = CursorKind(287)
1385+
1386+
# OpenMP tile directive.
1387+
CursorKind.OMP_TILE_DIRECTIVE = CursorKind(288)
1388+
1389+
# OpenMP canonical loop.
1390+
CursorKind.OMP_CANONICAL_LOOP = CursorKind(289)
1391+
1392+
# OpenMP interop directive.
1393+
CursorKind.OMP_INTEROP_DIRECTIVE = CursorKind(290)
1394+
1395+
# OpenMP dispatch directive.
1396+
CursorKind.OMP_DISPATCH_DIRECTIVE = CursorKind(291)
1397+
1398+
# OpenMP masked directive.
1399+
CursorKind.OMP_MASKED_DIRECTIVE = CursorKind(292)
1400+
1401+
# OpenMP unroll directive.
1402+
CursorKind.OMP_UNROLL_DIRECTIVE = CursorKind(293)
1403+
1404+
# OpenMP metadirective directive.
1405+
CursorKind.OMP_META_DIRECTIVE = CursorKind(294)
1406+
1407+
# OpenMP loop directive.
1408+
CursorKind.OMP_GENERIC_LOOP_DIRECTIVE = CursorKind(295)
1409+
1410+
# OpenMP teams loop directive.
1411+
CursorKind.OMP_TEAMS_GENERIC_LOOP_DIRECTIVE = CursorKind(296)
1412+
1413+
# OpenMP target teams loop directive.
1414+
CursorKind.OMP_TARGET_TEAMS_GENERIC_LOOP_DIRECTIVE = CursorKind(297)
1415+
1416+
# OpenMP parallel loop directive.
1417+
CursorKind.OMP_PARALLEL_GENERIC_LOOP_DIRECTIVE = CursorKind(298)
1418+
1419+
# OpenMP target parallel loop directive.
1420+
CursorKind.OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVE = CursorKind(299)
1421+
1422+
# OpenMP parallel masked directive.
1423+
CursorKind.OMP_PARALLEL_MASKED_DIRECTIVE = CursorKind(300)
1424+
1425+
# OpenMP masked taskloop directive.
1426+
CursorKind.OMP_MASKED_TASK_LOOP_DIRECTIVE = CursorKind(301)
1427+
1428+
# OpenMP masked taskloop simd directive.
1429+
CursorKind.OMP_MASKED_TASK_LOOP_SIMD_DIRECTIVE = CursorKind(302)
1430+
1431+
# OpenMP parallel masked taskloop directive.
1432+
CursorKind.OMP_PARALLEL_MASKED_TASK_LOOP_DIRECTIVE = CursorKind(303)
1433+
1434+
# OpenMP parallel masked taskloop simd directive.
1435+
CursorKind.OMP_PARALLEL_MASKED_TASK_LOOP_SIMD_DIRECTIVE = CursorKind(304)
1436+
1437+
# OpenMP error directive.
1438+
CursorKind.OMP_ERROR_DIRECTIVE = CursorKind(305)
1439+
1440+
# OpenMP scope directive.
1441+
CursorKind.OMP_SCOPE_DIRECTIVE = CursorKind(306)
1442+
1443+
# OpenACC Compute Construct.
1444+
CursorKind.OPEN_ACC_COMPUTE_DIRECTIVE = CursorKind(320)
1445+
13151446
###
13161447
# Other Kinds
13171448

@@ -1349,6 +1480,24 @@ def __repr__(self):
13491480

13501481
CursorKind.DLLEXPORT_ATTR = CursorKind(418)
13511482
CursorKind.DLLIMPORT_ATTR = CursorKind(419)
1483+
CursorKind.NS_RETURNS_RETAINED = CursorKind(420)
1484+
CursorKind.NS_RETURNS_NOT_RETAINED = CursorKind(421)
1485+
CursorKind.NS_RETURNS_AUTORELEASED = CursorKind(422)
1486+
CursorKind.NS_CONSUMES_SELF = CursorKind(423)
1487+
CursorKind.NS_CONSUMED = CursorKind(424)
1488+
CursorKind.OBJC_EXCEPTION = CursorKind(425)
1489+
CursorKind.OBJC_NSOBJECT = CursorKind(426)
1490+
CursorKind.OBJC_INDEPENDENT_CLASS = CursorKind(427)
1491+
CursorKind.OBJC_PRECISE_LIFETIME = CursorKind(428)
1492+
CursorKind.OBJC_RETURNS_INNER_POINTER = CursorKind(429)
1493+
CursorKind.OBJC_REQUIRES_SUPER = CursorKind(430)
1494+
CursorKind.OBJC_ROOT_CLASS = CursorKind(431)
1495+
CursorKind.OBJC_SUBCLASSING_RESTRICTED = CursorKind(432)
1496+
CursorKind.OBJC_EXPLICIT_PROTOCOL_IMPL = CursorKind(433)
1497+
CursorKind.OBJC_DESIGNATED_INITIALIZER = CursorKind(434)
1498+
CursorKind.OBJC_RUNTIME_VISIBLE = CursorKind(435)
1499+
CursorKind.OBJC_BOXABLE = CursorKind(436)
1500+
CursorKind.FLAG_ENUM = CursorKind(437)
13521501
CursorKind.CONVERGENT_ATTR = CursorKind(438)
13531502
CursorKind.WARN_UNUSED_ATTR = CursorKind(439)
13541503
CursorKind.WARN_UNUSED_RESULT_ATTR = CursorKind(440)
@@ -1395,6 +1544,11 @@ class TemplateArgumentKind(BaseEnumeration):
13951544
TemplateArgumentKind.DECLARATION = TemplateArgumentKind(2)
13961545
TemplateArgumentKind.NULLPTR = TemplateArgumentKind(3)
13971546
TemplateArgumentKind.INTEGRAL = TemplateArgumentKind(4)
1547+
TemplateArgumentKind.TEMPLATE = TemplateArgumentKind(5)
1548+
TemplateArgumentKind.TEMPLATE_EXPANSION = TemplateArgumentKind(6)
1549+
TemplateArgumentKind.EXPRESSION = TemplateArgumentKind(7)
1550+
TemplateArgumentKind.PACK = TemplateArgumentKind(8)
1551+
TemplateArgumentKind.INVALID = TemplateArgumentKind(9)
13981552

13991553
### Exception Specification Kinds ###
14001554
class ExceptionSpecificationKind(BaseEnumeration):
@@ -2240,9 +2394,26 @@ def __repr__(self):
22402394
TypeKind.OCLQUEUE = TypeKind(159)
22412395
TypeKind.OCLRESERVEID = TypeKind(160)
22422396

2397+
TypeKind.OBJCOBJECT = TypeKind(161)
2398+
TypeKind.OBJCCLASS = TypeKind(162)
2399+
TypeKind.ATTRIBUTED = TypeKind(163)
2400+
2401+
TypeKind.OCLINTELSUBGROUPAVCMCEPAYLOAD = TypeKind(164)
2402+
TypeKind.OCLINTELSUBGROUPAVCIMEPAYLOAD = TypeKind(165)
2403+
TypeKind.OCLINTELSUBGROUPAVCREFPAYLOAD = TypeKind(166)
2404+
TypeKind.OCLINTELSUBGROUPAVCSICPAYLOAD = TypeKind(167)
2405+
TypeKind.OCLINTELSUBGROUPAVCMCERESULT = TypeKind(168)
2406+
TypeKind.OCLINTELSUBGROUPAVCIMERESULT = TypeKind(169)
2407+
TypeKind.OCLINTELSUBGROUPAVCREFRESULT = TypeKind(170)
2408+
TypeKind.OCLINTELSUBGROUPAVCSICRESULT = TypeKind(171)
2409+
TypeKind.OCLINTELSUBGROUPAVCIMERESULTSINGLEREFERENCESTREAMOUT = TypeKind(172)
2410+
TypeKind.OCLINTELSUBGROUPAVCIMERESULTSDUALREFERENCESTREAMOUT = TypeKind(173)
2411+
TypeKind.OCLINTELSUBGROUPAVCIMERESULTSSINGLEREFERENCESTREAMIN = TypeKind(174)
2412+
TypeKind.OCLINTELSUBGROUPAVCIMEDUALREFERENCESTREAMIN = TypeKind(175)
2413+
22432414
TypeKind.EXTVECTOR = TypeKind(176)
22442415
TypeKind.ATOMIC = TypeKind(177)
2245-
2416+
TypeKind.BTFTAGATTRIBUTED = TypeKind(178)
22462417

22472418
class RefQualifierKind(BaseEnumeration):
22482419
"""Describes a specific ref-qualifier of a type."""

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "
1111

1212
set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
1313
set(LLVM_ENABLE_DIA_SDK OFF CACHE BOOL "")
14-
set(LLVM_ENABLE_FATLTO ON CACHE BOOL "")
14+
set(LLVM_ENABLE_FATLTO OFF CACHE BOOL "")
1515
set(LLVM_ENABLE_HTTPLIB ON CACHE BOOL "")
1616
set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "")
1717
set(LLVM_ENABLE_LIBEDIT OFF CACHE BOOL "")

0 commit comments

Comments
 (0)