Skip to content

Commit 07c5d81

Browse files
author
aidan.belton
committed
Merge upstream commits
2 parents ff947d1 + a6447ca commit 07c5d81

File tree

6,676 files changed

+480777
-126823
lines changed

Some content is hidden

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

6,676 files changed

+480777
-126823
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
clang/ @premanandrao @elizabethandrews @AaronBallman
55

66
# Driver
7-
clang/**/Driver @mdtoguchi @AGindinson
7+
clang/**/Driver @mdtoguchi @AGindinson @hchilama
88

99
# LLVM-SPIRV translator
1010
llvm-spirv/ @AlexeySotkin @AlexeySachkov

.github/workflows/gh_pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install deps
1717
run: |
1818
sudo apt-get install -y doxygen graphviz ssh ninja-build
19-
sudo pip3 install 'sphinx==3.0.0' 'recommonmark==0.6.0' 'sphinx_markdown_tables==0.0.12'
19+
sudo pip3 install 'sphinx==4.1.2' 'myst-parser==0.15.1'
2020
- name: Build Docs
2121
run: |
2222
mkdir -p $GITHUB_WORKSPACE/build

buildbot/configure.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def do_configure(args):
2727
llvm_targets_to_build = 'X86'
2828
llvm_enable_projects = 'clang;' + llvm_external_projects
2929
libclc_targets_to_build = ''
30+
libclc_gen_remangled_variants = 'OFF'
3031
sycl_build_pi_cuda = 'OFF'
3132
sycl_build_pi_esimd_cpu = 'ON'
3233
sycl_build_pi_rocm = 'OFF'
@@ -53,6 +54,7 @@ def do_configure(args):
5354
if args.cuda:
5455
llvm_targets_to_build += ';NVPTX'
5556
libclc_targets_to_build = 'nvptx64--;nvptx64--nvidiacl'
57+
libclc_gen_remangled_variants = 'ON'
5658
sycl_build_pi_cuda = 'ON'
5759

5860
if args.rocm:
@@ -62,6 +64,7 @@ def do_configure(args):
6264
elif args.rocm_platform == 'NVIDIA' and not args.cuda:
6365
llvm_targets_to_build += ';NVPTX'
6466
libclc_targets_to_build += ';nvptx64--;nvptx64--nvidiacl'
67+
libclc_gen_remangled_variants = 'ON'
6568

6669
sycl_build_pi_rocm_platform = args.rocm_platform
6770
sycl_build_pi_rocm = 'ON'
@@ -99,6 +102,7 @@ def do_configure(args):
99102
"-DLLVM_EXTERNAL_LIBDEVICE_SOURCE_DIR={}".format(libdevice_dir),
100103
"-DLLVM_ENABLE_PROJECTS={}".format(llvm_enable_projects),
101104
"-DLIBCLC_TARGETS_TO_BUILD={}".format(libclc_targets_to_build),
105+
"-DLIBCLC_GENERATE_REMANGLED_VARIANTS={}".format(libclc_gen_remangled_variants),
102106
"-DSYCL_BUILD_PI_CUDA={}".format(sycl_build_pi_cuda),
103107
"-DSYCL_BUILD_PI_ROCM={}".format(sycl_build_pi_rocm),
104108
"-DSYCL_BUILD_PI_ROCM_PLATFORM={}".format(sycl_build_pi_rocm_platform),

buildbot/dependency.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ ocl_cpu_rt_ver_win=2021.12.6.0.19
77
# https://github.com/intel/compute-runtime/releases/tag/21.26.20194
88
ocl_gpu_rt_ver=21.26.20194
99
# Same GPU driver supports Level Zero and OpenCL
10+
# https://downloadmirror.intel.com/30579/a08/igfx_win_100.9684.zip
1011
# https://downloadmirror.intel.com/30381/a08/igfx_win10_100.9466.zip
11-
ocl_gpu_rt_ver_win=27.20.100.9466
12+
ocl_gpu_rt_ver_win=30.0.100.9684
1213
intel_sycl_ver=build
1314

1415
# TBB binaries can be built from sources following instructions under
@@ -31,7 +32,7 @@ ocloc_ver_win=27.20.100.9168
3132
cpu_driver_lin=2021.12.6.0.19
3233
cpu_driver_win=2021.12.6.0.19
3334
gpu_driver_lin=21.26.20194
34-
gpu_driver_win=27.20.100.9466
35+
gpu_driver_win=30.0.100.9684
3536
fpga_driver_lin=2021.12.6.0.19
3637
fpga_driver_win=2021.12.6.0.19
3738
# NVidia CUDA driver

clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ void ChangeNamespaceTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
442442
hasDeclaration(DeclMatcher),
443443
unless(templateSpecializationType()))))),
444444
hasParent(nestedNameSpecifierLoc()),
445-
hasAncestor(isImplicit()),
445+
hasAncestor(decl(isImplicit())),
446446
hasAncestor(UsingShadowDeclInClass),
447447
hasAncestor(functionDecl(isDefaulted())))),
448448
hasAncestor(decl().bind("dc")))
@@ -466,7 +466,7 @@ void ChangeNamespaceTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
466466
hasAncestor(decl(IsInMovedNs).bind("dc")),
467467
loc(nestedNameSpecifier(
468468
specifiesType(hasDeclaration(DeclMatcher.bind("from_decl"))))),
469-
unless(anyOf(hasAncestor(isImplicit()),
469+
unless(anyOf(hasAncestor(decl(isImplicit())),
470470
hasAncestor(UsingShadowDeclInClass),
471471
hasAncestor(functionDecl(isDefaulted())),
472472
hasAncestor(typeLoc(loc(qualType(hasDeclaration(
@@ -495,7 +495,7 @@ void ChangeNamespaceTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
495495
hasAncestor(cxxRecordDecl()))),
496496
hasParent(namespaceDecl()));
497497
Finder->addMatcher(expr(hasAncestor(decl().bind("dc")), IsInMovedNs,
498-
unless(hasAncestor(isImplicit())),
498+
unless(hasAncestor(decl(isImplicit()))),
499499
anyOf(callExpr(callee(FuncMatcher)).bind("call"),
500500
declRefExpr(to(FuncMatcher.bind("func_decl")))
501501
.bind("func_ref"))),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ DiagnosticBuilder ClangTidyCheck::diag(StringRef Message,
3434

3535
DiagnosticBuilder
3636
ClangTidyCheck::configurationDiag(StringRef Description,
37-
DiagnosticIDs::Level Level) {
37+
DiagnosticIDs::Level Level) const {
3838
return Context->configurationDiag(Description, Level);
3939
}
4040

clang-tools-extra/clang-tidy/ClangTidyCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback {
123123
/// Adds a diagnostic to report errors in the check's configuration.
124124
DiagnosticBuilder
125125
configurationDiag(StringRef Description,
126-
DiagnosticIDs::Level Level = DiagnosticIDs::Warning);
126+
DiagnosticIDs::Level Level = DiagnosticIDs::Warning) const;
127127

128128
/// Should store all options supported by this check with their
129129
/// current values or default values for options that haven't been overridden.

clang-tools-extra/clang-tidy/add_new_check.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,21 @@
1111
from __future__ import print_function
1212

1313
import argparse
14+
import io
1415
import os
1516
import re
1617
import sys
1718

18-
1919
# Adapts the module's CMakelist file. Returns 'True' if it could add a new
2020
# entry and 'False' if the entry already existed.
2121
def adapt_cmake(module_path, check_name_camel):
2222
filename = os.path.join(module_path, 'CMakeLists.txt')
23-
with open(filename, 'r') as f:
23+
24+
# The documentation files are encoded using UTF-8, however on Windows the
25+
# default encoding might be different (e.g. CP-1252). To make sure UTF-8 is
26+
# always used, use `io.open(filename, mode, encoding='utf8')` for reading and
27+
# writing files here and elsewhere.
28+
with io.open(filename, 'r', encoding='utf8') as f:
2429
lines = f.readlines()
2530

2631
cpp_file = check_name_camel + '.cpp'
@@ -31,7 +36,7 @@ def adapt_cmake(module_path, check_name_camel):
3136
return False
3237

3338
print('Updating %s...' % filename)
34-
with open(filename, 'w') as f:
39+
with io.open(filename, 'w', encoding='utf8') as f:
3540
cpp_found = False
3641
file_added = False
3742
for line in lines:
@@ -51,7 +56,7 @@ def write_header(module_path, module, namespace, check_name, check_name_camel):
5156
check_name_dashes = module + '-' + check_name
5257
filename = os.path.join(module_path, check_name_camel) + '.h'
5358
print('Creating %s...' % filename)
54-
with open(filename, 'w') as f:
59+
with io.open(filename, 'w', encoding='utf8') as f:
5560
header_guard = ('LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_' + module.upper() + '_'
5661
+ check_name_camel.upper() + '_H')
5762
f.write('//===--- ')
@@ -104,7 +109,7 @@ class %(check_name)s : public ClangTidyCheck {
104109
def write_implementation(module_path, module, namespace, check_name_camel):
105110
filename = os.path.join(module_path, check_name_camel) + '.cpp'
106111
print('Creating %s...' % filename)
107-
with open(filename, 'w') as f:
112+
with io.open(filename, 'w', encoding='utf8') as f:
108113
f.write('//===--- ')
109114
f.write(os.path.basename(filename))
110115
f.write(' - clang-tidy ')
@@ -158,11 +163,11 @@ def adapt_module(module_path, module, check_name, check_name_camel):
158163
lambda p: p.lower() == module.lower() + 'tidymodule.cpp',
159164
os.listdir(module_path)))[0]
160165
filename = os.path.join(module_path, modulecpp)
161-
with open(filename, 'r') as f:
166+
with io.open(filename, 'r', encoding='utf8') as f:
162167
lines = f.readlines()
163168

164169
print('Updating %s...' % filename)
165-
with open(filename, 'w') as f:
170+
with io.open(filename, 'w', encoding='utf8') as f:
166171
header_added = False
167172
header_found = False
168173
check_added = False
@@ -217,15 +222,15 @@ def add_release_notes(module_path, module, check_name):
217222
check_name_dashes = module + '-' + check_name
218223
filename = os.path.normpath(os.path.join(module_path,
219224
'../../docs/ReleaseNotes.rst'))
220-
with open(filename, 'r') as f:
225+
with io.open(filename, 'r', encoding='utf8') as f:
221226
lines = f.readlines()
222227

223228
lineMatcher = re.compile('New checks')
224229
nextSectionMatcher = re.compile('New check aliases')
225230
checkMatcher = re.compile('- New :doc:`(.*)')
226231

227232
print('Updating %s...' % filename)
228-
with open(filename, 'w') as f:
233+
with io.open(filename, 'w', encoding='utf8') as f:
229234
note_added = False
230235
header_found = False
231236
add_note_here = False
@@ -271,7 +276,7 @@ def write_test(module_path, module, check_name, test_extension):
271276
filename = os.path.normpath(os.path.join(module_path, '../../test/clang-tidy/checkers',
272277
check_name_dashes + '.' + test_extension))
273278
print('Creating %s...' % filename)
274-
with open(filename, 'w') as f:
279+
with io.open(filename, 'w', encoding='utf8') as f:
275280
f.write("""// RUN: %%check_clang_tidy %%s %(check_name_dashes)s %%t
276281
277282
// FIXME: Add something that triggers the check here.
@@ -307,7 +312,7 @@ def update_checks_list(clang_tidy_path):
307312
docs_dir = os.path.join(clang_tidy_path, '../docs/clang-tidy/checks')
308313
filename = os.path.normpath(os.path.join(docs_dir, 'list.rst'))
309314
# Read the content of the current list.rst file
310-
with open(filename, 'r') as f:
315+
with io.open(filename, 'r', encoding='utf8') as f:
311316
lines = f.readlines()
312317
# Get all existing docs
313318
doc_files = list(filter(lambda s: s.endswith('.rst') and s != 'list.rst',
@@ -323,7 +328,7 @@ def has_auto_fix(check_name):
323328
if not os.path.isfile(checkerCode):
324329
return ""
325330

326-
with open(checkerCode) as f:
331+
with io.open(checkerCode, encoding='utf8') as f:
327332
code = f.read()
328333
if 'FixItHint' in code or "ReplacementText" in code or "fixit" in code:
329334
# Some simple heuristics to figure out if a checker has an autofix or not.
@@ -333,7 +338,7 @@ def has_auto_fix(check_name):
333338
def process_doc(doc_file):
334339
check_name = doc_file.replace('.rst', '')
335340

336-
with open(os.path.join(docs_dir, doc_file), 'r') as doc:
341+
with io.open(os.path.join(docs_dir, doc_file), 'r', encoding='utf8') as doc:
337342
content = doc.read()
338343
match = re.search('.*:orphan:.*', content)
339344

@@ -376,7 +381,7 @@ def format_link_alias(doc_file):
376381
checks_alias = map(format_link_alias, doc_files)
377382

378383
print('Updating %s...' % filename)
379-
with open(filename, 'w') as f:
384+
with io.open(filename, 'w', encoding='utf8') as f:
380385
for line in lines:
381386
f.write(line)
382387
if line.strip() == ".. csv-table::":
@@ -397,7 +402,7 @@ def write_docs(module_path, module, check_name):
397402
filename = os.path.normpath(os.path.join(
398403
module_path, '../../docs/clang-tidy/checks/', check_name_dashes + '.rst'))
399404
print('Creating %s...' % filename)
400-
with open(filename, 'w') as f:
405+
with io.open(filename, 'w', encoding='utf8') as f:
401406
f.write(""".. title:: clang-tidy - %(check_name_dashes)s
402407
403408
%(check_name_dashes)s

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ namespace clang {
2020
namespace tidy {
2121
namespace bugprone {
2222
namespace {
23-
AST_MATCHER(Decl, isFromStdNamespace) {
23+
AST_MATCHER(Decl, isFromStdNamespaceOrSystemHeader) {
2424
if (const auto *D = Node.getDeclContext()->getEnclosingNamespaceContext())
25-
return D->isStdNamespace();
26-
return false;
25+
if (D->isStdNamespace())
26+
return true;
27+
return Node.getASTContext().getSourceManager().isInSystemHeader(
28+
Node.getLocation());
2729
}
2830
} // namespace
2931

@@ -66,13 +68,13 @@ void ArgumentCommentCheck::registerMatchers(MatchFinder *Finder) {
6668
// not specified by the standard, and standard library
6769
// implementations in practice have to use reserved names to
6870
// avoid conflicts with same-named macros.
69-
unless(hasDeclaration(isFromStdNamespace())))
70-
.bind("expr"),
71-
this);
72-
Finder->addMatcher(
73-
cxxConstructExpr(unless(hasDeclaration(isFromStdNamespace())))
71+
unless(hasDeclaration(isFromStdNamespaceOrSystemHeader())))
7472
.bind("expr"),
7573
this);
74+
Finder->addMatcher(cxxConstructExpr(unless(hasDeclaration(
75+
isFromStdNamespaceOrSystemHeader())))
76+
.bind("expr"),
77+
this);
7678
}
7779

7880
static std::vector<std::pair<SourceLocation, StringRef>>

0 commit comments

Comments
 (0)