Skip to content

Commit 65a3fcc

Browse files
Merge branch 'sycl' into std-ns-diag
2 parents 643bc94 + 3e11f37 commit 65a3fcc

File tree

1,519 files changed

+56819
-27312
lines changed

Some content is hidden

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

1,519 files changed

+56819
-27312
lines changed

buildbot/configure.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ def do_configure(args):
3232

3333
icd_loader_lib = os.path.join(icd_loader_lib, "libOpenCL.so" if platform.system() == 'Linux' else "OpenCL.lib")
3434

35+
# replace not append, so ARM ^ X86
36+
if args.arm:
37+
llvm_targets_to_build = 'ARM;AArch64'
38+
3539
if args.cuda:
3640
llvm_targets_to_build += ';NVPTX'
3741
llvm_enable_projects += ';libclc'
3842
libclc_targets_to_build = 'nvptx64--;nvptx64--nvidiacl'
3943
sycl_build_pi_cuda = 'ON'
4044

41-
# replace not append, so ARM ^ X86
42-
if args.arm:
43-
llvm_targets_to_build = 'ARM;AArch64'
44-
4545
if args.no_werror:
4646
sycl_werror = 'OFF'
4747

buildbot/dependency.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ ocl_cpu_rt_ver=2020.11.10.0.05
44
# https://github.com/intel/llvm/releases/download/2020-WW41/win-oclcpuexp-2020.11.10.0.05_rel.zip
55
ocl_cpu_rt_ver_win=2020.11.10.0.05
66
# Same GPU driver supports Level Zero and OpenCL:
7-
# https://github.com/intel/compute-runtime/releases/tag/20.40.18075
8-
ocl_gpu_rt_ver=20.40.18075
7+
# https://github.com/intel/compute-runtime/releases/tag/20.41.18123
8+
ocl_gpu_rt_ver=20.41.18123
99
# Same GPU driver supports Level Zero and OpenCL:
1010
# https://downloadmirror.intel.com/29879/a08/igfx_win10_100.8778.zip
1111
ocl_gpu_rt_ver_win=27.20.100.8778
@@ -24,7 +24,7 @@ fpga_ver_win=20200913_000017
2424
[DRIVER VERSIONS]
2525
cpu_driver_lin=2020.11.10.0.05
2626
cpu_driver_win=2020.11.10.0.05
27-
gpu_driver_lin=20.40.18075
27+
gpu_driver_lin=20.41.18123
2828
gpu_driver_win=27.20.100.8778
2929
fpga_driver_lin=2020.11.10.0.05
3030
fpga_driver_win=2020.11.10.0.05

clang-tools-extra/clang-tidy/google/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ add_clang_library(clangTidyGoogleModule
1616
GlobalVariableDeclarationCheck.cpp
1717
GoogleTidyModule.cpp
1818
IntegerTypesCheck.cpp
19-
NonConstReferences.cpp
2019
OverloadedUnaryAndCheck.cpp
2120
TodoCommentCheck.cpp
2221
UnnamedNamespaceInHeaderCheck.cpp

clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "GlobalNamesInHeadersCheck.h"
2424
#include "GlobalVariableDeclarationCheck.h"
2525
#include "IntegerTypesCheck.h"
26-
#include "NonConstReferences.h"
2726
#include "OverloadedUnaryAndCheck.h"
2827
#include "TodoCommentCheck.h"
2928
#include "UnnamedNamespaceInHeaderCheck.h"
@@ -63,8 +62,6 @@ class GoogleModule : public ClangTidyModule {
6362
"google-runtime-int");
6463
CheckFactories.registerCheck<runtime::OverloadedUnaryAndCheck>(
6564
"google-runtime-operator");
66-
CheckFactories.registerCheck<runtime::NonConstReferences>(
67-
"google-runtime-references");
6865
CheckFactories
6966
.registerCheck<readability::AvoidUnderscoreInGoogletestNameCheck>(
7067
"google-readability-avoid-underscore-in-googletest-name");

clang-tools-extra/clang-tidy/google/NonConstReferences.cpp

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

clang-tools-extra/clang-tidy/google/NonConstReferences.h

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

clang-tools-extra/clangd/ClangdLSPServer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,8 @@ void ClangdLSPServer::onWorkspaceSymbol(
794794
void ClangdLSPServer::onPrepareRename(const TextDocumentPositionParams &Params,
795795
Callback<llvm::Optional<Range>> Reply) {
796796
Server->prepareRename(
797-
Params.textDocument.uri.file(), Params.position, Opts.Rename,
797+
Params.textDocument.uri.file(), Params.position, /*NewName*/ llvm::None,
798+
Opts.Rename,
798799
[Reply = std::move(Reply)](llvm::Expected<RenameResult> Result) mutable {
799800
if (!Result)
800801
return Reply(Result.takeError());

clang-tools-extra/clangd/ClangdServer.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,11 @@ void ClangdServer::formatOnType(PathRef File, llvm::StringRef Code,
399399
}
400400

401401
void ClangdServer::prepareRename(PathRef File, Position Pos,
402+
llvm::Optional<std::string> NewName,
402403
const RenameOptions &RenameOpts,
403404
Callback<RenameResult> CB) {
404-
auto Action = [Pos, File = File.str(), CB = std::move(CB), RenameOpts,
405+
auto Action = [Pos, File = File.str(), CB = std::move(CB),
406+
NewName = std::move(NewName), RenameOpts,
405407
this](llvm::Expected<InputsAndAST> InpAST) mutable {
406408
if (!InpAST)
407409
return CB(InpAST.takeError());
@@ -412,9 +414,9 @@ void ClangdServer::prepareRename(PathRef File, Position Pos,
412414
// - for cross-file rename, we deliberately pass a nullptr index to save
413415
// the cost, thus the result may be incomplete as it only contains
414416
// main-file occurrences;
415-
auto Results = clangd::rename({Pos, /*NewName*/ "", InpAST->AST, File,
416-
RenameOpts.AllowCrossFile ? nullptr : Index,
417-
RenameOpts});
417+
auto Results = clangd::rename(
418+
{Pos, NewName.getValueOr("__clangd_rename_dummy"), InpAST->AST, File,
419+
RenameOpts.AllowCrossFile ? nullptr : Index, RenameOpts});
418420
if (!Results) {
419421
// LSP says to return null on failure, but that will result in a generic
420422
// failure message. If we send an LSP error response, clients can surface

clang-tools-extra/clangd/ClangdServer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ class ClangdServer {
274274

275275
/// Test the validity of a rename operation.
276276
///
277-
/// The returned result describes edits in the main-file only (all
278-
/// occurrences of the renamed symbol are simply deleted.
277+
/// If NewName is provided, it performs a name validation.
279278
void prepareRename(PathRef File, Position Pos,
279+
llvm::Optional<std::string> NewName,
280280
const RenameOptions &RenameOpts,
281281
Callback<RenameResult> CB);
282282

clang-tools-extra/clangd/FindSymbols.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,13 @@ getWorkspaceSymbols(llvm::StringRef Query, int Limit,
9696
return;
9797
}
9898

99-
SymbolKind SK = indexSymbolKindToSymbolKind(Sym.SymInfo.Kind);
100-
std::string Scope = std::string(Sym.Scope);
101-
llvm::StringRef ScopeRef = Scope;
102-
ScopeRef.consume_back("::");
103-
SymbolInformation Info = {(Sym.Name + Sym.TemplateSpecializationArgs).str(),
104-
SK, *Loc, std::string(ScopeRef)};
99+
llvm::StringRef Scope = Sym.Scope;
100+
Scope.consume_back("::");
101+
SymbolInformation Info;
102+
Info.name = (Sym.Name + Sym.TemplateSpecializationArgs).str();
103+
Info.kind = indexSymbolKindToSymbolKind(Sym.SymInfo.Kind);
104+
Info.location = *Loc;
105+
Info.containerName = Scope.str();
105106

106107
SymbolQualitySignals Quality;
107108
Quality.merge(Sym);
@@ -121,6 +122,8 @@ getWorkspaceSymbols(llvm::StringRef Query, int Limit,
121122
dlog("FindSymbols: {0}{1} = {2}\n{3}{4}\n", Sym.Scope, Sym.Name, Score,
122123
Quality, Relevance);
123124

125+
// Exposed score excludes fuzzy-match component, for client-side re-ranking.
126+
Info.score = Score / Relevance.NameMatch;
124127
Top.push({Score, std::move(Info)});
125128
});
126129
for (auto &R : std::move(Top).items())

clang-tools-extra/clangd/FindTarget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,9 @@ struct TargetFinder {
342342
add(TND->getUnderlyingType(), Flags | Rel::Underlying);
343343
Flags |= Rel::Alias; // continue with the alias.
344344
} else if (const UsingDecl *UD = dyn_cast<UsingDecl>(D)) {
345+
// no Underlying as this is a non-renaming alias.
345346
for (const UsingShadowDecl *S : UD->shadows())
346-
add(S->getUnderlyingDecl(), Flags | Rel::Underlying);
347+
add(S->getUnderlyingDecl(), Flags);
347348
Flags |= Rel::Alias; // continue with the alias.
348349
} else if (const auto *NAD = dyn_cast<NamespaceAliasDecl>(D)) {
349350
add(NAD->getUnderlyingDecl(), Flags | Rel::Underlying);
@@ -354,7 +355,7 @@ struct TargetFinder {
354355
UUVD->getQualifier()->getAsType(),
355356
[UUVD](ASTContext &) { return UUVD->getNameInfo().getName(); },
356357
ValueFilter)) {
357-
add(Target, Flags | Rel::Underlying);
358+
add(Target, Flags); // no Underlying as this is a non-renaming alias
358359
}
359360
Flags |= Rel::Alias; // continue with the alias
360361
} else if (const UsingShadowDecl *USD = dyn_cast<UsingShadowDecl>(D)) {
@@ -364,7 +365,6 @@ struct TargetFinder {
364365
// Shadow decls are synthetic and not themselves interesting.
365366
// Record the underlying decl instead, if allowed.
366367
D = USD->getTargetDecl();
367-
Flags |= Rel::Underlying; // continue with the underlying decl.
368368
} else if (const auto *DG = dyn_cast<CXXDeductionGuideDecl>(D)) {
369369
D = DG->getDeducedTemplate();
370370
} else if (const ObjCImplementationDecl *IID =

clang-tools-extra/clangd/FindTarget.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,20 @@ enum class DeclRelation : unsigned {
102102
TemplatePattern,
103103

104104
// Alias options apply when the declaration is an alias.
105-
// e.g. namespace clang { [[StringRef]] S; }
105+
// e.g. namespace client { [[X]] x; }
106106

107107
/// This declaration is an alias that was referred to.
108-
/// e.g. using llvm::StringRef (the UsingDecl directly referenced).
108+
/// e.g. using ns::X (the UsingDecl directly referenced),
109+
/// using Z = ns::Y (the TypeAliasDecl directly referenced)
109110
Alias,
110-
/// This is the underlying declaration for an alias, decltype etc.
111-
/// e.g. class llvm::StringRef (the underlying declaration referenced).
111+
/// This is the underlying declaration for a renaming-alias, decltype etc.
112+
/// e.g. class ns::Y (the underlying declaration referenced).
113+
///
114+
/// Note that we don't treat `using ns::X` as a first-class declaration like
115+
/// `using Z = ns::Y`. Therefore reference to X that goes through this
116+
/// using-decl is considered a direct reference (without the Underlying bit).
117+
/// Nevertheless, we report `using ns::X` as an Alias, so that some features
118+
/// like go-to-definition can still target it.
112119
Underlying,
113120
};
114121
llvm::raw_ostream &operator<<(llvm::raw_ostream &, DeclRelation);

0 commit comments

Comments
 (0)