Skip to content

Commit 1d6db4a

Browse files
committed
Merge remote-tracking branch 'origin/main' into vplan-runtime-checks
2 parents 3eef601 + 0772a0b commit 1d6db4a

File tree

463 files changed

+21398
-12680
lines changed

Some content is hidden

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

463 files changed

+21398
-12680
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ jobs:
148148
cmake -B libunwind-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libunwind" -DLLVM_ENABLE_SPHINX=ON ./runtimes
149149
TZ=UTC ninja -C libunwind-build docs-libunwind-html
150150
mkdir built-docs/libunwind
151-
cp -r libunwind-build/docs/* built-docs/libunwind
151+
cp -r libunwind-build/libunwind/docs/* built-docs/libunwind
152152
- name: Build libcxx docs
153153
if: steps.docs-changed-subprojects.outputs.libcxx_any_changed == 'true'
154154
run: |
155155
cmake -B libcxx-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libcxxabi;libcxx;libunwind" -DLLVM_ENABLE_SPHINX=ON ./runtimes
156156
TZ=UTC ninja -C libcxx-build docs-libcxx-html
157157
mkdir built-docs/libcxx
158-
cp -r libcxx-build/docs/* built-docs/libcxx/
158+
cp -r libcxx-build/libcxx/docs/* built-docs/libcxx/
159159
- name: Build libc docs
160160
if: steps.docs-changed-subprojects.outputs.libc_any_changed == 'true'
161161
run: |

.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+
}

clang-tools-extra/clangd/XRefs.cpp

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,31 +121,17 @@ void logIfOverflow(const SymbolLocation &Loc) {
121121

122122
// Convert a SymbolLocation to LSP's Location.
123123
// TUPath is used to resolve the path of URI.
124-
// FIXME: figure out a good home for it, and share the implementation with
125-
// FindSymbols.
126124
std::optional<Location> toLSPLocation(const SymbolLocation &Loc,
127125
llvm::StringRef TUPath) {
128126
if (!Loc)
129127
return std::nullopt;
130-
auto Uri = URI::parse(Loc.FileURI);
131-
if (!Uri) {
132-
elog("Could not parse URI {0}: {1}", Loc.FileURI, Uri.takeError());
128+
auto LSPLoc = indexToLSPLocation(Loc, TUPath);
129+
if (!LSPLoc) {
130+
elog("{0}", LSPLoc.takeError());
133131
return std::nullopt;
134132
}
135-
auto U = URIForFile::fromURI(*Uri, TUPath);
136-
if (!U) {
137-
elog("Could not resolve URI {0}: {1}", Loc.FileURI, U.takeError());
138-
return std::nullopt;
139-
}
140-
141-
Location LSPLoc;
142-
LSPLoc.uri = std::move(*U);
143-
LSPLoc.range.start.line = Loc.Start.line();
144-
LSPLoc.range.start.character = Loc.Start.column();
145-
LSPLoc.range.end.line = Loc.End.line();
146-
LSPLoc.range.end.character = Loc.End.column();
147133
logIfOverflow(Loc);
148-
return LSPLoc;
134+
return *LSPLoc;
149135
}
150136

151137
SymbolLocation toIndexLocation(const Location &Loc, std::string &URIStorage) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ namespace {
2424

2525
std::unique_ptr<SymbolIndex> buildMem() {
2626
return loadIndex(IndexFilename, clang::clangd::SymbolOrigin::Static,
27-
/*UseDex=*/false);
27+
/*UseDex=*/false, /*SupportContainedRefs=*/true);
2828
}
2929

3030
std::unique_ptr<SymbolIndex> buildDex() {
3131
return loadIndex(IndexFilename, clang::clangd::SymbolOrigin::Static,
32-
/*UseDex=*/true);
32+
/*UseDex=*/true, /*SupportContainedRefs=*/true);
3333
}
3434

3535
// Reads JSON array of serialized FuzzyFindRequest's from user-provided file.

clang-tools-extra/clangd/index/remote/Index.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ message Relation {
133133
}
134134

135135
message ContainedRefsRequest {
136-
required string id = 1;
136+
optional string id = 1;
137137
optional uint32 limit = 2;
138138
}
139139

@@ -145,7 +145,7 @@ message ContainedRefsReply {
145145
}
146146

147147
message ContainedRef {
148-
required SymbolLocation location = 1;
149-
required uint32 kind = 2;
150-
required string symbol = 3;
148+
optional SymbolLocation location = 1;
149+
optional uint32 kind = 2;
150+
optional string symbol = 3;
151151
}

clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ Marshaller::fromProtobuf(const RefsRequest *Message) {
129129
llvm::Expected<clangd::ContainedRefsRequest>
130130
Marshaller::fromProtobuf(const ContainedRefsRequest *Message) {
131131
clangd::ContainedRefsRequest Req;
132+
if (!Message->has_id())
133+
return error("ContainedRefsRequest requires an id.");
132134
auto ID = SymbolID::fromStr(Message->id());
133135
if (!ID)
134136
return ID.takeError();
@@ -207,6 +209,12 @@ llvm::Expected<clangd::Ref> Marshaller::fromProtobuf(const Ref &Message) {
207209
llvm::Expected<clangd::ContainedRefsResult>
208210
Marshaller::fromProtobuf(const ContainedRef &Message) {
209211
clangd::ContainedRefsResult Result;
212+
if (!Message.has_location())
213+
return error("ContainedRef must have a location.");
214+
if (!Message.has_kind())
215+
return error("ContainedRef must have a kind.");
216+
if (!Message.has_symbol())
217+
return error("ContainedRef must have a symbol.");
210218
auto Location = fromProtobuf(Message.location());
211219
if (!Location)
212220
return Location.takeError();

clang/cmake/caches/CrossWinToARMLinux.cmake

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ endif()
9696
if (NOT DEFINED TOOLCHAIN_SHARED_LIBS)
9797
set(TOOLCHAIN_SHARED_LIBS OFF)
9898
endif()
99-
99+
# Enable usage of the static libunwind and libc++abi libraries.
100+
if (NOT DEFINED TOOLCHAIN_USE_STATIC_LIBS)
101+
set(TOOLCHAIN_USE_STATIC_LIBS ON)
102+
endif()
103+
100104
if (NOT DEFINED LLVM_TARGETS_TO_BUILD)
101105
if ("${TOOLCHAIN_TARGET_TRIPLE}" MATCHES "^(armv|arm32)+")
102106
set(LLVM_TARGETS_TO_BUILD "ARM" CACHE STRING "")
@@ -206,7 +210,7 @@ set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_USE_COMPILER_RT
206210
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_ENABLE_SHARED ${TOOLCHAIN_SHARED_LIBS} CACHE BOOL "")
207211

208212
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
209-
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
213+
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_ENABLE_STATIC_UNWINDER ${TOOLCHAIN_USE_STATIC_LIBS} CACHE BOOL "")
210214
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
211215
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
212216
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_ENABLE_SHARED ${TOOLCHAIN_SHARED_LIBS} CACHE BOOL "")
@@ -217,7 +221,7 @@ set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ABI_VERSION
217221
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_CXX_ABI "libcxxabi" CACHE STRING "") #!!!
218222
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "")
219223
# Merge libc++ and libc++abi libraries into the single libc++ library file.
220-
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
224+
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ${TOOLCHAIN_USE_STATIC_LIBS} CACHE BOOL "")
221225
# Forcely disable the libc++ benchmarks on Windows build hosts
222226
# (current benchmark test configuration does not support the cross builds there).
223227
if (WIN32)

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64;RISCV CACHE STRING "")
66

77
set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
88

9-
set(_FUCHSIA_ENABLE_PROJECTS "bolt;clang;clang-tools-extra;libc;lld;llvm;polly")
9+
set(_FUCHSIA_ENABLE_PROJECTS "bolt;clang;clang-tools-extra;lld;llvm;polly")
1010
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
1111

1212
set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
@@ -25,8 +25,6 @@ set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")
2525
set(LLVM_FORCE_BUILD_RUNTIME ON CACHE BOOL "")
2626
set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
2727
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
28-
set(LLVM_LIBC_FULL_BUILD ON CACHE BOOL "")
29-
set(LIBC_HDRGEN_ONLY ON CACHE BOOL "")
3028
set(LLVM_STATIC_LINK_CXX_STDLIB ON CACHE BOOL "")
3129
set(LLVM_USE_RELATIVE_PATHS_IN_FILES ON CACHE BOOL "")
3230
set(LLDB_ENABLE_CURSES OFF CACHE BOOL "")

clang/cmake/caches/Fuchsia.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64;RISCV CACHE STRING "")
66

77
set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
88

9-
set(_FUCHSIA_ENABLE_PROJECTS "bolt;clang;clang-tools-extra;libc;lld;llvm;polly")
9+
set(_FUCHSIA_ENABLE_PROJECTS "bolt;clang;clang-tools-extra;lld;llvm;polly")
1010

1111
set(LLVM_ENABLE_DIA_SDK OFF CACHE BOOL "")
1212
set(LLVM_ENABLE_LIBEDIT OFF CACHE BOOL "")
@@ -17,7 +17,6 @@ set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
1717
set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
1818
set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
1919
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
20-
set(LIBC_HDRGEN_ONLY ON CACHE BOOL "")
2120
set(LLVM_USE_RELATIVE_PATHS_IN_FILES ON CACHE BOOL "")
2221
set(LLDB_ENABLE_CURSES OFF CACHE BOOL "")
2322
set(LLDB_ENABLE_LIBEDIT OFF CACHE BOOL "")

clang/docs/ReleaseNotes.rst

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ code bases.
5252
`migrate to Vulkan <https://developer.android.com/guide/topics/renderscript/migrate>`_
5353
or other options.
5454

55+
- Clang now emits distinct type-based alias analysis tags for incompatible
56+
pointers by default, enabling more powerful alias analysis when accessing
57+
pointer types. This change may silently change code behavior for code
58+
containing strict-aliasing violations. The new default behavior can be
59+
disabled using ``-fno-pointer-tbaa``.
60+
5561
C/C++ Language Potentially Breaking Changes
5662
-------------------------------------------
5763

@@ -381,7 +387,7 @@ Non-comprehensive list of changes in this release
381387

382388
- The new builtin ``__builtin_counted_by_ref`` was added. In contexts where the
383389
programmer needs access to the ``counted_by`` attribute's field, but it's not
384-
available --- e.g. in macros. For instace, it can be used to automatically
390+
available --- e.g. in macros. For instance, it can be used to automatically
385391
set the counter during allocation in the Linux kernel:
386392

387393
.. code-block:: c
@@ -419,6 +425,9 @@ New Compiler Flags
419425
existing ``-fno-c++-static-destructors`` flag) skips all static
420426
destructors registration.
421427

428+
- The ``-Warray-compare`` warning has been added to warn about array comparison
429+
on versions older than C++20.
430+
422431
Deprecated Compiler Flags
423432
-------------------------
424433

@@ -443,7 +452,7 @@ Modified Compiler Flags
443452
libraries remains unchanged.
444453

445454
- The ``-Wnontrivial-memcall`` warning has been added to warn about
446-
passing non-trivially-copyable destrination parameter to ``memcpy``,
455+
passing non-trivially-copyable destination parameter to ``memcpy``,
447456
``memset`` and similar functions for which it is a documented undefined
448457
behavior. It is implied by ``-Wnontrivial-memaccess``
449458

@@ -678,7 +687,7 @@ Bug Fixes to C++ Support
678687
- Fixed a failed assertion when checking invalid delete operator declaration. (#GH96191)
679688
- Fix a crash when checking destructor reference with an invalid initializer. (#GH97230)
680689
- Clang now correctly parses potentially declarative nested-name-specifiers in pointer-to-member declarators.
681-
- Fix a crash when checking the initialzier of an object that was initialized
690+
- Fix a crash when checking the initializer of an object that was initialized
682691
with a string literal. (#GH82167)
683692
- Fix a crash when matching template template parameters with templates which have
684693
parameters of different class type. (#GH101394)
@@ -722,7 +731,7 @@ Bug Fixes to C++ Support
722731
- Fix a crash when using ``source_location`` in the trailing return type of a lambda expression. (#GH67134)
723732
- A follow-up fix was added for (#GH61460), as the previous fix was not entirely correct. (#GH86361), (#GH112352)
724733
- Fixed a crash in the typo correction of an invalid CTAD guide. (#GH107887)
725-
- Fixed a crash when clang tries to subtitute parameter pack while retaining the parameter
734+
- Fixed a crash when clang tries to substitute parameter pack while retaining the parameter
726735
pack. (#GH63819), (#GH107560)
727736
- Fix a crash when a static assert declaration has an invalid close location. (#GH108687)
728737
- Avoided a redundant friend declaration instantiation under a certain ``consteval`` context. (#GH107175)
@@ -770,6 +779,7 @@ Bug Fixes to C++ Support
770779
- Fixed an assertion failure caused by mangled names with invalid identifiers. (#GH112205)
771780
- Fixed an incorrect lambda scope of generic lambdas that caused Clang to crash when computing potential lambda
772781
captures at the end of a full expression. (#GH115931)
782+
- Clang no longer rejects deleting a pointer of incomplete enumeration type. (#GH99278)
773783

774784
Bug Fixes to AST Handling
775785
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1042,7 +1052,7 @@ Moved checkers
10421052
``bugprone-branch-clone``.
10431053

10441054
- The checker ``alpha.security.MallocOverflow`` was deleted because it was
1045-
badly implemented and its agressive logic produced too many false positives.
1055+
badly implemented and its aggressive logic produced too many false positives.
10461056
To detect too large arguments passed to malloc, consider using the checker
10471057
``alpha.taint.TaintedAlloc``.
10481058

0 commit comments

Comments
 (0)