Skip to content

Commit 1f2fcd0

Browse files
committed
Merge from 'main' to 'sycl-web' (79 commits)
CONFLICT (content): Merge conflict in llvm/test/CodeGen/X86/avx512-broadcast-unfold.ll
2 parents 59a1b4a + b8bc235 commit 1f2fcd0

File tree

344 files changed

+11516
-7606
lines changed

Some content is hidden

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

344 files changed

+11516
-7606
lines changed

bolt/test/runtime/AArch64/instrumentation-ind-call.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ int main() {
1414
/*
1515
REQUIRES: system-linux,bolt-runtime
1616
17-
RUN: %clang %cflags %s -o %t.exe -Wl,-q -nopie -fpie
17+
RUN: %clang %cflags %s -o %t.exe -Wl,-q -no-pie -fpie
1818
1919
RUN: llvm-bolt %t.exe --instrument --instrumentation-file=%t.fdata \
2020
RUN: -o %t.instrumented

clang-tools-extra/clang-tidy/ClangTidy.cpp

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ class ErrorReporter {
147147
Files.makeAbsolutePath(FixAbsoluteFilePath);
148148
tooling::Replacement R(FixAbsoluteFilePath, Repl.getOffset(),
149149
Repl.getLength(), Repl.getReplacementText());
150-
Replacements &Replacements = FileReplacements[R.getFilePath()];
150+
auto &Entry = FileReplacements[R.getFilePath()];
151+
Replacements &Replacements = Entry.Replaces;
151152
llvm::Error Err = Replacements.add(R);
152153
if (Err) {
153154
// FIXME: Implement better conflict handling.
@@ -174,6 +175,7 @@ class ErrorReporter {
174175
}
175176
FixLoc = getLocation(FixAbsoluteFilePath, Repl.getOffset());
176177
FixLocations.push_back(std::make_pair(FixLoc, CanBeApplied));
178+
Entry.BuildDir = Error.BuildDirectory;
177179
}
178180
}
179181
}
@@ -189,9 +191,14 @@ class ErrorReporter {
189191

190192
void finish() {
191193
if (TotalFixes > 0) {
192-
Rewriter Rewrite(SourceMgr, LangOpts);
194+
auto &VFS = Files.getVirtualFileSystem();
195+
auto OriginalCWD = VFS.getCurrentWorkingDirectory();
196+
bool AnyNotWritten = false;
197+
193198
for (const auto &FileAndReplacements : FileReplacements) {
199+
Rewriter Rewrite(SourceMgr, LangOpts);
194200
StringRef File = FileAndReplacements.first();
201+
VFS.setCurrentWorkingDirectory(FileAndReplacements.second.BuildDir);
195202
llvm::ErrorOr<std::unique_ptr<MemoryBuffer>> Buffer =
196203
SourceMgr.getFileManager().getBufferForFile(File);
197204
if (!Buffer) {
@@ -208,8 +215,8 @@ class ErrorReporter {
208215
continue;
209216
}
210217
llvm::Expected<tooling::Replacements> Replacements =
211-
format::cleanupAroundReplacements(Code, FileAndReplacements.second,
212-
*Style);
218+
format::cleanupAroundReplacements(
219+
Code, FileAndReplacements.second.Replaces, *Style);
213220
if (!Replacements) {
214221
llvm::errs() << llvm::toString(Replacements.takeError()) << "\n";
215222
continue;
@@ -226,13 +233,18 @@ class ErrorReporter {
226233
if (!tooling::applyAllReplacements(Replacements.get(), Rewrite)) {
227234
llvm::errs() << "Can't apply replacements for file " << File << "\n";
228235
}
236+
AnyNotWritten &= Rewrite.overwriteChangedFiles();
229237
}
230-
if (Rewrite.overwriteChangedFiles()) {
238+
239+
if (AnyNotWritten) {
231240
llvm::errs() << "clang-tidy failed to apply suggested fixes.\n";
232241
} else {
233242
llvm::errs() << "clang-tidy applied " << AppliedFixes << " of "
234243
<< TotalFixes << " suggested fixes.\n";
235244
}
245+
246+
if (OriginalCWD)
247+
VFS.setCurrentWorkingDirectory(*OriginalCWD);
236248
}
237249
}
238250

@@ -289,13 +301,18 @@ class ErrorReporter {
289301
return CharSourceRange::getCharRange(BeginLoc, EndLoc);
290302
}
291303

304+
struct ReplacementsWithBuildDir {
305+
StringRef BuildDir;
306+
Replacements Replaces;
307+
};
308+
292309
FileManager Files;
293310
LangOptions LangOpts; // FIXME: use langopts from each original file
294311
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts;
295312
DiagnosticConsumer *DiagPrinter;
296313
DiagnosticsEngine Diags;
297314
SourceManager SourceMgr;
298-
llvm::StringMap<Replacements> FileReplacements;
315+
llvm::StringMap<ReplacementsWithBuildDir> FileReplacements;
299316
ClangTidyContext &Context;
300317
FixBehaviour ApplyFixes;
301318
unsigned TotalFixes = 0U;

clang-tools-extra/test/clang-tidy/infrastructure/Inputs/compilation-database/template.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@
2020
"file": "test_dir/b/c.cpp"
2121
},
2222
{
23-
"directory": "test_dir/b",
24-
"command": "clang++ -I../include -o test.o ../b/d.cpp",
23+
"directory": "test_dir/",
24+
"command": "clang++ -o test.o ./b/d.cpp",
2525
"file": "test_dir/b/d.cpp"
2626
},
27+
{
28+
"directory": "test_dir/b",
29+
"command": "clang++ -I../include -o test.o ../include.cpp",
30+
"file": "test_dir/include.cpp"
31+
},
2732
{
2833
"directory": "test_dir/",
2934
"command": "clang++ -o test.o test_dir/b/not-exist.cpp",

clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-run-with-database.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
// RUN: echo 'int *AB = 0;' > %T/compilation-database-test/a/b.cpp
66
// RUN: echo 'int *BB = 0;' > %T/compilation-database-test/b/b.cpp
77
// RUN: echo 'int *BC = 0;' > %T/compilation-database-test/b/c.cpp
8+
// RUN: echo 'int *BD = 0;' > %T/compilation-database-test/b/d.cpp
89
// RUN: echo 'int *HP = 0;' > %T/compilation-database-test/include/header.h
9-
// RUN: echo '#include "header.h"' > %T/compilation-database-test/b/d.cpp
10+
// RUN: echo '#include "header.h"' > %T/compilation-database-test/include.cpp
1011
// RUN: sed 's|test_dir|%/T/compilation-database-test|g' %S/Inputs/compilation-database/template.json > %T/compile_commands.json
1112

1213
// Regression test: shouldn't crash.
@@ -15,15 +16,17 @@
1516
// CHECK-NOT-EXIST: unable to handle compilation
1617
// CHECK-NOT-EXIST: Found compiler error
1718

18-
// RUN: clang-tidy --checks=-*,modernize-use-nullptr -p %T %T/compilation-database-test/a/a.cpp %T/compilation-database-test/a/b.cpp %T/compilation-database-test/b/b.cpp %T/compilation-database-test/b/c.cpp %T/compilation-database-test/b/d.cpp -header-filter=.* -fix
19+
// RUN: clang-tidy --checks=-*,modernize-use-nullptr -p %T %T/compilation-database-test/a/a.cpp %T/compilation-database-test/a/b.cpp %T/compilation-database-test/b/b.cpp %T/compilation-database-test/b/c.cpp %T/compilation-database-test/b/d.cpp %T/compilation-database-test/include.cpp -header-filter=.* -fix
1920
// RUN: FileCheck -input-file=%T/compilation-database-test/a/a.cpp %s -check-prefix=CHECK-FIX1
2021
// RUN: FileCheck -input-file=%T/compilation-database-test/a/b.cpp %s -check-prefix=CHECK-FIX2
2122
// RUN: FileCheck -input-file=%T/compilation-database-test/b/b.cpp %s -check-prefix=CHECK-FIX3
2223
// RUN: FileCheck -input-file=%T/compilation-database-test/b/c.cpp %s -check-prefix=CHECK-FIX4
23-
// RUN: FileCheck -input-file=%T/compilation-database-test/include/header.h %s -check-prefix=CHECK-FIX5
24+
// RUN: FileCheck -input-file=%T/compilation-database-test/b/d.cpp %s -check-prefix=CHECK-FIX5
25+
// RUN: FileCheck -input-file=%T/compilation-database-test/include/header.h %s -check-prefix=CHECK-FIX6
2426

2527
// CHECK-FIX1: int *AA = nullptr;
2628
// CHECK-FIX2: int *AB = nullptr;
2729
// CHECK-FIX3: int *BB = nullptr;
2830
// CHECK-FIX4: int *BC = nullptr;
29-
// CHECK-FIX5: int *HP = nullptr;
31+
// CHECK-FIX5: int *BD = nullptr;
32+
// CHECK-FIX6: int *HP = nullptr;

clang/docs/InternalsManual.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,8 @@ mode. Instead of formatting and printing out the diagnostics, this
477477
implementation just captures and remembers the diagnostics as they fly by.
478478
Then ``-verify`` compares the list of produced diagnostics to the list of
479479
expected ones. If they disagree, it prints out its own output. Full
480-
documentation for the ``-verify`` mode can be found in the Clang API
481-
documentation for `VerifyDiagnosticConsumer
482-
</doxygen/classclang_1_1VerifyDiagnosticConsumer.html#details>`_.
480+
documentation for the ``-verify`` mode can be found at
481+
:ref:`verifying-diagnostics`.
483482

484483
There are many other possible implementations of this interface, and this is
485484
why we prefer diagnostics to pass down rich structured information in
@@ -3314,6 +3313,8 @@ Testing
33143313
All functional changes to Clang should come with test coverage demonstrating
33153314
the change in behavior.
33163315

3316+
.. _verifying-diagnostics:
3317+
33173318
Verifying Diagnostics
33183319
^^^^^^^^^^^^^^^^^^^^^
33193320
Clang ``-cc1`` supports the ``-verify`` command line option as a way to
@@ -3375,7 +3376,7 @@ truncated text instead.)
33753376
Here's an example of the most commonly used way to specify expected
33763377
diagnostics:
33773378

3378-
.. code-block: c++
3379+
.. code-block:: c++
33793380

33803381
int A = B; // expected-error {{use of undeclared identifier 'B'}}
33813382

@@ -3385,7 +3386,7 @@ more readable, you can use slash-newline to separate out the diagnostics.
33853386
Alternatively, it is possible to specify the line on which the diagnostic
33863387
should appear by appending ``@<line>`` to ``expected-<type>``, for example:
33873388

3388-
.. code-block: c++
3389+
.. code-block:: c++
33893390

33903391
#warning some text
33913392
// expected-warning@10 {{some text}}
@@ -3398,7 +3399,7 @@ header file, it may be beneficial to be able to declare the file in which the
33983399
diagnostic will appear, rather than placing the ``expected-*`` directive in the
33993400
actual file itself. This can be done using the following syntax:
34003401

3401-
.. code-block: c++
3402+
.. code-block:: c++
34023403

34033404
// expected-error@path/include.h:15 {{error message}}
34043405

@@ -3413,7 +3414,7 @@ diagnostic can instead be indicated by a marker of the form ``#<marker>``.
34133414
Markers are specified by including them in a comment, and then referenced by
34143415
appending the marker to the diagnostic with ``@#<marker>``, as with:
34153416

3416-
.. code-block: c++
3417+
.. code-block:: c++
34173418

34183419
#warning some text // #1
34193420
// ... other code ...
@@ -3428,14 +3429,14 @@ syntax is ``expected-<type> <n> {{diag text}}``, where ``<type>`` is one of
34283429
integer. This allows the diagnostic to appear as many times as specified. For
34293430
example:
34303431

3431-
.. code-block: c++
3432+
.. code-block:: c++
34323433

34333434
void f(); // expected-note 2 {{previous declaration is here}}
34343435

34353436
Where the diagnostic is expected to occur a minimum number of times, this can
34363437
be specified by appending a ``+`` to the number. For example:
34373438

3438-
.. code-block: c++
3439+
.. code-block:: c++
34393440

34403441
void f(); // expected-note 0+ {{previous declaration is here}}
34413442
void g(); // expected-note 1+ {{previous declaration is here}}
@@ -3445,13 +3446,13 @@ swallowed if it occurs, but will not generate an error if it does not occur. In
34453446
the second example, the diagnostic must occur at least once. As a short-hand,
34463447
"one or more" can be specified simply by ``+``. For example:
34473448

3448-
.. code-block: c++
3449+
.. code-block:: c++
34493450

34503451
void g(); // expected-note + {{previous declaration is here}}
34513452

34523453
A range can also be specified by ``<n>-<m>``. For example:
34533454

3454-
.. code-block: c++
3455+
.. code-block:: c++
34553456

34563457
void f(); // expected-note 0-1 {{previous declaration is here}}
34573458

@@ -3460,13 +3461,13 @@ In this example, the diagnostic may appear only once, if at all.
34603461
Regex matching mode may be selected by appending ``-re`` to the diagnostic type
34613462
and including regexes wrapped in double curly braces in the directive, such as:
34623463

3463-
.. code-block: c++
3464+
.. code-block:: text
34643465
34653466
expected-error-re {{format specifies type 'wchar_t **' (aka '{{.+}}')}}
34663467
34673468
Examples matching error: "variable has incomplete type 'struct s'"
34683469

3469-
.. code-block: c++
3470+
.. code-block:: c++
34703471

34713472
// expected-error {{variable has incomplete type 'struct s'}}
34723473
// expected-error {{variable has incomplete type}}

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,9 @@ Bug Fixes in This Version
658658
Fixes (`#64467 <https://github.com/llvm/llvm-project/issues/64467>`_)
659659
- Clang's ``-Wchar-subscripts`` no longer warns on chars whose values are known non-negative constants.
660660
Fixes (`#18763 <https://github.com/llvm/llvm-project/issues/18763>`_)
661+
- Fixed false positive error emitted when templated alias inside a class
662+
used private members of the same class.
663+
Fixes (`#41693 <https://github.com/llvm/llvm-project/issues/41693>`_)
661664

662665
Bug Fixes to Compiler Builtins
663666
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/OpenACCKinds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ enum class OpenACCDirectiveKind {
3434

3535
// Misc.
3636
Loop,
37-
// FIXME: 'cache'
37+
Cache,
3838

3939
// Combined Constructs.
4040
ParallelLoop,

clang/include/clang/Basic/arm_sme.td

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,27 @@ let TargetGuard = "sme2" in {
321321
let TargetGuard = "sme2" in {
322322
def SVLDR_ZT : Inst<"svldr_zt", "viQ", "", MergeNone, "aarch64_sme_ldr_zt", [IsOverloadNone, IsStreamingCompatible, IsSharedZA], [ImmCheck<0, ImmCheck0_0>]>;
323323
def SVSTR_ZT : Inst<"svstr_zt", "vi%", "", MergeNone, "aarch64_sme_str_zt", [IsOverloadNone, IsStreamingCompatible, IsSharedZA, IsPreservesZA], [ImmCheck<0, ImmCheck0_0>]>;
324+
}
324325

325326
//
326327
// Zero ZT0
327328
//
329+
let TargetGuard = "sme2" in {
328330
def SVZERO_ZT : Inst<"svzero_zt", "vi", "", MergeNone, "aarch64_sme_zero_zt", [IsOverloadNone, IsStreamingCompatible, IsSharedZA], [ImmCheck<0, ImmCheck0_0>]>;
329331
}
332+
333+
//
334+
// lookup table expand four contiguous registers
335+
//
336+
let TargetGuard = "sme2" in {
337+
def SVLUTI2_LANE_ZT_X4 : Inst<"svluti2_lane_zt_{d}_x4", "4.di[i", "cUcsUsiUibhf", MergeNone, "aarch64_sme_luti2_lane_zt_x4", [IsStreaming, IsSharedZA, IsPreservesZA], [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_3>]>;
338+
def SVLUTI4_LANE_ZT_X4 : Inst<"svluti4_lane_zt_{d}_x4", "4.di[i", "sUsiUibhf", MergeNone, "aarch64_sme_luti4_lane_zt_x4", [IsStreaming, IsSharedZA, IsPreservesZA], [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_1>]>;
339+
}
340+
341+
//
342+
// lookup table expand two contiguous registers
343+
//
344+
let TargetGuard = "sme2" in {
345+
def SVLUTI2_LANE_ZT_X2 : Inst<"svluti2_lane_zt_{d}_x2", "2.di[i", "cUcsUsiUibhf", MergeNone, "aarch64_sme_luti2_lane_zt_x2", [IsStreaming, IsSharedZA, IsPreservesZA], [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_7>]>;
346+
def SVLUTI4_LANE_ZT_X2 : Inst<"svluti4_lane_zt_{d}_x2", "2.di[i", "cUcsUsiUibhf", MergeNone, "aarch64_sme_luti4_lane_zt_x2", [IsStreaming, IsSharedZA, IsPreservesZA], [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_3>]>;
347+
}

clang/include/clang/Basic/arm_sve_sme_incl.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
// m: uint32_t
9494
// n: uint64_t
9595

96+
// [: svuint8_t
9697
// t: svint32_t
9798
// z: svuint32_t
9899
// g: svuint64_t

clang/include/clang/Parse/Parser.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3539,7 +3539,12 @@ class Parser : public CodeCompletionHandler {
35393539

35403540
private:
35413541
void ParseOpenACCDirective();
3542-
ExprResult ParseOpenACCRoutineName();
3542+
/// Helper that parses an ID Expression based on the language options.
3543+
ExprResult ParseOpenACCIDExpression();
3544+
/// Parses the variable list for the `cache` construct.
3545+
void ParseOpenACCCacheVarList();
3546+
/// Parses a single variable in a variable list for the 'cache' construct.
3547+
bool ParseOpenACCCacheVar();
35433548

35443549
private:
35453550
//===--------------------------------------------------------------------===//

0 commit comments

Comments
 (0)