Skip to content

Commit 19fc25c

Browse files
committed
Merge from 'main' to 'sycl-web' (96 commits)
CONFLICT (content): Merge conflict in llvm/test/CodeGen/NVPTX/param-load-store.ll
2 parents a8f3c46 + 0f1b5f1 commit 19fc25c

File tree

402 files changed

+7149
-3081
lines changed

Some content is hidden

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

402 files changed

+7149
-3081
lines changed

clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ def main():
160160
'command line.')
161161
parser.add_argument('-quiet', action='store_true', default=False,
162162
help='Run clang-tidy in quiet mode')
163+
parser.add_argument('-load', dest='plugins',
164+
action='append', default=[],
165+
help='Load the specified plugin in clang-tidy.')
166+
163167
clang_tidy_args = []
164168
argv = sys.argv[1:]
165169
if '--' in argv:
@@ -233,6 +237,8 @@ def main():
233237
common_clang_tidy_args.append('-extra-arg=%s' % arg)
234238
for arg in args.extra_arg_before:
235239
common_clang_tidy_args.append('-extra-arg-before=%s' % arg)
240+
for plugin in args.plugins:
241+
common_clang_tidy_args.append('-load=%s' % plugin)
236242

237243
for name in lines_by_file:
238244
line_filter_json = json.dumps(

clang-tools-extra/clang-tidy/tool/run-clang-tidy.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def make_absolute(f, directory):
9292
def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
9393
header_filter, allow_enabling_alpha_checkers,
9494
extra_arg, extra_arg_before, quiet, config_file_path,
95-
config, line_filter, use_color):
95+
config, line_filter, use_color, plugins):
9696
"""Gets a command line for clang-tidy."""
9797
start = [clang_tidy_binary]
9898
if allow_enabling_alpha_checkers:
@@ -126,6 +126,8 @@ def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
126126
start.append('--config-file=' + config_file_path)
127127
elif config:
128128
start.append('-config=' + config)
129+
for plugin in plugins:
130+
start.append('-load=' + plugin)
129131
start.append(f)
130132
return start
131133

@@ -196,7 +198,8 @@ def run_tidy(args, clang_tidy_binary, tmpdir, build_path, queue, lock,
196198
args.allow_enabling_alpha_checkers,
197199
args.extra_arg, args.extra_arg_before,
198200
args.quiet, args.config_file, args.config,
199-
args.line_filter, args.use_color)
201+
args.line_filter, args.use_color,
202+
args.plugins)
200203

201204
proc = subprocess.Popen(invocation, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
202205
output, err = proc.communicate()
@@ -280,6 +283,9 @@ def main():
280283
'command line.')
281284
parser.add_argument('-quiet', action='store_true',
282285
help='Run clang-tidy in quiet mode')
286+
parser.add_argument('-load', dest='plugins',
287+
action='append', default=[],
288+
help='Load the specified plugin in clang-tidy.')
283289
args = parser.parse_args()
284290

285291
db_path = 'compile_commands.json'
@@ -306,7 +312,8 @@ def main():
306312
args.allow_enabling_alpha_checkers,
307313
args.extra_arg, args.extra_arg_before,
308314
args.quiet, args.config_file, args.config,
309-
args.line_filter, args.use_color)
315+
args.line_filter, args.use_color,
316+
args.plugins)
310317
invocation.append('-list-checks')
311318
invocation.append('-')
312319
if args.quiet:

clang-tools-extra/clangd/Selection.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "AST.h"
1111
#include "support/Logger.h"
1212
#include "support/Trace.h"
13+
#include "clang/AST/ASTConcept.h"
1314
#include "clang/AST/ASTTypeTraits.h"
1415
#include "clang/AST/Decl.h"
1516
#include "clang/AST/DeclCXX.h"
@@ -709,6 +710,15 @@ class SelectionVisitor : public RecursiveASTVisitor<SelectionVisitor> {
709710
bool TraversePseudoObjectExpr(PseudoObjectExpr *E) {
710711
return traverseNode(E, [&] { return TraverseStmt(E->getSyntacticForm()); });
711712
}
713+
bool TraverseTypeConstraint(const TypeConstraint *C) {
714+
if (auto *E = C->getImmediatelyDeclaredConstraint()) {
715+
// Technically this expression is 'implicit' and not traversed by the RAV.
716+
// However, the range is correct, so we visit expression to avoid adding
717+
// an extra kind to 'DynTypeNode' that hold 'TypeConstraint'.
718+
return TraverseStmt(E);
719+
}
720+
return Base::TraverseTypeConstraint(C);
721+
}
712722

713723
private:
714724
using Base = RecursiveASTVisitor<SelectionVisitor>;

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,6 +2085,19 @@ TEST(FindReferences, ConceptsWithinAST) {
20852085
checkFindRefs(Code);
20862086
}
20872087

2088+
TEST(FindReferences, ConceptReq) {
2089+
constexpr llvm::StringLiteral Code = R"cpp(
2090+
template <class T>
2091+
concept $def[[IsSmal^l]] = sizeof(T) <= 8;
2092+
2093+
template <class T>
2094+
concept IsSmallPtr = requires(T x) {
2095+
{ *x } -> [[IsSmal^l]];
2096+
};
2097+
)cpp";
2098+
checkFindRefs(Code);
2099+
}
2100+
20882101
TEST(FindReferences, RequiresExprParameters) {
20892102
constexpr llvm::StringLiteral Code = R"cpp(
20902103
template <class T>

clang-tools-extra/test/.gitattributes

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
# rely on or check fixed character -offset, Offset: or FileOffset: locations
33
# will fail when run on input files checked out with different line endings.
44

5-
# Most test input files should use native line endings, to ensure that we run
6-
# tests against both line ending types.
7-
* text=auto
8-
95
# These test input files rely on one-byte Unix (LF) line-endings, as they use
106
# fixed -offset, FileOffset:, or Offset: numbers in their tests.
117
clang-apply-replacements/ClangRenameClassReplacements.cpp text eol=lf
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
2-
// This file intentionally uses a CRLF newlines!
3-
4-
void foo() {
5-
int *x = 0;
6-
}
1+
2+
// This file intentionally uses a CRLF newlines!
3+
4+
void foo() {
5+
int *x = 0;
6+
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
2-
// This file intentionally uses a CRLF newlines!
3-
4-
void foo() {
5-
int *x = nullptr;
6-
}
1+
2+
// This file intentionally uses a CRLF newlines!
3+
4+
void foo() {
5+
int *x = nullptr;
6+
}

clang/cmake/caches/3-stage-base.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")
22
set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
3-
set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "")
3+
4+
set(LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "")
5+
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "")
46

57
if(APPLE)
68
# Use LLD to have fewer requirements on system linker, unless we're on an apple

clang/cmake/caches/PGO-stage2.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")
2-
set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "")
2+
set(LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "")
3+
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "")

clang/cmake/caches/PGO.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")
22
set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
3-
set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "")
43

5-
set(LLVM_TARGETS_TO_BUILD X86 CACHE STRING "")
4+
set(LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "")
5+
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "")
6+
7+
set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
68
set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "")
79
set(CLANG_BOOTSTRAP_TARGETS
810
generate-profdata

0 commit comments

Comments
 (0)