Skip to content

Commit e1b5296

Browse files
authored
Merge branch 'main' into users/ojhunt/warn-msvc-bitfield-packing
2 parents c4b2d4a + cd92c6a commit e1b5296

File tree

1,209 files changed

+50422
-27023
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,209 files changed

+50422
-27023
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
# to receive an approval from a "code owner" in particular -- any LLVM project
88
# member can approve pull requests.
99
#
10-
# Note that GitHub's concept of "code owner" is independent from LLVM's own
11-
# "code owner" concept, they merely happen to share terminology. See
12-
# https://llvm.org/docs/DeveloperPolicy.html#code-owners, as well as the
13-
# CODE_OWNERS.txt files in the respective subproject directories.
10+
# This is independent of LLVM's own "maintainer" concept.
11+
# See https://llvm.org/docs/DeveloperPolicy.html#maintainers as well as the
12+
# Maintainers.* files in the the respective subproject directories.
1413

1514
/libcxx/ @llvm/reviewers-libcxx
1615
/libcxxabi/ @llvm/reviewers-libcxxabi

.github/workflows/docs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,58 +112,87 @@ jobs:
112112
sudo apt-get update
113113
# swig and graphviz are lldb specific dependencies
114114
sudo apt-get install -y cmake ninja-build swig graphviz
115+
- name: Setup output folder
116+
run: mkdir built-docs
115117
- name: Build LLVM docs
116118
if: steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true'
117119
run: |
118120
cmake -B llvm-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_SPHINX=ON ./llvm
119121
TZ=UTC ninja -C llvm-build docs-llvm-html docs-llvm-man
122+
mkdir built-docs/llvm
123+
cp -r llvm-build/docs/* built-docs/llvm/
120124
- name: Build Clang docs
121125
if: steps.docs-changed-subprojects.outputs.clang_any_changed == 'true'
122126
run: |
123127
cmake -B clang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_SPHINX=ON ./llvm
124128
TZ=UTC ninja -C clang-build docs-clang-html docs-clang-man
129+
mkdir built-docs/clang
130+
cp -r clang-build/docs/* built-docs/clang/
125131
- name: Build clang-tools-extra docs
126132
if: steps.docs-changed-subprojects.outputs.clang-tools-extra_any_changed == 'true'
127133
run: |
128134
cmake -B clang-tools-extra-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_ENABLE_SPHINX=ON ./llvm
129135
TZ=UTC ninja -C clang-tools-extra-build docs-clang-tools-html docs-clang-tools-man
136+
mkdir built-docs/clang-tools-extra
137+
cp -r clang-tools-extra-build/docs/* built-docs/clang-tools-extra/
130138
- name: Build LLDB docs
131139
if: steps.docs-changed-subprojects.outputs.lldb_any_changed == 'true'
132140
run: |
133141
cmake -B lldb-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_ENABLE_SPHINX=ON ./llvm
134142
TZ=UTC ninja -C lldb-build docs-lldb-html docs-lldb-man
143+
mkdir built-docs/lldb
144+
cp -r lldb-build/docs/* built-docs/lldb/
135145
- name: Build libunwind docs
136146
if: steps.docs-changed-subprojects.outputs.libunwind_any_changed == 'true'
137147
run: |
138148
cmake -B libunwind-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libunwind" -DLLVM_ENABLE_SPHINX=ON ./runtimes
139149
TZ=UTC ninja -C libunwind-build docs-libunwind-html
150+
mkdir built-docs/libunwind
151+
cp -r libunwind-build/libunwind/docs/* built-docs/libunwind
140152
- name: Build libcxx docs
141153
if: steps.docs-changed-subprojects.outputs.libcxx_any_changed == 'true'
142154
run: |
143155
cmake -B libcxx-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libcxxabi;libcxx;libunwind" -DLLVM_ENABLE_SPHINX=ON ./runtimes
144156
TZ=UTC ninja -C libcxx-build docs-libcxx-html
157+
mkdir built-docs/libcxx
158+
cp -r libcxx-build/libcxx/docs/* built-docs/libcxx/
145159
- name: Build libc docs
146160
if: steps.docs-changed-subprojects.outputs.libc_any_changed == 'true'
147161
run: |
148162
cmake -B libc-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libc" -DLLVM_ENABLE_SPHINX=ON ./runtimes
149163
TZ=UTC ninja -C libc-build docs-libc-html
164+
mkdir built-docs/libc
165+
cp -r libc-build/libc/docs/* built-docs/libc/
150166
- name: Build LLD docs
151167
if: steps.docs-changed-subprojects.outputs.lld_any_changed == 'true'
152168
run: |
153169
cmake -B lld-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="lld" -DLLVM_ENABLE_SPHINX=ON ./llvm
154170
TZ=UTC ninja -C lld-build docs-lld-html
171+
mkdir built-docs/lld
172+
cp -r lld-build/docs/* built-docs/lld/
155173
- name: Build OpenMP docs
156174
if: steps.docs-changed-subprojects.outputs.openmp_any_changed == 'true'
157175
run: |
158176
cmake -B openmp-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_ENABLE_SPHINX=ON ./llvm
159177
TZ=UTC ninja -C openmp-build docs-openmp-html
178+
mkdir built-docs/openmp
179+
cp -r openmp-build/docs/* built-docs/openmp/
160180
- name: Build Polly docs
161181
if: steps.docs-changed-subprojects.outputs.polly_any_changed == 'true'
162182
run: |
163183
cmake -B polly-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="polly" -DLLVM_ENABLE_SPHINX=ON ./llvm
164184
TZ=UTC ninja -C polly-build docs-polly-html docs-polly-man
185+
mkdir built-docs/polly
186+
cp -r polly-build/docs/* built-docs/polly/
165187
- name: Build Flang docs
166188
if: steps.docs-changed-subprojects.outputs.flang_any_changed == 'true'
167189
run: |
168190
cmake -B flang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;mlir;flang" -DLLVM_ENABLE_SPHINX=ON ./llvm
169191
TZ=UTC ninja -C flang-build docs-flang-html
192+
mkdir built-docs/flang
193+
cp -r flang-build/docs/* built-docs/flang/
194+
- name: Upload docs
195+
uses: actions/upload-artifact@v4
196+
with:
197+
name: docs-output
198+
path: built-docs/

.github/workflows/libcxx-restart-preempted-jobs.yaml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,91 @@ jobs:
130130
run_id: context.payload.workflow_run.id
131131
})
132132
await create_check_run('success', 'Restarted workflow run due to preempted job')
133+
134+
restart-test:
135+
if: github.repository_owner == 'llvm' && (github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'cancelled') && github.event.actor.login == 'ldionne' # TESTING ONLY
136+
name: "Restart Job"
137+
permissions:
138+
statuses: read
139+
checks: write
140+
actions: write
141+
runs-on: ubuntu-latest
142+
steps:
143+
- name: "Restart Job"
144+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
145+
with:
146+
script: |
147+
const FAILURE_REGEX = /Process completed with exit code 1./
148+
const PREEMPTION_REGEX = /The runner has received a shutdown signal|The operation was canceled/
149+
150+
function log(msg) {
151+
core.notice(msg)
152+
}
153+
154+
const wf_run = context.payload.workflow_run
155+
log(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`)
156+
157+
log('Listing check runs for suite')
158+
const check_suites = await github.rest.checks.listForSuite({
159+
owner: context.repo.owner,
160+
repo: context.repo.repo,
161+
check_suite_id: context.payload.workflow_run.check_suite_id,
162+
per_page: 100 // FIXME: We don't have 100 check runs yet, but we should handle this better.
163+
})
164+
165+
preemptions = [];
166+
legitimate_failures = [];
167+
for (check_run of check_suites.data.check_runs) {
168+
log(`Checking check run: ${check_run.id}`);
169+
if (check_run.status != 'completed') {
170+
log('Check run was not completed. Skipping.');
171+
continue;
172+
}
173+
174+
if (check_run.conclusion != 'failure' && check_run.conclusion != 'cancelled') {
175+
log(`Check run had conclusion: ${check_run.conclusion}. Skipping.`);
176+
continue;
177+
}
178+
179+
annotations = await github.rest.checks.listAnnotations({
180+
owner: context.repo.owner,
181+
repo: context.repo.repo,
182+
check_run_id: check_run.id
183+
})
184+
185+
preemption_annotation = annotations.data.find(function(annotation) {
186+
return annotation.annotation_level == 'failure' &&
187+
annotation.message.match(PREEMPTION_REGEX) != null;
188+
});
189+
if (preemption_annotation != null) {
190+
log(`Found preemption message: ${preemption_annotation.message}`);
191+
preemptions.push(check_run);
192+
break;
193+
}
194+
195+
failure_annotation = annotations.data.find(function(annotation) {
196+
return annotation.annotation_level == 'failure' &&
197+
annotation.message.match(FAILURE_REGEX) != null;
198+
});
199+
if (failure_annotation != null) {
200+
log(`Found legitimate failure annotation: ${failure_annotation.message}`);
201+
legitimate_failures.push(check_run);
202+
break;
203+
}
204+
}
205+
206+
if (preemptions) {
207+
log('Found some preempted jobs');
208+
if (legitimate_failures) {
209+
log('Also found some legitimate failures, so not restarting the workflow.');
210+
} else {
211+
log('Did not find any legitimate failures. Restarting workflow.');
212+
await github.rest.actions.reRunWorkflowFailedJobs({
213+
owner: context.repo.owner,
214+
repo: context.repo.repo,
215+
run_id: context.payload.workflow_run.id
216+
})
217+
}
218+
} else {
219+
log('Did not find any preempted jobs. Not restarting the workflow.');
220+
}

bolt/lib/Passes/VeneerElimination.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,17 @@ Error VeneerElimination::runOnFunctions(BinaryContext &BC) {
4646
if (BF.isIgnored())
4747
continue;
4848

49+
MCInst &FirstInstruction = *(BF.begin()->begin());
4950
const MCSymbol *VeneerTargetSymbol = 0;
5051
uint64_t TargetAddress;
51-
if (BC.MIB->matchAbsLongVeneer(BF, TargetAddress)) {
52+
if (BC.MIB->isTailCall(FirstInstruction)) {
53+
VeneerTargetSymbol = BC.MIB->getTargetSymbol(FirstInstruction);
54+
} else if (BC.MIB->matchAbsLongVeneer(BF, TargetAddress)) {
5255
if (BinaryFunction *TargetBF =
5356
BC.getBinaryFunctionAtAddress(TargetAddress))
5457
VeneerTargetSymbol = TargetBF->getSymbol();
55-
} else {
56-
MCInst &FirstInstruction = *(BF.begin()->begin());
57-
if (BC.MIB->hasAnnotation(FirstInstruction, "AArch64Veneer"))
58-
VeneerTargetSymbol = BC.MIB->getTargetSymbol(FirstInstruction, 1);
58+
} else if (BC.MIB->hasAnnotation(FirstInstruction, "AArch64Veneer")) {
59+
VeneerTargetSymbol = BC.MIB->getTargetSymbol(FirstInstruction, 1);
5960
}
6061

6162
if (!VeneerTargetSymbol)

bolt/test/AArch64/veneer-lld-abs.s

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
## Check that llvm-bolt correctly recognizes long absolute thunks generated
2-
## by LLD.
1+
## Check that llvm-bolt correctly recognizes veneers/thunks for absolute code
2+
## generated by LLD.
33

44
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
55
# RUN: %clang %cflags -fno-PIC -no-pie %t.o -o %t.exe -nostdlib \
@@ -12,40 +12,63 @@
1212

1313
.text
1414
.balign 4
15-
.global foo
16-
.type foo, %function
17-
foo:
18-
adrp x1, foo
15+
.global far_function
16+
.type far_function, %function
17+
far_function:
1918
ret
20-
.size foo, .-foo
19+
.size far_function, .-far_function
20+
21+
.global near_function
22+
.type near_function, %function
23+
near_function:
24+
ret
25+
.size near_function, .-near_function
26+
27+
## Force relocations against .text.
28+
.reloc 0, R_AARCH64_NONE
2129

2230
.section ".mytext", "ax"
2331
.balign 4
2432

25-
.global __AArch64AbsLongThunk_foo
26-
.type __AArch64AbsLongThunk_foo, %function
27-
__AArch64AbsLongThunk_foo:
33+
## This version of a thunk is always generated by LLD for function calls
34+
## spanning more than 256MB.
35+
.global __AArch64AbsLongThunk_far_function
36+
.type __AArch64AbsLongThunk_far_function, %function
37+
__AArch64AbsLongThunk_far_function:
2838
ldr x16, .L1
2939
br x16
30-
# CHECK-INPUT-LABEL: <__AArch64AbsLongThunk_foo>:
40+
# CHECK-INPUT-LABEL: <__AArch64AbsLongThunk_far_function>:
3141
# CHECK-INPUT-NEXT: ldr
3242
# CHECK-INPUT-NEXT: br
3343
.L1:
34-
.quad foo
35-
.size __AArch64AbsLongThunk_foo, .-__AArch64AbsLongThunk_foo
44+
.quad far_function
45+
.size __AArch64AbsLongThunk_far_function, .-__AArch64AbsLongThunk_far_function
46+
47+
## If a callee is closer than 256MB away, LLD may generate a thunk with a direct
48+
## jump to the callee. Note, that the name might still include "AbsLong".
49+
.global __AArch64AbsLongThunk_near_function
50+
.type __AArch64AbsLongThunk_near_function, %function
51+
__AArch64AbsLongThunk_near_function:
52+
b near_function
53+
# CHECK-INPUT-LABEL: <__AArch64AbsLongThunk_near_function>:
54+
# CHECK-INPUT-NEXT: b {{.*}} <near_function>
55+
.size __AArch64AbsLongThunk_near_function, .-__AArch64AbsLongThunk_near_function
3656

37-
## Check that the thunk was removed from .text and _start() calls foo()
57+
## Check that thunks were removed from .text, and _start calls functions
3858
## directly.
3959

40-
# CHECK-OUTPUT-NOT: __AArch64AbsLongThunk_foo
60+
# CHECK-OUTPUT-NOT: __AArch64AbsLongThunk_{{.*}}
4161

4262
.global _start
4363
.type _start, %function
4464
_start:
4565
# CHECK-INPUT-LABEL: <_start>:
4666
# CHECK-OUTPUT-LABEL: <_start>:
47-
bl __AArch64AbsLongThunk_foo
48-
# CHECK-INPUT-NEXT: bl {{.*}} <__AArch64AbsLongThunk_foo>
49-
# CHECK-OUTPUT-NEXT: bl {{.*}} <foo>
67+
bl __AArch64AbsLongThunk_far_function
68+
bl __AArch64AbsLongThunk_near_function
69+
# CHECK-INPUT-NEXT: bl {{.*}} <__AArch64AbsLongThunk_far_function>
70+
# CHECK-INPUT-NEXT: bl {{.*}} <__AArch64AbsLongThunk_near_function>
71+
# CHECK-OUTPUT-NEXT: bl {{.*}} <far_function>
72+
# CHECK-OUTPUT-NEXT: bl {{.*}} <near_function>
5073
ret
5174
.size _start, .-_start

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "ReturnConstRefFromParameterCheck.h"
10+
#include "clang/AST/Attrs.inc"
1011
#include "clang/AST/Expr.h"
1112
#include "clang/ASTMatchers/ASTMatchFinder.h"
1213
#include "clang/ASTMatchers/ASTMatchers.h"
@@ -15,14 +16,23 @@ using namespace clang::ast_matchers;
1516

1617
namespace clang::tidy::bugprone {
1718

19+
namespace {
20+
21+
AST_MATCHER(ParmVarDecl, hasLifetimeBoundAttr) {
22+
return Node.hasAttr<LifetimeBoundAttr>();
23+
}
24+
25+
} // namespace
26+
1827
void ReturnConstRefFromParameterCheck::registerMatchers(MatchFinder *Finder) {
1928
const auto DRef = ignoringParens(
2029
declRefExpr(
2130
to(parmVarDecl(hasType(hasCanonicalType(
2231
qualType(lValueReferenceType(pointee(
2332
qualType(isConstQualified()))))
2433
.bind("type"))),
25-
hasDeclContext(functionDecl().bind("owner")))
34+
hasDeclContext(functionDecl().bind("owner")),
35+
unless(hasLifetimeBoundAttr()))
2636
.bind("param")))
2737
.bind("dref"));
2838
const auto Func =

clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ namespace clang::tidy::readability {
1818
/// a call to `empty()`.
1919
///
2020
/// The emptiness of a container should be checked using the `empty()` method
21-
/// instead of the `size()` method. It is not guaranteed that `size()` is a
22-
/// constant-time function, and it is generally more efficient and also shows
23-
/// clearer intent to use `empty()`. Furthermore some containers may implement
24-
/// the `empty()` method but not implement the `size()` method. Using `empty()`
25-
/// whenever possible makes it easier to switch to another container in the
26-
/// future.
21+
/// instead of the `size()` method. It shows clearer intent to use `empty()`.
22+
/// Furthermore some containers may implement the `empty()` method but not
23+
/// implement the `size()` method. Using `empty()` whenever possible makes it
24+
/// easier to switch to another container in the future.
2725
class ContainerSizeEmptyCheck : public ClangTidyCheck {
2826
public:
2927
ContainerSizeEmptyCheck(StringRef Name, ClangTidyContext *Context);

clang-tools-extra/clangd/ClangdLSPServer.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,12 @@ void ClangdLSPServer::onInlayHint(const InlayHintsParams &Params,
14151415
std::move(Reply));
14161416
}
14171417

1418+
void ClangdLSPServer::onCallHierarchyOutgoingCalls(
1419+
const CallHierarchyOutgoingCallsParams &Params,
1420+
Callback<std::vector<CallHierarchyOutgoingCall>> Reply) {
1421+
Server->outgoingCalls(Params.item, std::move(Reply));
1422+
}
1423+
14181424
void ClangdLSPServer::applyConfiguration(
14191425
const ConfigurationSettings &Settings) {
14201426
// Per-file update to the compilation database.
@@ -1693,6 +1699,8 @@ void ClangdLSPServer::bindMethods(LSPBinder &Bind,
16931699
Bind.method("typeHierarchy/subtypes", this, &ClangdLSPServer::onSubTypes);
16941700
Bind.method("textDocument/prepareCallHierarchy", this, &ClangdLSPServer::onPrepareCallHierarchy);
16951701
Bind.method("callHierarchy/incomingCalls", this, &ClangdLSPServer::onCallHierarchyIncomingCalls);
1702+
if (Opts.EnableOutgoingCalls)
1703+
Bind.method("callHierarchy/outgoingCalls", this, &ClangdLSPServer::onCallHierarchyOutgoingCalls);
16961704
Bind.method("textDocument/selectionRange", this, &ClangdLSPServer::onSelectionRange);
16971705
Bind.method("textDocument/documentLink", this, &ClangdLSPServer::onDocumentLink);
16981706
Bind.method("textDocument/semanticTokens/full", this, &ClangdLSPServer::onSemanticTokens);

clang-tools-extra/clangd/ClangdLSPServer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ class ClangdLSPServer : private ClangdServer::Callbacks,
156156
void onCallHierarchyIncomingCalls(
157157
const CallHierarchyIncomingCallsParams &,
158158
Callback<std::vector<CallHierarchyIncomingCall>>);
159+
void onCallHierarchyOutgoingCalls(
160+
const CallHierarchyOutgoingCallsParams &,
161+
Callback<std::vector<CallHierarchyOutgoingCall>>);
159162
void onClangdInlayHints(const InlayHintsParams &,
160163
Callback<llvm::json::Value>);
161164
void onInlayHint(const InlayHintsParams &, Callback<std::vector<InlayHint>>);

0 commit comments

Comments
 (0)