Skip to content

Commit 283ec83

Browse files
committed
merge main into amd-staging
revert: breaks smoke/xteamr f4ee5a6 [OpenMP] Replace AMDGPU fences with generic scoped fences (llvm#119619) Change-Id: I36a5e0cc20c1820289bc8836dae1c8cfe1fdd275
2 parents f5191c4 + 602bbf2 commit 283ec83

File tree

334 files changed

+12656
-5419
lines changed

Some content is hidden

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

334 files changed

+12656
-5419
lines changed

clang-tools-extra/docs/clang-tidy/checks/clang-analyzer/cplusplus.PureVirtualCall.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. title:: clang-tidy - clang-analyzer-cplusplus.SelfAssignment
2+
.. meta::
3+
:http-equiv=refresh: 5;URL=https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-selfassignment
4+
5+
clang-analyzer-cplusplus.SelfAssignment
6+
=======================================
7+
8+
Checks C++ copy and move assignment operators for self assignment.
9+
10+
The `clang-analyzer-cplusplus.SelfAssignment` check is an alias, please see
11+
`Clang Static Analyzer Available Checkers
12+
<https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-stringchecker>`_
13+
for more information.

clang-tools-extra/docs/clang-tidy/checks/clang-analyzer/optin.osx.OSObjectCStyleCast.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

clang-tools-extra/docs/clang-tidy/checks/clang-analyzer/osx.MIG.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

clang-tools-extra/docs/clang-tidy/checks/clang-analyzer/osx.OSObjectRetainCount.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

clang-tools-extra/docs/clang-tidy/checks/clang-analyzer/security.PutenvStackArray.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
clang-analyzer-security.PutenvStackArray
44
========================================
55

6-
Finds calls to the function 'putenv' which pass a pointer to an automatic
7-
(stack-allocated) array as the argument.
6+
Finds calls to the putenv function which pass a pointer to a stack-allocated
7+
(automatic) array as the argument. Function putenv does not copy the passed
8+
string, only a pointer to the data is stored and this data can be read even by
9+
other threads. Content of a stack-allocated array is likely to be overwritten
10+
after exiting from the function.
811

9-
The clang-analyzer-security.PutenvStackArray check is an alias of
10-
Clang Static Analyzer security.PutenvStackArray.
12+
The `clang-analyzer-security.PutenvStackArray` check is an alias, please see
13+
`Clang Static Analyzer Available Checkers
14+
<https://clang.llvm.org/docs/analyzer/checkers.html#security-putenvstackarray-c>`_
15+
for more information.

clang-tools-extra/docs/clang-tidy/checks/clang-analyzer/security.SetgidSetuidOrder.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
clang-analyzer-security.SetgidSetuidOrder
44
=========================================
55

6-
Warn on possible reversed order of 'setgid(getgid()))' and 'setuid(getuid())'
7-
(CERT: POS36-C).
6+
The checker checks for sequences of ``setuid(getuid())`` and ``setgid(getgid())``
7+
calls (in this order). If such a sequence is found and there is no other
8+
privilege-changing function call (``seteuid``, ``setreuid``, ``setresuid`` and
9+
the GID versions of these) in between, a warning is generated. The checker finds
10+
only exactly ``setuid(getuid())`` calls (and the GID versions), not for example
11+
if the result of ``getuid()`` is stored in a variable.
812

9-
The clang-analyzer-security.SetgidSetuidOrder check is an alias of
10-
Clang Static Analyzer security.SetgidSetuidOrder.
13+
The `clang-analyzer-security.SetgidSetuidOrder` check is an alias, please see
14+
`Clang Static Analyzer Available Checkers
15+
<https://clang.llvm.org/docs/analyzer/checkers.html#security-setgidsetuidorder-c>`_
16+
for more information.

clang-tools-extra/docs/clang-tidy/checks/list.rst

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ Check aliases
459459
:doc:`clang-analyzer-cplusplus.NewDelete <clang-analyzer/cplusplus.NewDelete>`, `Clang Static Analyzer cplusplus.NewDelete <https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-newdelete>`_,
460460
:doc:`clang-analyzer-cplusplus.NewDeleteLeaks <clang-analyzer/cplusplus.NewDeleteLeaks>`, `Clang Static Analyzer cplusplus.NewDeleteLeaks <https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-newdeleteleaks>`_,
461461
:doc:`clang-analyzer-cplusplus.PlacementNew <clang-analyzer/cplusplus.PlacementNew>`, `Clang Static Analyzer cplusplus.PlacementNew <https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-placementnew>`_,
462-
:doc:`clang-analyzer-cplusplus.PureVirtualCall <clang-analyzer/cplusplus.PureVirtualCall>`, Clang Static Analyzer cplusplus.PureVirtualCall,
462+
:doc:`clang-analyzer-cplusplus.SelfAssignment <clang-analyzer/cplusplus.SelfAssignment>`, `Clang Static Analyzer cplusplus.SelfAssignment <https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-selfassignment>`_,
463463
:doc:`clang-analyzer-cplusplus.StringChecker <clang-analyzer/cplusplus.StringChecker>`, `Clang Static Analyzer cplusplus.StringChecker <https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-stringchecker>`_,
464464
:doc:`clang-analyzer-deadcode.DeadStores <clang-analyzer/deadcode.DeadStores>`, `Clang Static Analyzer deadcode.DeadStores <https://clang.llvm.org/docs/analyzer/checkers.html#deadcode-deadstores>`_,
465465
:doc:`clang-analyzer-fuchsia.HandleChecker <clang-analyzer/fuchsia.HandleChecker>`, `Clang Static Analyzer fuchsia.HandleChecker <https://clang.llvm.org/docs/analyzer/checkers.html#fuchsia-handlechecker>`_,
@@ -472,17 +472,14 @@ Check aliases
472472
:doc:`clang-analyzer-optin.cplusplus.UninitializedObject <clang-analyzer/optin.cplusplus.UninitializedObject>`, `Clang Static Analyzer optin.cplusplus.UninitializedObject <https://clang.llvm.org/docs/analyzer/checkers.html#optin-cplusplus-uninitializedobject>`_,
473473
:doc:`clang-analyzer-optin.cplusplus.VirtualCall <clang-analyzer/optin.cplusplus.VirtualCall>`, `Clang Static Analyzer optin.cplusplus.VirtualCall <https://clang.llvm.org/docs/analyzer/checkers.html#optin-cplusplus-virtualcall>`_,
474474
:doc:`clang-analyzer-optin.mpi.MPI-Checker <clang-analyzer/optin.mpi.MPI-Checker>`, `Clang Static Analyzer optin.mpi.MPI-Checker <https://clang.llvm.org/docs/analyzer/checkers.html#optin-mpi-mpi-checker>`_,
475-
:doc:`clang-analyzer-optin.osx.OSObjectCStyleCast <clang-analyzer/optin.osx.OSObjectCStyleCast>`, Clang Static Analyzer optin.osx.OSObjectCStyleCast,
476475
:doc:`clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker <clang-analyzer/optin.osx.cocoa.localizability.EmptyLocalizationContextChecker>`, `Clang Static Analyzer optin.osx.cocoa.localizability.EmptyLocalizationContextChecker <https://clang.llvm.org/docs/analyzer/checkers.html#optin-osx-cocoa-localizability-emptylocalizationcontextchecker>`_,
477476
:doc:`clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker <clang-analyzer/optin.osx.cocoa.localizability.NonLocalizedStringChecker>`, `Clang Static Analyzer optin.osx.cocoa.localizability.NonLocalizedStringChecker <https://clang.llvm.org/docs/analyzer/checkers.html#optin-osx-cocoa-localizability-nonlocalizedstringchecker>`_,
478477
:doc:`clang-analyzer-optin.performance.GCDAntipattern <clang-analyzer/optin.performance.GCDAntipattern>`, `Clang Static Analyzer optin.performance.GCDAntipattern <https://clang.llvm.org/docs/analyzer/checkers.html#optin-performance-gcdantipattern>`_,
479478
:doc:`clang-analyzer-optin.performance.Padding <clang-analyzer/optin.performance.Padding>`, `Clang Static Analyzer optin.performance.Padding <https://clang.llvm.org/docs/analyzer/checkers.html#optin-performance-padding>`_,
480479
:doc:`clang-analyzer-optin.portability.UnixAPI <clang-analyzer/optin.portability.UnixAPI>`, `Clang Static Analyzer optin.portability.UnixAPI <https://clang.llvm.org/docs/analyzer/checkers.html#optin-portability-unixapi>`_,
481480
:doc:`clang-analyzer-optin.taint.TaintedAlloc <clang-analyzer/optin.taint.TaintedAlloc>`, `Clang Static Analyzer optin.taint.TaintedAlloc <https://clang.llvm.org/docs/analyzer/checkers.html#optin-taint-taintedalloc>`_,
482481
:doc:`clang-analyzer-osx.API <clang-analyzer/osx.API>`, `Clang Static Analyzer osx.API <https://clang.llvm.org/docs/analyzer/checkers.html#osx-api>`_,
483-
:doc:`clang-analyzer-osx.MIG <clang-analyzer/osx.MIG>`, Clang Static Analyzer osx.MIG,
484482
:doc:`clang-analyzer-osx.NumberObjectConversion <clang-analyzer/osx.NumberObjectConversion>`, `Clang Static Analyzer osx.NumberObjectConversion <https://clang.llvm.org/docs/analyzer/checkers.html#osx-numberobjectconversion>`_,
485-
:doc:`clang-analyzer-osx.OSObjectRetainCount <clang-analyzer/osx.OSObjectRetainCount>`, Clang Static Analyzer osx.OSObjectRetainCount,
486483
:doc:`clang-analyzer-osx.ObjCProperty <clang-analyzer/osx.ObjCProperty>`, `Clang Static Analyzer osx.ObjCProperty <https://clang.llvm.org/docs/analyzer/checkers.html#osx-objcproperty>`_,
487484
:doc:`clang-analyzer-osx.SecKeychainAPI <clang-analyzer/osx.SecKeychainAPI>`, `Clang Static Analyzer osx.SecKeychainAPI <https://clang.llvm.org/docs/analyzer/checkers.html#osx-seckeychainapi>`_,
488485
:doc:`clang-analyzer-osx.cocoa.AtSync <clang-analyzer/osx.cocoa.AtSync>`, `Clang Static Analyzer osx.cocoa.AtSync <https://clang.llvm.org/docs/analyzer/checkers.html#osx-cocoa-atsync>`_,
@@ -509,15 +506,14 @@ Check aliases
509506
:doc:`clang-analyzer-osx.coreFoundation.containers.OutOfBounds <clang-analyzer/osx.coreFoundation.containers.OutOfBounds>`, `Clang Static Analyzer osx.coreFoundation.containers.OutOfBounds <https://clang.llvm.org/docs/analyzer/checkers.html#osx-corefoundation-containers-outofbounds>`_,
510507
:doc:`clang-analyzer-osx.coreFoundation.containers.PointerSizedValues <clang-analyzer/osx.coreFoundation.containers.PointerSizedValues>`, `Clang Static Analyzer osx.coreFoundation.containers.PointerSizedValues <https://clang.llvm.org/docs/analyzer/checkers.html#osx-corefoundation-containers-pointersizedvalues>`_,
511508
:doc:`clang-analyzer-security.FloatLoopCounter <clang-analyzer/security.FloatLoopCounter>`, `Clang Static Analyzer security.FloatLoopCounter <https://clang.llvm.org/docs/analyzer/checkers.html#security-floatloopcounter>`_,
512-
:doc:`clang-analyzer-security.PutenvStackArray <clang-analyzer/security.PutenvStackArray>`, Clang Static Analyzer security.PutenvStackArray,
513-
:doc:`clang-analyzer-security.SetgidSetuidOrder <clang-analyzer/security.SetgidSetuidOrder>`, Clang Static Analyzer security.SetgidSetuidOrder,
509+
:doc:`clang-analyzer-security.PutenvStackArray <clang-analyzer/security.PutenvStackArray>`, `Clang Static Analyzer security.PutenvStackArray <https://clang.llvm.org/docs/analyzer/checkers.html#security-putenvstackarray-c>`_,
510+
:doc:`clang-analyzer-security.SetgidSetuidOrder <clang-analyzer/security.SetgidSetuidOrder>`, `Clang Static Analyzer security.SetgidSetuidOrder <https://clang.llvm.org/docs/analyzer/checkers.html#security-setgidsetuidorder-c>`_,
514511
:doc:`clang-analyzer-security.cert.env.InvalidPtr <clang-analyzer/security.cert.env.InvalidPtr>`, `Clang Static Analyzer security.cert.env.InvalidPtr <https://clang.llvm.org/docs/analyzer/checkers.html#security-cert-env-invalidptr>`_,
515512
:doc:`clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling <clang-analyzer/security.insecureAPI.DeprecatedOrUnsafeBufferHandling>`, `Clang Static Analyzer security.insecureAPI.DeprecatedOrUnsafeBufferHandling <https://clang.llvm.org/docs/analyzer/checkers.html#security-insecureapi-deprecatedorunsafebufferhandling>`_,
516513
:doc:`clang-analyzer-security.insecureAPI.UncheckedReturn <clang-analyzer/security.insecureAPI.UncheckedReturn>`, `Clang Static Analyzer security.insecureAPI.UncheckedReturn <https://clang.llvm.org/docs/analyzer/checkers.html#security-insecureapi-uncheckedreturn>`_,
517514
:doc:`clang-analyzer-security.insecureAPI.bcmp <clang-analyzer/security.insecureAPI.bcmp>`, `Clang Static Analyzer security.insecureAPI.bcmp <https://clang.llvm.org/docs/analyzer/checkers.html#security-insecureapi-bcmp>`_,
518515
:doc:`clang-analyzer-security.insecureAPI.bcopy <clang-analyzer/security.insecureAPI.bcopy>`, `Clang Static Analyzer security.insecureAPI.bcopy <https://clang.llvm.org/docs/analyzer/checkers.html#security-insecureapi-bcopy>`_,
519516
:doc:`clang-analyzer-security.insecureAPI.bzero <clang-analyzer/security.insecureAPI.bzero>`, `Clang Static Analyzer security.insecureAPI.bzero <https://clang.llvm.org/docs/analyzer/checkers.html#security-insecureapi-bzero>`_,
520-
:doc:`clang-analyzer-security.insecureAPI.decodeValueOfObjCType <clang-analyzer/security.insecureAPI.decodeValueOfObjCType>`, Clang Static Analyzer security.insecureAPI.decodeValueOfObjCType,
521517
:doc:`clang-analyzer-security.insecureAPI.getpw <clang-analyzer/security.insecureAPI.getpw>`, `Clang Static Analyzer security.insecureAPI.getpw <https://clang.llvm.org/docs/analyzer/checkers.html#security-insecureapi-getpw>`_,
522518
:doc:`clang-analyzer-security.insecureAPI.gets <clang-analyzer/security.insecureAPI.gets>`, `Clang Static Analyzer security.insecureAPI.gets <https://clang.llvm.org/docs/analyzer/checkers.html#security-insecureapi-gets>`_,
523519
:doc:`clang-analyzer-security.insecureAPI.mkstemp <clang-analyzer/security.insecureAPI.mkstemp>`, `Clang Static Analyzer security.insecureAPI.mkstemp <https://clang.llvm.org/docs/analyzer/checkers.html#security-insecureapi-mkstemp>`_,
@@ -536,9 +532,6 @@ Check aliases
536532
:doc:`clang-analyzer-unix.Vfork <clang-analyzer/unix.Vfork>`, `Clang Static Analyzer unix.Vfork <https://clang.llvm.org/docs/analyzer/checkers.html#unix-vfork>`_,
537533
:doc:`clang-analyzer-unix.cstring.BadSizeArg <clang-analyzer/unix.cstring.BadSizeArg>`, `Clang Static Analyzer unix.cstring.BadSizeArg <https://clang.llvm.org/docs/analyzer/checkers.html#unix-cstring-badsizearg>`_,
538534
:doc:`clang-analyzer-unix.cstring.NullArg <clang-analyzer/unix.cstring.NullArg>`, `Clang Static Analyzer unix.cstring.NullArg <https://clang.llvm.org/docs/analyzer/checkers.html#unix-cstring-nullarg>`_,
539-
:doc:`clang-analyzer-valist.CopyToSelf <clang-analyzer/valist.CopyToSelf>`, Clang Static Analyzer valist.CopyToSelf,
540-
:doc:`clang-analyzer-valist.Uninitialized <clang-analyzer/valist.Uninitialized>`, Clang Static Analyzer valist.Uninitialized,
541-
:doc:`clang-analyzer-valist.Unterminated <clang-analyzer/valist.Unterminated>`, Clang Static Analyzer valist.Unterminated,
542535
:doc:`clang-analyzer-webkit.NoUncountedMemberChecker <clang-analyzer/webkit.NoUncountedMemberChecker>`, `Clang Static Analyzer webkit.NoUncountedMemberChecker <https://clang.llvm.org/docs/analyzer/checkers.html#webkit-nouncountedmemberchecker>`_,
543536
:doc:`clang-analyzer-webkit.RefCntblBaseVirtualDtor <clang-analyzer/webkit.RefCntblBaseVirtualDtor>`, `Clang Static Analyzer webkit.RefCntblBaseVirtualDtor <https://clang.llvm.org/docs/analyzer/checkers.html#webkit-refcntblbasevirtualdtor>`_,
544537
:doc:`clang-analyzer-webkit.UncountedLambdaCapturesChecker <clang-analyzer/webkit.UncountedLambdaCapturesChecker>`, `Clang Static Analyzer webkit.UncountedLambdaCapturesChecker <https://clang.llvm.org/docs/analyzer/checkers.html#webkit-uncountedlambdacaptureschecker>`_,

clang/docs/ReleaseNotes.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,8 @@ Improvements to Clang's diagnostics
644644

645645
- Clang now diagnoses ``[[deprecated]]`` attribute usage on local variables (#GH90073).
646646

647+
- Fix false positives when `[[gsl::Owner/Pointer]]` and `[[clang::lifetimebound]]` are used together.
648+
647649
- Improved diagnostic message for ``__builtin_bit_cast`` size mismatch (#GH115870).
648650

649651
- Clang now omits shadow warnings for enum constants in separate class scopes (#GH62588).
@@ -696,6 +698,15 @@ Improvements to Clang's diagnostics
696698
bool operator==(const C&) = default;
697699
};
698700

701+
- Clang now emits `-Wdangling-capture` diangostic when a STL container captures a dangling reference.
702+
703+
.. code-block:: c++
704+
705+
void test() {
706+
std::vector<std::string_view> views;
707+
views.push_back(std::string("123")); // warning
708+
}
709+
699710
Improvements to Clang's time-trace
700711
----------------------------------
701712

clang/include/clang-c/CXString.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ typedef struct {
4646

4747
/**
4848
* Retrieve the character data associated with the given string.
49+
*
50+
* The returned data is a reference and not owned by the user. This data
51+
* is only valid while the `CXString` is valid. This function is similar
52+
* to `std::string::c_str()`.
4953
*/
5054
CINDEX_LINKAGE const char *clang_getCString(CXString string);
5155

clang/include/clang-c/Index.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2166,9 +2166,27 @@ enum CXCursorKind {
21662166
*/
21672167
CXCursor_OpenACCLoopConstruct = 321,
21682168

2169+
/** OpenACC Combined Constructs.
2170+
*/
21692171
CXCursor_OpenACCCombinedConstruct = 322,
21702172

2171-
CXCursor_LastStmt = CXCursor_OpenACCCombinedConstruct,
2173+
/** OpenACC data Construct.
2174+
*/
2175+
CXCursor_OpenACCDataConstruct = 323,
2176+
2177+
/** OpenACC enter data Construct.
2178+
*/
2179+
CXCursor_OpenACCEnterDataConstruct = 324,
2180+
2181+
/** OpenACC exit data Construct.
2182+
*/
2183+
CXCursor_OpenACCExitDataConstruct = 325,
2184+
2185+
/** OpenACC host_data Construct.
2186+
*/
2187+
CXCursor_OpenACCHostDataConstruct = 326,
2188+
2189+
CXCursor_LastStmt = CXCursor_OpenACCHostDataConstruct,
21722190

21732191
/**
21742192
* Cursor that represents the translation unit itself.

clang/include/clang/AST/RecursiveASTVisitor.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2151,8 +2151,11 @@ DEF_TRAVERSE_DECL(DecompositionDecl, {
21512151
})
21522152

21532153
DEF_TRAVERSE_DECL(BindingDecl, {
2154-
if (getDerived().shouldVisitImplicitCode())
2154+
if (getDerived().shouldVisitImplicitCode()) {
21552155
TRY_TO(TraverseStmt(D->getBinding()));
2156+
if (const auto HoldingVar = D->getHoldingVar())
2157+
TRY_TO(TraverseDecl(HoldingVar));
2158+
}
21562159
})
21572160

21582161
DEF_TRAVERSE_DECL(MSPropertyDecl, { TRY_TO(TraverseDeclaratorHelper(D)); })
@@ -4058,6 +4061,12 @@ DEF_TRAVERSE_STMT(OpenACCLoopConstruct,
40584061
{ TRY_TO(TraverseOpenACCAssociatedStmtConstruct(S)); })
40594062
DEF_TRAVERSE_STMT(OpenACCCombinedConstruct,
40604063
{ TRY_TO(TraverseOpenACCAssociatedStmtConstruct(S)); })
4064+
DEF_TRAVERSE_STMT(OpenACCDataConstruct,
4065+
{ TRY_TO(TraverseOpenACCAssociatedStmtConstruct(S)); })
4066+
DEF_TRAVERSE_STMT(OpenACCEnterDataConstruct, {})
4067+
DEF_TRAVERSE_STMT(OpenACCExitDataConstruct, {})
4068+
DEF_TRAVERSE_STMT(OpenACCHostDataConstruct,
4069+
{ TRY_TO(TraverseOpenACCAssociatedStmtConstruct(S)); })
40614070

40624071
// Traverse HLSL: Out argument expression
40634072
DEF_TRAVERSE_STMT(HLSLOutArgExpr, {})

0 commit comments

Comments
 (0)