Skip to content

Commit 3837d6d

Browse files
committed
Merge from 'main' to 'sycl-web' (#4)
CONFLICT (content): Merge conflict in clang/lib/Driver/ToolChains/MSVC.cpp
2 parents c5394c4 + 412ac0e commit 3837d6d

File tree

518 files changed

+20791
-12101
lines changed

Some content is hidden

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

518 files changed

+20791
-12101
lines changed

clang-tools-extra/clangd/FindTarget.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,8 @@ allTargetDecls(const DynTypedNode &N) {
710710
Finder.add(CCI, Flags);
711711
else if (const TemplateArgumentLoc *TAL = N.get<TemplateArgumentLoc>())
712712
Finder.add(TAL->getArgument(), Flags);
713-
713+
else if (const CXXBaseSpecifier *CBS = N.get<CXXBaseSpecifier>())
714+
Finder.add(CBS->getTypeSourceInfo()->getType(), Flags);
714715
return Finder.takeDecls();
715716
}
716717

clang-tools-extra/clangd/Selection.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,9 @@ class SelectionVisitor : public RecursiveASTVisitor<SelectionVisitor> {
493493
return traverseNode(
494494
X, [&] { return Base::TraverseConstructorInitializer(X); });
495495
}
496+
bool TraverseCXXBaseSpecifier(const CXXBaseSpecifier &X) {
497+
return traverseNode(&X, [&] { return Base::TraverseCXXBaseSpecifier(X); });
498+
}
496499
// Stmt is the same, but this form allows the data recursion optimization.
497500
bool dataTraverseStmtPre(Stmt *X) {
498501
if (!X || isImplicit(X))

clang-tools-extra/clangd/index/CanonicalIncludes.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,17 @@ void CanonicalIncludes::addSystemHeadersMapping(const LangOptions &Language) {
9292
#include "StdSymbolMap.inc"
9393
// There are two std::move()s, this is by far the most common.
9494
SYMBOL(move, std::, <utility>)
95+
// There are multiple headers for size_t, pick one.
96+
SYMBOL(size_t, std::, <cstddef>)
9597
#undef SYMBOL
9698
});
9799
StdSymbolMapping = Symbols;
98100
} else if (Language.C11) {
99101
static const auto *CSymbols = new llvm::StringMap<llvm::StringRef>({
100102
#define SYMBOL(Name, NameSpace, Header) {#Name, #Header},
101103
#include "CSymbolMap.inc"
104+
// There are multiple headers for size_t, pick one.
105+
SYMBOL(size_t, None, <stddef.h>)
102106
#undef SYMBOL
103107
});
104108
StdSymbolMapping = CSymbols;

clang-tools-extra/clangd/index/Serialization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class Reader {
118118
template <typename T> LLVM_NODISCARD bool consumeSize(T &Container) {
119119
auto Size = consumeVar();
120120
// Conservatively assume each element is at least one byte.
121-
if (Size > (End - Begin)) {
121+
if (Size > (size_t)(End - Begin)) {
122122
Err = true;
123123
return false;
124124
}

clang-tools-extra/clangd/unittests/FindTargetTests.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,24 @@ TEST_F(TargetDeclTest, UsingDecl) {
230230
{"void waldo()"});
231231
}
232232

233+
TEST_F(TargetDeclTest, BaseSpecifier) {
234+
Code = R"cpp(
235+
struct X {};
236+
struct Y : [[private]] X {};
237+
)cpp";
238+
EXPECT_DECLS("CXXBaseSpecifier", "struct X");
239+
Code = R"cpp(
240+
struct X {};
241+
struct Y : [[private X]] {};
242+
)cpp";
243+
EXPECT_DECLS("CXXBaseSpecifier", "struct X");
244+
Code = R"cpp(
245+
struct X {};
246+
struct Y : private [[X]] {};
247+
)cpp";
248+
EXPECT_DECLS("RecordTypeLoc", "struct X");
249+
}
250+
233251
TEST_F(TargetDeclTest, ConstructorInitList) {
234252
Code = R"cpp(
235253
struct X {

clang-tools-extra/clangd/unittests/RenameTests.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,12 @@ TEST(RenameTest, Renameable) {
10241024
}
10251025
)cpp",
10261026
"new name is the same", !HeaderFile, nullptr, "SameName"},
1027+
{R"cpp(// Ensure it doesn't associate base specifier with base name.
1028+
struct A {};
1029+
struct B : priv^ate A {};
1030+
)cpp",
1031+
"Cannot rename symbol: there is no symbol at the given location", false,
1032+
nullptr},
10271033
};
10281034

10291035
for (const auto& Case : Cases) {

clang-tools-extra/clangd/unittests/SelectionTests.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,27 @@ TEST(SelectionTest, CommonAncestor) {
261261
)cpp",
262262
"StringLiteral", // Not DeclRefExpr to operator()!
263263
},
264+
{
265+
R"cpp(
266+
struct Foo {};
267+
struct Bar : [[v^ir^tual private Foo]] {};
268+
)cpp",
269+
"CXXBaseSpecifier",
270+
},
271+
{
272+
R"cpp(
273+
struct Foo {};
274+
struct Bar : private [[Fo^o]] {};
275+
)cpp",
276+
"RecordTypeLoc",
277+
},
278+
{
279+
R"cpp(
280+
struct Foo {};
281+
struct Bar : [[Fo^o]] {};
282+
)cpp",
283+
"RecordTypeLoc",
284+
},
264285

265286
// Point selections.
266287
{"void foo() { [[^foo]](); }", "DeclRefExpr"},

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 7 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
====================================================
2-
Extra Clang Tools 12.0.0 (In-Progress) Release Notes
2+
Extra Clang Tools 13.0.0 (In-Progress) Release Notes
33
====================================================
44

55
.. contents::
@@ -10,15 +10,15 @@ Written by the `LLVM Team <https://llvm.org/>`_
1010

1111
.. warning::
1212

13-
These are in-progress notes for the upcoming Extra Clang Tools 12 release.
13+
These are in-progress notes for the upcoming Extra Clang Tools 13 release.
1414
Release notes for previous releases can be found on
1515
`the Download Page <https://releases.llvm.org/download.html>`_.
1616

1717
Introduction
1818
============
1919

2020
This document contains the release notes for the Extra Clang Tools, part of the
21-
Clang release 12.0.0. Here we describe the status of the Extra Clang Tools in
21+
Clang release 13.0.0. Here we describe the status of the Extra Clang Tools in
2222
some detail, including major improvements from the previous release and new
2323
feature work. All LLVM releases may be downloaded from the `LLVM releases web
2424
site <https://llvm.org/releases/>`_.
@@ -32,7 +32,7 @@ main Clang web page, this document applies to the *next* release, not
3232
the current one. To see the release notes for a specific release, please
3333
see the `releases page <https://llvm.org/releases/>`_.
3434

35-
What's New in Extra Clang Tools 12.0.0?
35+
What's New in Extra Clang Tools 13.0.0?
3636
=======================================
3737

3838
Some of the major new features and improvements to Extra Clang Tools are listed
@@ -47,17 +47,7 @@ Major New Features
4747
Improvements to clangd
4848
----------------------
4949

50-
- clangd's memory usage is significantly reduced on most Linux systems.
51-
In particular, memory usage should not increase dramatically over time.
52-
53-
The standard allocator on most systems is glibc's ptmalloc2, and it creates
54-
disproportionately large heaps when handling clangd's allocation patterns.
55-
By default, clangd will now periodically call ``malloc_trim`` to release free
56-
pages on glibc systems.
57-
58-
Users of other allocators (such as ``jemalloc`` or ``tcmalloc``) on glibc
59-
systems can disable this using ``--malloc_trim=0`` or the CMake flag
60-
``-DCLANGD_MALLOC_TRIM=0``.
50+
The improvements are...
6151

6252
Improvements to clang-doc
6353
-------------------------
@@ -67,7 +57,7 @@ The improvements are...
6757
Improvements to clang-query
6858
---------------------------
6959

70-
- The IgnoreImplicitCastsAndParentheses traversal mode has been removed.
60+
The improvements are...
7161

7262
Improvements to clang-rename
7363
----------------------------
@@ -77,123 +67,7 @@ The improvements are...
7767
Improvements to clang-tidy
7868
--------------------------
7969

80-
- Checks that allow configuring names of headers to include now support wrapping
81-
the include in angle brackets to create a system include. For example,
82-
:doc:`cppcoreguidelines-init-variables
83-
<clang-tidy/checks/cppcoreguidelines-init-variables>` and
84-
:doc:`modernize-make-unique <clang-tidy/checks/modernize-make-unique>`.
85-
86-
- CheckOptions that take boolean values now support all spellings supported in
87-
the `YAML format <https://yaml.org/type/bool.html>`_.
88-
89-
New modules
90-
^^^^^^^^^^^
91-
92-
- New ``altera`` module.
93-
94-
Includes checks related to OpenCL for FPGA coding guidelines, based on the
95-
`Altera SDK for OpenCL: Best Practices Guide
96-
<https://www.altera.com/en_US/pdfs/literature/hb/opencl-sdk/aocl_optimization_guide.pdf>`_.
97-
98-
- New ``concurrency`` module.
99-
100-
Includes checks related to concurrent programming (e.g. threads, fibers,
101-
coroutines, etc.).
102-
103-
New checks
104-
^^^^^^^^^^
105-
106-
- New :doc:`altera-kernel-name-restriction
107-
<clang-tidy/checks/altera-kernel-name-restriction>` check.
108-
109-
Finds kernel files and include directives whose filename is `kernel.cl`,
110-
`Verilog.cl`, or `VHDL.cl`.
111-
112-
- New :doc:`altera-single-work-item-barrier
113-
<clang-tidy/checks/altera-single-work-item-barrier>` check.
114-
115-
Finds OpenCL kernel functions that call a barrier function but do not call
116-
an ID function.
117-
118-
- New :doc:`altera-struct-pack-align
119-
<clang-tidy/checks/altera-struct-pack-align>` check.
120-
121-
Finds structs that are inefficiently packed or aligned, and recommends
122-
packing and/or aligning of said structs as needed.
123-
124-
- New :doc:`cppcoreguidelines-prefer-member-initializer
125-
<clang-tidy/checks/cppcoreguidelines-prefer-member-initializer>` check.
126-
127-
Finds member initializations in the constructor body which can be placed into
128-
the initialization list instead.
129-
130-
- New :doc:`bugprone-misplaced-pointer-arithmetic-in-alloc
131-
<clang-tidy/checks/bugprone-misplaced-pointer-arithmetic-in-alloc>` check.
132-
133-
- New :doc:`bugprone-redundant-branch-condition
134-
<clang-tidy/checks/bugprone-redundant-branch-condition>` check.
135-
136-
Finds condition variables in nested ``if`` statements that were also checked
137-
in the outer ``if`` statement and were not changed.
138-
139-
- New :doc:`concurrency-mt-unsafe <clang-tidy/checks/concurrency-mt-unsafe>`
140-
check.
141-
142-
Finds thread-unsafe functions usage. Currently knows about POSIX and
143-
Glibc function sets.
144-
145-
- New :doc:`bugprone-signal-handler
146-
<clang-tidy/checks/bugprone-signal-handler>` check.
147-
148-
Finds functions registered as signal handlers that call non asynchronous-safe
149-
functions.
150-
151-
- New :doc:`cert-sig30-c
152-
<clang-tidy/checks/cert-sig30-c>` check.
153-
154-
Alias to the :doc:`bugprone-signal-handler
155-
<clang-tidy/checks/bugprone-signal-handler>` check.
156-
157-
- New :doc:`performance-no-int-to-ptr
158-
<clang-tidy/checks/performance-no-int-to-ptr>` check.
159-
160-
Diagnoses every integer to pointer cast.
161-
162-
- New :doc:`readability-function-cognitive-complexity
163-
<clang-tidy/checks/readability-function-cognitive-complexity>` check.
164-
165-
Flags functions with Cognitive Complexity metric exceeding the configured limit.
166-
167-
Changes in existing checks
168-
^^^^^^^^^^^^^^^^^^^^^^^^^^
169-
170-
- Improved :doc:`modernize-loop-convert
171-
<clang-tidy/checks/modernize-loop-convert>` check.
172-
173-
Now able to transform iterator loops using ``rbegin`` and ``rend`` methods.
174-
175-
- Improved :doc:`readability-identifier-naming
176-
<clang-tidy/checks/readability-identifier-naming>` check.
177-
178-
Added an option `GetConfigPerFile` to support including files which use
179-
different naming styles.
180-
181-
Now renames overridden virtual methods if the method they override has a
182-
style violation.
183-
184-
Added support for specifying the style of scoped ``enum`` constants. If
185-
unspecified, will fall back to the style for regular ``enum`` constants.
186-
187-
Added an option `IgnoredRegexp` per identifier type to suppress identifier
188-
naming checks for names matching a regular expression.
189-
190-
- Removed `google-runtime-references` check because the rule it checks does
191-
not exist in the Google Style Guide anymore.
192-
193-
- Improved :doc:`readability-redundant-string-init
194-
<clang-tidy/checks/readability-redundant-string-init>` check.
195-
196-
Added `std::basic_string_view` to default list of ``string``-like types.
70+
The improvements are...
19771

19872
Improvements to include-fixer
19973
-----------------------------

clang-tools-extra/docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
# built documents.
5050
#
5151
# The short version.
52-
version = '12'
52+
version = '13'
5353
# The full version, including alpha/beta/rc tags.
54-
release = '12'
54+
release = '13'
5555

5656
# The language for content autogenerated by Sphinx. Refer to documentation
5757
# for a list of supported languages.

clang/docs/ClangCommandLineReference.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,6 +2045,12 @@ Set update method of profile counters (atomic,prefer-atomic,single)
20452045

20462046
Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
20472047

2048+
.. program:: clang1
2049+
.. option:: -fprofile-list=<file>
2050+
.. program:: clang
2051+
2052+
Filename defining the list of functions/files to instrument. The file uses the sanitizer special case list format.
2053+
20482054
.. option:: -freciprocal-math, -fno-reciprocal-math
20492055

20502056
Allow division operations to be reassociated

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,27 +2351,6 @@ the configuration (without a prefix: ``Auto``).
23512351
``ClassImpl.hpp`` would not have the main include file put on top
23522352
before any other include.
23532353

2354-
**IncludeSortAlphabetically** (``bool``)
2355-
Specify if sorting should be done in an alphabetical and
2356-
case sensitive fashion.
2357-
2358-
When ``false``, includes are sorted in an ASCIIbetical
2359-
fashion.
2360-
When ``true``, includes are sorted in an alphabetical
2361-
fashion with case used as a tie-breaker.
2362-
2363-
2364-
.. code-block:: c++
2365-
2366-
false: true:
2367-
#include "A/B.h" vs. #include "A/B.h"
2368-
#include "A/b.h" #include "A/b.h"
2369-
#include "B/A.h" #include "a/b.h"
2370-
#include "B/a.h" #include "B/A.h"
2371-
#include "a/b.h" #include "B/a.h"
2372-
2373-
This option is off by default.
2374-
23752354
**IndentCaseBlocks** (``bool``)
23762355
Indent case label blocks one level from the case label.
23772356

0 commit comments

Comments
 (0)