Skip to content

Commit d320606

Browse files
authored
Merge branch 'main' into decoder_emitter_type_specialization
2 parents 94522ba + e1ff432 commit d320606

File tree

201 files changed

+7781
-1379
lines changed

Some content is hidden

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

201 files changed

+7781
-1379
lines changed

.github/workflows/premerge.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ jobs:
6969
7070
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}" "${runtimes_check_targets_needs_reconfig}" "${enable_cir}"
7171
- name: Upload Artifacts
72+
# In some cases, Github will fail to upload the artifact. We want to
73+
# continue anyways as a failed artifact upload is an infra failure, not
74+
# a checks failure.
75+
# https://github.com/actions/upload-artifact/issues/569
76+
continue-on-error: true
7277
if: '!cancelled()'
7378
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
7479
with:
@@ -114,6 +119,11 @@ jobs:
114119
# these environment variables.
115120
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; export SCCACHE_IDLE_TIMEOUT=0; sccache --start-server; .ci/monolithic-windows.sh \"${{ steps.vars.outputs.windows-projects }}\" \"${{ steps.vars.outputs.windows-check-targets }}\""
116121
- name: Upload Artifacts
122+
# In some cases, Github will fail to upload the artifact. We want to
123+
# continue anyways as a failed artifact upload is an infra failure, not
124+
# a checks failure.
125+
# https://github.com/actions/upload-artifact/issues/569
126+
continue-on-error: true
117127
if: '!cancelled()'
118128
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
119129
with:

clang-tools-extra/clangd/GlobalCompilationDatabase.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,10 @@ bool OverlayCDB::setCompileCommand(PathRef File,
833833
std::unique_ptr<ProjectModules>
834834
OverlayCDB::getProjectModules(PathRef File) const {
835835
auto MDB = DelegatingCDB::getProjectModules(File);
836+
if (!MDB) {
837+
log("Failed to get compilation Database for {0}", File);
838+
return {};
839+
}
836840
MDB->setCommandMangler([&Mangler = Mangler](tooling::CompileCommand &Command,
837841
PathRef CommandPath) {
838842
Mangler(Command, CommandPath);
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# A smoke test to check that clangd works without compilation database
2+
#
3+
# Windows have different escaping modes.
4+
# FIXME: We should add one for windows.
5+
# UNSUPPORTED: system-windows
6+
#
7+
# RUN: rm -fr %t
8+
# RUN: mkdir -p %t
9+
# RUN: split-file %s %t
10+
#
11+
# RUN: sed -e "s|DIR|%/t|g" %t/definition.jsonrpc.tmpl > %t/definition.jsonrpc
12+
#
13+
# RUN: clangd -experimental-modules-support -lit-test < %t/definition.jsonrpc \
14+
# RUN: | FileCheck -strict-whitespace %t/definition.jsonrpc
15+
16+
#--- A.h
17+
void printA();
18+
19+
#--- Use.cpp
20+
#include "A.h"
21+
void foo() {
22+
print
23+
}
24+
25+
#--- definition.jsonrpc.tmpl
26+
{
27+
"jsonrpc": "2.0",
28+
"id": 0,
29+
"method": "initialize",
30+
"params": {
31+
"processId": 123,
32+
"rootPath": "clangd",
33+
"capabilities": {
34+
"textDocument": {
35+
"completion": {
36+
"completionItem": {
37+
"snippetSupport": true
38+
}
39+
}
40+
}
41+
},
42+
"trace": "off"
43+
}
44+
}
45+
---
46+
{
47+
"jsonrpc": "2.0",
48+
"method": "textDocument/didOpen",
49+
"params": {
50+
"textDocument": {
51+
"uri": "file://DIR/Use.cpp",
52+
"languageId": "cpp",
53+
"version": 1,
54+
"text": "#include \"A.h\"\nvoid foo() {\n print\n}\n"
55+
}
56+
}
57+
}
58+
59+
# CHECK: "message"{{.*}}printA{{.*}}(fix available)
60+
61+
---
62+
{"jsonrpc":"2.0","id":1,"method":"textDocument/completion","params":{"textDocument":{"uri":"file://DIR/Use.cpp"},"context":{"triggerKind":1},"position":{"line":2,"character":6}}}
63+
---
64+
{"jsonrpc":"2.0","id":2,"method":"shutdown"}
65+
---
66+
{"jsonrpc":"2.0","method":"exit"}

0 commit comments

Comments
 (0)