Skip to content

Commit b4489bd

Browse files
authored
Merge branch 'sycl' into gsg-update
2 parents 2c94017 + 4e6cf6f commit b4489bd

File tree

2,135 files changed

+58924
-22848
lines changed

Some content is hidden

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

2,135 files changed

+58924
-22848
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@
44

55
Intel staging area for llvm.org contribution.
66
Home for Intel LLVM-based projects:
7-
- oneAPI Data Parallel C++ compiler - see **sycl** branch. More information on
7+
8+
* oneAPI Data Parallel C++ compiler - see **sycl** branch. More information on
89
oneAPI and DPC++ is available at
910
[https://www.oneapi.com/](https://www.oneapi.com/)
10-
- [![Linux Post Commit Checks](https://github.com/intel/llvm/workflows/Linux%20Post%20Commit%20Checks/badge.svg)](https://github.com/intel/llvm/actions?query=workflow%3A%22Linux+Post+Commit+Checks%22)
11-
[![Generate Doxygen documentation](https://github.com/intel/llvm/workflows/Generate%20Doxygen%20documentation/badge.svg)](https://github.com/intel/llvm/actions?query=workflow%3A%22Generate+Doxygen+documentation%22)
12-
13-
11+
* [![Linux Post Commit Checks](https://github.com/intel/llvm/workflows/Linux%20Post%20Commit%20Checks/badge.svg)](https://github.com/intel/llvm/actions?query=workflow%3A%22Linux+Post+Commit+Checks%22)
12+
[![Generate Doxygen documentation](https://github.com/intel/llvm/workflows/Generate%20Doxygen%20documentation/badge.svg)](https://github.com/intel/llvm/actions?query=workflow%3A%22Generate+Doxygen+documentation%22)
1413

1514
## License
15+
1616
See [LICENSE.txt](sycl/LICENSE.TXT) for details.
1717

1818
## Contributing
19+
1920
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
2021

2122
## Sub-projects Documentation
22-
- oneAPI Data Parallel C++ compiler - See
23-
[GetStartedGuide.md](sycl/doc/GetStartedGuide.md)
23+
24+
* oneAPI Data Parallel C++ compiler - See
25+
[GetStartedGuide.md](sycl/doc/GetStartedGuide.md)
2426

2527
## DPC++ extensions
2628

@@ -29,4 +31,3 @@ SYCL\* standards. DPC++ extends these standards with a number of extensions,
2931
which can be found in [sycl/doc/extensions](sycl/doc/extensions) directory.
3032

3133
\*Other names and brands may be claimed as the property of others.
32-

buildbot/dependency.conf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[VERSIONS]
2+
# https://github.com/intel/llvm/releases/download/2020-03/oclcpuexp-2020.10.4.0.15_rel.tar.gz
3+
ocl_cpu_rt_ver=2020.10.4.0.15
4+
# https://github.com/intel/llvm/releases/download/2020-03/win-oclcpuexp-2020.10.4.0.15_rel.zip
5+
ocl_cpu_rt_ver_win=2020.10.4.0.15
6+
# https://github.com/intel/compute-runtime/releases/tag/20.12.16259
7+
ocl_gpu_rt_ver=l0-20.12.16259
8+
# https://downloadcenter.intel.com/download/29557/Intel-Graphics-Windows-10-DCH-Drivers
9+
ocl_gpu_rt_ver_win=ci-neo-015900
10+
intel_sycl_ver=build
11+
# https://github.com/oneapi-src/oneTBB/releases/download/v2020.2/tbb-2020.2-lin.tgz
12+
tbb_ver=20200121_111047
13+
# https://github.com/oneapi-src/oneTBB/releases/download/v2020.2/tbb-2020.2-win.zip
14+
tbb_ver_win=20200124_000000
15+
# TODO: provide URL for Linux OpenCL emulator of FPGA device
16+
fpga_ver=20200216_000000
17+
# TODO: provide URL for Windows OpenCL emulator of FPGA device
18+
fpga_ver_win=20200216_000000
19+
20+
[DRIVER VERSIONS]
21+
cpu_driver_lin=2020.10.4.0.15
22+
cpu_driver_win=2020.10.4.0.15
23+
gpu_driver_lin=20.12.16259
24+
gpu_driver_win=ci-neo-015900
25+
fpga_driver_lin=2020.9.2.0
26+
fpga_driver_win=2020.9.2.0

clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ class NameLookup {
207207
/// flag indicating the multiple resolutions.
208208
NameLookup findDeclInBases(const CXXRecordDecl &Parent, StringRef DeclName,
209209
bool AggressiveTemplateLookup) {
210+
if (!Parent.hasDefinition())
211+
return NameLookup(nullptr);
210212
if (const NamedDecl *InClassRef = findDecl(Parent, DeclName))
211213
return NameLookup(InClassRef);
212214
const NamedDecl *Found = nullptr;

clang-tools-extra/clangd/CodeComplete.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,7 @@ SignatureHelp signatureHelp(PathRef FileName,
17771777
const SymbolIndex *Index) {
17781778
auto Offset = positionToOffset(Contents, Pos);
17791779
if (!Offset) {
1780-
elog("Code completion position was invalid {0}", Offset.takeError());
1780+
elog("Signature help position was invalid {0}", Offset.takeError());
17811781
return SignatureHelp();
17821782
}
17831783
SignatureHelp Result;

clang-tools-extra/clangd/Compiler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ buildCompilerInvocation(const ParseInputs &Inputs, clang::DiagnosticConsumer &D,
8282
CI->getPreprocessorOpts().PCHThroughHeader.clear();
8383
CI->getPreprocessorOpts().PCHWithHdrStop = false;
8484
CI->getPreprocessorOpts().PCHWithHdrStopCreate = false;
85+
86+
// Recovery expression currently only works for C++.
87+
if (CI->getLangOpts()->CPlusPlus)
88+
CI->getLangOpts()->RecoveryAST = Inputs.Opts.BuildRecoveryAST;
8589
return CI;
8690
}
8791

clang-tools-extra/clangd/Diagnostics.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ Range diagnosticRange(const clang::Diagnostic &D, const LangOptions &L) {
124124
bool adjustDiagFromHeader(Diag &D, const clang::Diagnostic &Info,
125125
const LangOptions &LangOpts) {
126126
// We only report diagnostics with at least error severity from headers.
127-
if (D.Severity < DiagnosticsEngine::Level::Error)
127+
// Use default severity to avoid noise with -Werror.
128+
if (!Info.getDiags()->getDiagnosticIDs()->isDefaultMappingAsError(
129+
Info.getID()))
128130
return false;
129131

130132
const SourceManager &SM = Info.getSourceManager();
@@ -514,7 +516,8 @@ void StoreDiags::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
514516
if (Info.getLocation().isInvalid()) {
515517
// Handle diagnostics coming from command-line arguments. The source manager
516518
// is *not* available at this point, so we cannot use it.
517-
if (DiagLevel < DiagnosticsEngine::Level::Error) {
519+
if (!Info.getDiags()->getDiagnosticIDs()->isDefaultMappingAsError(
520+
Info.getID())) {
518521
IgnoreDiagnostics::log(DiagLevel, Info);
519522
return; // non-errors add too much noise, do not show them.
520523
}

clang-tools-extra/clangd/ParsedAST.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,6 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
262262
const PrecompiledPreamble *PreamblePCH =
263263
Preamble ? &Preamble->Preamble : nullptr;
264264

265-
// Recovery expression currently only works for C++.
266-
if (CI->getLangOpts()->CPlusPlus)
267-
CI->getLangOpts()->RecoveryAST = Inputs.Opts.BuildRecoveryAST;
268265
// This is on-by-default in windows to allow parsing SDK headers, but it
269266
// breaks many features. Disable it for the main-file (not preamble).
270267
CI->getLangOpts()->DelayedTemplateParsing = false;
@@ -314,18 +311,12 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
314311
std::string CheckName = CTContext->getCheckName(Info.getID());
315312
bool IsClangTidyDiag = !CheckName.empty();
316313
if (IsClangTidyDiag) {
317-
// Check for warning-as-error.
318-
// We deliberately let this take precedence over suppression comments
319-
// to match clang-tidy's behaviour.
320-
if (DiagLevel == DiagnosticsEngine::Warning &&
321-
CTContext->treatAsError(CheckName)) {
322-
return DiagnosticsEngine::Error;
323-
}
324-
325314
// Check for suppression comment. Skip the check for diagnostics not
326315
// in the main file, because we don't want that function to query the
327316
// source buffer for preamble files. For the same reason, we ask
328317
// shouldSuppressDiagnostic to avoid I/O.
318+
// We let suppression comments take precedence over warning-as-error
319+
// to match clang-tidy's behaviour.
329320
bool IsInsideMainFile =
330321
Info.hasSourceManager() &&
331322
isInsideMainFile(Info.getLocation(), Info.getSourceManager());
@@ -334,6 +325,12 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
334325
/*AllowIO=*/false)) {
335326
return DiagnosticsEngine::Ignored;
336327
}
328+
329+
// Check for warning-as-error.
330+
if (DiagLevel == DiagnosticsEngine::Warning &&
331+
CTContext->treatAsError(CheckName)) {
332+
return DiagnosticsEngine::Error;
333+
}
337334
}
338335
}
339336
return DiagLevel;

clang-tools-extra/clangd/Preamble.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,6 @@ buildPreamble(PathRef FileName, CompilerInvocation CI,
219219
// to read back. We rely on dynamic index for the comments instead.
220220
CI.getPreprocessorOpts().WriteCommentListToPCH = false;
221221

222-
// Recovery expression currently only works for C++.
223-
if (CI.getLangOpts()->CPlusPlus)
224-
CI.getLangOpts()->RecoveryAST = Inputs.Opts.BuildRecoveryAST;
225-
226222
CppFilePreambleCallbacks SerializedDeclsCollector(FileName, PreambleCallback);
227223
if (Inputs.FS->setCurrentWorkingDirectory(Inputs.CompileCommand.Directory)) {
228224
log("Couldn't set working directory when building the preamble.");

clang-tools-extra/clangd/Selection.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "Selection.h"
1010
#include "SourceCode.h"
1111
#include "support/Logger.h"
12+
#include "support/Trace.h"
1213
#include "clang/AST/ASTTypeTraits.h"
1314
#include "clang/AST/Decl.h"
1415
#include "clang/AST/DeclCXX.h"
@@ -35,6 +36,21 @@ namespace {
3536
using Node = SelectionTree::Node;
3637
using ast_type_traits::DynTypedNode;
3738

39+
// Measure the fraction of selections that were enabled by recovery AST.
40+
void recordMetrics(const SelectionTree &S) {
41+
static constexpr trace::Metric SelectionUsedRecovery(
42+
"selection_recovery", trace::Metric::Distribution);
43+
const auto *Common = S.commonAncestor();
44+
for (const auto *N = Common; N; N = N->Parent) {
45+
if (N->ASTNode.get<RecoveryExpr>()) {
46+
SelectionUsedRecovery.record(1); // used recovery ast.
47+
return;
48+
}
49+
}
50+
if (Common)
51+
SelectionUsedRecovery.record(0); // unused.
52+
}
53+
3854
// An IntervalSet maintains a set of disjoint subranges of an array.
3955
//
4056
// Initially, it contains the entire array.
@@ -774,6 +790,7 @@ SelectionTree::SelectionTree(ASTContext &AST, const syntax::TokenBuffer &Tokens,
774790
.printToString(SM));
775791
Nodes = SelectionVisitor::collect(AST, Tokens, PrintPolicy, Begin, End, FID);
776792
Root = Nodes.empty() ? nullptr : &Nodes.front();
793+
recordMetrics(*this);
777794
dlog("Built selection tree\n{0}", *this);
778795
}
779796

clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ static void DexQueries(benchmark::State &State) {
8383
}
8484
BENCHMARK(DexQueries);
8585

86+
static void DexBuild(benchmark::State &State) {
87+
for (auto _ : State)
88+
buildDex();
89+
}
90+
BENCHMARK(DexBuild);
91+
8692
} // namespace
8793
} // namespace clangd
8894
} // namespace clang

0 commit comments

Comments
 (0)