Skip to content

Commit eeaba9b

Browse files
committed
Merge remote-tracking branch 'my_remote/sycl' into AddNewDiagAttr
2 parents 6649363 + 4a78734 commit eeaba9b

File tree

2,003 files changed

+854985
-31689
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,003 files changed

+854985
-31689
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ opencl-aot/ @dm-vodopyanov @AlexeySachkov @romanovvlad
1515
# Device library
1616
libdevice/ @vzakhari
1717

18+
# DPC++ runtime library
19+
sycl/ @intel/llvm-reviewers-runtime
20+
1821
# Documentation
1922
sycl/ReleaseNotes.md @pvchupin
2023
sycl/doc/ @pvchupin @kbobrovs
2124
sycl/doc/extensions/ @intel/dpcpp-specification-reviewers
2225

23-
# DPC++ runtime library
24-
sycl/ @intel/llvm-reviewers-runtime
25-
2626
# USM
2727
sycl/include/CL/sycl/detail/clusm.hpp @jbrodman
2828
sycl/include/CL/sycl/detail/usm_impl.hpp @jbrodman

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Please describe the steps to reproduce the behavior:
15+
16+
1. Include code snippet as short as possible
17+
2. Specify the command which should be used to compile the program
18+
3. Specify the comment which should be used to launch the program
19+
4. Indicate what is wrong and what was expected
20+
21+
**Environment (please complete the following information):**
22+
23+
- OS: [e.g Windows/Linux]
24+
- Target device and vendor: [e.g. Intel GPU]
25+
- DPC++ version: [e.g. commit hash or output of `clang++ --version`]
26+
- Dependencies version: [e.g. low-level runtime versions (like NEO 20.04)]
27+
28+
**Additional context**
29+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: Ask community a question
3+
url: https://github.com/intel/llvm/discussions/categories/q-a
4+
about: Please use Q&A Discussions category instead of Issues to ask questions
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea/improvement for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe**
11+
A clear and concise description of what the problem is.
12+
Include reproducer or code/pseudo-code example.
13+
Include specific environment details where problem occurs.
14+
15+
**Describe the solution you would like**
16+
A clear and concise description of what you want to happen.
17+
18+
**Describe alternatives you have considered**
19+
A clear and concise description of any alternative solutions or features you
20+
have considered.
21+
22+
**Additional context**
23+
Add any other context about the feature request here.

.github/workflows/clang-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- name: Run clang-format for the patch
2020
run: |
21-
git diff -U0 --no-color ${GITHUB_SHA}^1 ${GITHUB_SHA} -- | ./clang/tools/clang-format/clang-format-diff.py -p1 -binary clang-format-9 > ./clang-format.patch
21+
git diff --no-color ${GITHUB_SHA}^1 ${GITHUB_SHA} --name-only -- | grep -v "/test/" | xargs git diff -U0 --no-color ${GITHUB_SHA}^1 ${GITHUB_SHA} -- | ./clang/tools/clang-format/clang-format-diff.py -p1 -binary clang-format-9 > ./clang-format.patch
2222
2323
# Add patch with formatting fixes to CI job artifacts
2424
- uses: actions/upload-artifact@v1

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
Intel staging area for llvm.org contribution.
66
Home for Intel LLVM-based projects:
77

8-
* oneAPI Data Parallel C++ compiler - see **sycl** branch. More information on
9-
oneAPI and DPC++ is available at
10-
[https://www.oneapi.com/](https://www.oneapi.com/)
8+
* oneAPI Data Parallel C++ compiler - see
9+
[sycl](https://github.com/intel/llvm/tree/sycl) branch. More information on
10+
oneAPI and DPC++ is available at
11+
[https://www.oneapi.com/](https://www.oneapi.com/)
1112
* [![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)
1213
[![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)
14+
* Late-outline OpenMP\* and OpenMP\* Offload - see
15+
[openmp](https://github.com/intel/llvm/tree/openmp) branch.
1316

1417
## License
1518

@@ -23,11 +26,12 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
2326

2427
* oneAPI Data Parallel C++ compiler - See
2528
[DPC++ Documentation](https://intel.github.io/llvm-docs/)
29+
* Late-outline OpenMP\* and OpenMP\* Offload - TBD
2630

2731
## DPC++ extensions
2832

2933
DPC++ is an open, cross-architecture language built upon the ISO C++ and Khronos
3034
SYCL\* standards. DPC++ extends these standards with a number of extensions,
3135
which can be found in [sycl/doc/extensions](sycl/doc/extensions) directory.
3236

33-
\*Other names and brands may be claimed as the property of others.
37+
*\*Other names and brands may be claimed as the property of others.*

clang-tools-extra/clang-query/Query.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ bool MatchQuery::run(llvm::raw_ostream &OS, QuerySession &QS) const {
156156
if (QS.DetailedASTOutput) {
157157
OS << "Binding for \"" << BI->first << "\":\n";
158158
const ASTContext &Ctx = AST->getASTContext();
159-
const SourceManager &SM = Ctx.getSourceManager();
160-
ASTDumper Dumper(OS, Ctx, SM.getDiagnostics().getShowColors());
159+
ASTDumper Dumper(OS, Ctx, AST->getDiagnostics().getShowColors());
161160
Dumper.SetTraversalKind(QS.TK);
162161
Dumper.Visit(BI->second);
163162
OS << "\n";

clang-tools-extra/clang-query/tool/ClangQuery.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ using namespace llvm;
4949
static cl::extrahelp CommonHelp(CommonOptionsParser::HelpMessage);
5050
static cl::OptionCategory ClangQueryCategory("clang-query options");
5151

52+
static cl::opt<bool>
53+
UseColor("use-color",
54+
cl::desc(
55+
R"(Use colors in detailed AST output. If not set, colors
56+
will be used if the terminal connected to
57+
standard output supports colors.)"),
58+
cl::init(false), cl::cat(ClangQueryCategory));
59+
5260
static cl::list<std::string> Commands("c", cl::desc("Specify command to run"),
5361
cl::value_desc("command"),
5462
cl::cat(ClangQueryCategory));
@@ -109,6 +117,19 @@ int main(int argc, const char **argv) {
109117

110118
ClangTool Tool(OptionsParser->getCompilations(),
111119
OptionsParser->getSourcePathList());
120+
121+
if (UseColor.getNumOccurrences() > 0) {
122+
ArgumentsAdjuster colorAdjustor = [](const CommandLineArguments &Args, StringRef /*unused*/) {
123+
CommandLineArguments AdjustedArgs = Args;
124+
if (UseColor)
125+
AdjustedArgs.push_back("-fdiagnostics-color");
126+
else
127+
AdjustedArgs.push_back("-fno-diagnostics-color");
128+
return AdjustedArgs;
129+
};
130+
Tool.appendArgumentsAdjuster(colorAdjustor);
131+
}
132+
112133
std::vector<std::unique_ptr<ASTUnit>> ASTs;
113134
int ASTStatus = 0;
114135
switch (Tool.buildASTs(ASTs)) {

clang-tools-extra/clangd/ClangdLSPServer.cpp

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,15 @@ class ClangdLSPServer::MessageHandler : public Transport::MessageHandler {
258258
};
259259
}
260260

261+
template <typename Result>
262+
void bind(const char *Method,
263+
void (ClangdLSPServer::*Handler)(Callback<Result>)) {
264+
Calls[Method] = [Handler, this](llvm::json::Value RawParams,
265+
ReplyOnce Reply) {
266+
(Server.*Handler)(std::move(Reply));
267+
};
268+
}
269+
261270
// Bind a reply callback to a request. The callback will be invoked when
262271
// clangd receives the reply from the LSP client.
263272
// Return a call id of the request.
@@ -301,6 +310,12 @@ class ClangdLSPServer::MessageHandler : public Transport::MessageHandler {
301310
};
302311
}
303312

313+
void bind(const char *Method, void (ClangdLSPServer::*Handler)()) {
314+
Notifications[Method] = [Handler, this](llvm::json::Value RawParams) {
315+
(Server.*Handler)();
316+
};
317+
}
318+
304319
private:
305320
// Function object to reply to an LSP call.
306321
// Each instance must be called exactly once, otherwise:
@@ -443,6 +458,14 @@ class ClangdLSPServer::MessageHandler : public Transport::MessageHandler {
443458
};
444459
constexpr int ClangdLSPServer::MessageHandler::MaxReplayCallbacks;
445460

461+
template <>
462+
void ClangdLSPServer::MessageHandler::bind<NoParams>(
463+
const char *Method, void (ClangdLSPServer::*Handler)(const NoParams &)) {
464+
Notifications[Method] = [Handler, this](llvm::json::Value RawParams) {
465+
(Server.*Handler)(NoParams{});
466+
};
467+
}
468+
446469
// call(), notify(), and reply() wrap the Transport, adding logging and locking.
447470
void ClangdLSPServer::callRaw(StringRef Method, llvm::json::Value Params,
448471
Callback<llvm::json::Value> CB) {
@@ -487,6 +510,11 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
487510
"semanticTokens request, choosing the latter (no notifications).");
488511
Opts.TheiaSemanticHighlighting = false;
489512
}
513+
if (Opts.TheiaSemanticHighlighting) {
514+
log("Using legacy semanticHighlights notification, which will be removed "
515+
"in clangd 13. Clients should use the standard semanticTokens "
516+
"request instead.");
517+
}
490518

491519
if (Params.rootUri && *Params.rootUri)
492520
Opts.WorkspaceRoot = std::string(Params.rootUri->file());
@@ -500,6 +528,7 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
500528
if (Opts.UseDirBasedCDB) {
501529
DirectoryBasedGlobalCompilationDatabase::Options CDBOpts(TFS);
502530
CDBOpts.CompileCommandsDir = Opts.CompileCommandsDir;
531+
CDBOpts.ContextProvider = Opts.ContextProvider;
503532
BaseCDB =
504533
std::make_unique<DirectoryBasedGlobalCompilationDatabase>(CDBOpts);
505534
BaseCDB = getQueryDriverDatabase(llvm::makeArrayRef(Opts.QueryDriverGlobs),
@@ -647,17 +676,15 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
647676

648677
void ClangdLSPServer::onInitialized(const InitializedParams &Params) {}
649678

650-
void ClangdLSPServer::onShutdown(const ShutdownParams &Params,
651-
Callback<std::nullptr_t> Reply) {
679+
void ClangdLSPServer::onShutdown(Callback<std::nullptr_t> Reply) {
652680
// Do essentially nothing, just say we're ready to exit.
653681
ShutdownRequestReceived = true;
654682
Reply(nullptr);
655683
}
656684

657685
// sync is a clangd extension: it blocks until all background work completes.
658686
// It blocks the calling thread, so no messages are processed until it returns!
659-
void ClangdLSPServer::onSync(const NoParams &Params,
660-
Callback<std::nullptr_t> Reply) {
687+
void ClangdLSPServer::onSync(Callback<std::nullptr_t> Reply) {
661688
if (Server->blockUntilIdleForTest(/*TimeoutSeconds=*/60))
662689
Reply(nullptr);
663690
else
@@ -1445,8 +1472,7 @@ void ClangdLSPServer::onSemanticTokensDelta(
14451472
});
14461473
}
14471474

1448-
void ClangdLSPServer::onMemoryUsage(const NoParams &,
1449-
Callback<MemoryTree> Reply) {
1475+
void ClangdLSPServer::onMemoryUsage(Callback<MemoryTree> Reply) {
14501476
llvm::BumpPtrAllocator DetailAlloc;
14511477
MemoryTree MT(&DetailAlloc);
14521478
profile(MT);

clang-tools-extra/clangd/ClangdLSPServer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class ClangdLSPServer : private ClangdServer::Callbacks {
9393
// Calls have signature void(const Params&, Callback<Response>).
9494
void onInitialize(const InitializeParams &, Callback<llvm::json::Value>);
9595
void onInitialized(const InitializedParams &);
96-
void onShutdown(const ShutdownParams &, Callback<std::nullptr_t>);
97-
void onSync(const NoParams &, Callback<std::nullptr_t>);
96+
void onShutdown(Callback<std::nullptr_t>);
97+
void onSync(Callback<std::nullptr_t>);
9898
void onDocumentDidOpen(const DidOpenTextDocumentParams &);
9999
void onDocumentDidChange(const DidChangeTextDocumentParams &);
100100
void onDocumentDidClose(const DidCloseTextDocumentParams &);
@@ -161,7 +161,7 @@ class ClangdLSPServer : private ClangdServer::Callbacks {
161161
Callback<SemanticTokensOrDelta>);
162162
/// This is a clangd extension. Provides a json tree representing memory usage
163163
/// hierarchy.
164-
void onMemoryUsage(const NoParams &, Callback<MemoryTree>);
164+
void onMemoryUsage(Callback<MemoryTree>);
165165

166166
std::vector<Fix> getFixes(StringRef File, const clangd::Diagnostic &D);
167167

clang-tools-extra/clangd/ClangdServer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ void ClangdServer::formatOnType(PathRef File, llvm::StringRef Code,
407407
Result.push_back(replacementToEdit(Code, R));
408408
return CB(Result);
409409
};
410-
WorkScheduler.run("FormatOnType", File, std::move(Action));
410+
WorkScheduler.runQuick("FormatOnType", File, std::move(Action));
411411
}
412412

413413
void ClangdServer::prepareRename(PathRef File, Position Pos,
@@ -635,7 +635,7 @@ void ClangdServer::formatCode(PathRef File, llvm::StringRef Code,
635635
tooling::calculateRangesAfterReplacements(IncludeReplaces, Ranges),
636636
File)));
637637
};
638-
WorkScheduler.run("Format", File, std::move(Action));
638+
WorkScheduler.runQuick("Format", File, std::move(Action));
639639
}
640640

641641
void ClangdServer::findDocumentHighlights(

clang-tools-extra/clangd/CodeComplete.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,9 @@ bool semaCodeComplete(std::unique_ptr<CodeCompleteConsumer> Consumer,
11231123
// skip all includes in this case; these completions are really simple.
11241124
PreambleBounds PreambleRegion =
11251125
ComputePreambleBounds(*CI->getLangOpts(), *ContentsBuffer, 0);
1126-
bool CompletingInPreamble = PreambleRegion.Size > Input.Offset;
1126+
bool CompletingInPreamble = Input.Offset < PreambleRegion.Size ||
1127+
(!PreambleRegion.PreambleEndsAtStartOfLine &&
1128+
Input.Offset == PreambleRegion.Size);
11271129
if (Input.Patch)
11281130
Input.Patch->apply(*CI);
11291131
// NOTE: we must call BeginSourceFile after prepareCompilerInstance. Otherwise

clang-tools-extra/clangd/Config.h

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "llvm/ADT/FunctionExtras.h"
2929
#include "llvm/ADT/Optional.h"
3030
#include "llvm/ADT/StringMap.h"
31+
#include "llvm/ADT/StringSet.h"
3132
#include <string>
3233
#include <vector>
3334

@@ -51,11 +52,19 @@ struct Config {
5152
Config(Config &&) = default;
5253
Config &operator=(Config &&) = default;
5354

55+
struct CDBSearchSpec {
56+
enum { Ancestors, FixedDir, NoCDBSearch } Policy = Ancestors;
57+
// Absolute, native slashes, no trailing slash.
58+
llvm::Optional<std::string> FixedCDBPath;
59+
};
60+
5461
/// Controls how the compile command for the current file is determined.
5562
struct {
56-
// Edits to apply to the compile command, in sequence.
63+
/// Edits to apply to the compile command, in sequence.
5764
std::vector<llvm::unique_function<void(std::vector<std::string> &) const>>
5865
Edits;
66+
/// Where to search for compilation databases for this file's flags.
67+
CDBSearchSpec CDBSearch = {CDBSearchSpec::Ancestors, llvm::None};
5968
} CompileFlags;
6069

6170
enum class BackgroundPolicy { Build, Skip };
@@ -77,21 +86,26 @@ struct Config {
7786
llvm::Optional<ExternalIndexSpec> External;
7887
} Index;
7988

89+
/// Controls warnings and errors when parsing code.
90+
struct {
91+
bool SuppressAll = false;
92+
llvm::StringSet<> Suppress;
93+
94+
/// Configures what clang-tidy checks to run and options to use with them.
95+
struct {
96+
// A comma-seperated list of globs specify which clang-tidy checks to run.
97+
std::string Checks;
98+
llvm::StringMap<std::string> CheckOptions;
99+
} ClangTidy;
100+
} Diagnostics;
101+
80102
/// Style of the codebase.
81103
struct {
82104
// Namespaces that should always be fully qualified, meaning no "using"
83105
// declarations, always spell out the whole name (with or without leading
84106
// ::). All nested namespaces are affected as well.
85107
std::vector<std::string> FullyQualifiedNamespaces;
86108
} Style;
87-
88-
/// Configures what clang-tidy checks to run and options to use with them.
89-
struct {
90-
// A comma-seperated list of globs to specify which clang-tidy checks to
91-
// run.
92-
std::string Checks;
93-
llvm::StringMap<std::string> CheckOptions;
94-
} ClangTidy;
95109
};
96110

97111
} // namespace clangd

0 commit comments

Comments
 (0)