Skip to content

Commit 3da788c

Browse files
authored
Merge branch 'main' into funroll
2 parents fc3228a + 22687aa commit 3da788c

File tree

934 files changed

+45992
-20547
lines changed

Some content is hidden

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

934 files changed

+45992
-20547
lines changed

.ci/metrics/metrics.py

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -130,34 +130,6 @@ def get_per_workflow_metrics(
130130
workflow_jobs = workflow_run.jobs()
131131
if workflow_jobs.totalCount == 0:
132132
continue
133-
if workflow_jobs.totalCount > 1:
134-
raise ValueError(
135-
f"Encountered an unexpected number of jobs: {workflow_jobs.totalCount}"
136-
)
137-
138-
created_at = workflow_jobs[0].created_at
139-
started_at = workflow_jobs[0].started_at
140-
completed_at = workflow_jobs[0].completed_at
141-
142-
job_result = int(workflow_jobs[0].conclusion == "success")
143-
if job_result:
144-
# We still might want to mark the job as a failure if one of the steps
145-
# failed. This is required due to use setting continue-on-error in
146-
# the premerge pipeline to prevent sending emails while we are
147-
# testing the infrastructure.
148-
# TODO(boomanaiden154): Remove this once the premerge pipeline is no
149-
# longer in a testing state and we can directly assert the workflow
150-
# result.
151-
for step in workflow_jobs[0].steps:
152-
if step.conclusion != "success":
153-
job_result = 0
154-
break
155-
156-
queue_time = started_at - created_at
157-
run_time = completed_at - started_at
158-
159-
if run_time.seconds == 0:
160-
continue
161133

162134
if (
163135
workflows_to_track[workflow_run.name] is None
@@ -170,20 +142,45 @@ def get_per_workflow_metrics(
170142
):
171143
break
172144

173-
# The timestamp associated with the event is expected by Grafana to be
174-
# in nanoseconds.
175-
created_at_ns = int(created_at.timestamp()) * 10**9
176-
177-
workflow_metrics.append(
178-
JobMetrics(
179-
workflow_run.name,
180-
queue_time.seconds,
181-
run_time.seconds,
182-
job_result,
183-
created_at_ns,
184-
workflow_run.id,
145+
for workflow_job in workflow_jobs:
146+
created_at = workflow_job.created_at
147+
started_at = workflow_job.started_at
148+
completed_at = workflow_job.completed_at
149+
150+
job_result = int(workflow_job.conclusion == "success")
151+
if job_result:
152+
# We still might want to mark the job as a failure if one of the steps
153+
# failed. This is required due to use setting continue-on-error in
154+
# the premerge pipeline to prevent sending emails while we are
155+
# testing the infrastructure.
156+
# TODO(boomanaiden154): Remove this once the premerge pipeline is no
157+
# longer in a testing state and we can directly assert the workflow
158+
# result.
159+
for step in workflow_job.steps:
160+
if step.conclusion != "success":
161+
job_result = 0
162+
break
163+
164+
queue_time = started_at - created_at
165+
run_time = completed_at - started_at
166+
167+
if run_time.seconds == 0:
168+
continue
169+
170+
# The timestamp associated with the event is expected by Grafana to be
171+
# in nanoseconds.
172+
created_at_ns = int(created_at.timestamp()) * 10**9
173+
174+
workflow_metrics.append(
175+
JobMetrics(
176+
workflow_run.name + "-" + workflow_job.name,
177+
queue_time.seconds,
178+
run_time.seconds,
179+
job_result,
180+
created_at_ns,
181+
workflow_run.id,
182+
)
185183
)
186-
)
187184

188185
return workflow_metrics
189186

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
'generic-cxx26',
4949
'generic-modules'
5050
]
51-
cc: [ 'clang-19' ]
52-
cxx: [ 'clang++-19' ]
51+
cc: [ 'clang-20' ]
52+
cxx: [ 'clang++-20' ]
5353
include:
5454
- config: 'generic-gcc'
5555
cc: 'gcc-14'
@@ -88,18 +88,18 @@ jobs:
8888
'generic-cxx20',
8989
'generic-cxx23'
9090
]
91-
cc: [ 'clang-19' ]
92-
cxx: [ 'clang++-19' ]
91+
cc: [ 'clang-20' ]
92+
cxx: [ 'clang++-20' ]
9393
include:
9494
- config: 'generic-gcc-cxx11'
9595
cc: 'gcc-14'
9696
cxx: 'g++-14'
9797
- config: 'generic-cxx23'
98-
cc: 'clang-17'
99-
cxx: 'clang++-17'
100-
- config: 'generic-cxx26'
10198
cc: 'clang-18'
10299
cxx: 'clang++-18'
100+
- config: 'generic-cxx26'
101+
cc: 'clang-19'
102+
cxx: 'clang++-19'
103103
steps:
104104
- uses: actions/checkout@v4
105105
- name: ${{ matrix.config }}
@@ -169,8 +169,8 @@ jobs:
169169
- name: ${{ matrix.config }}
170170
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
171171
env:
172-
CC: clang-19
173-
CXX: clang++-19
172+
CC: clang-20
173+
CXX: clang++-20
174174
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
175175
if: always()
176176
with:

clang-tools-extra/clangd/Diagnostics.cpp

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,17 @@ std::vector<Diag> StoreDiags::take(const clang::tidy::ClangTidyContext *Tidy) {
577577
for (auto &Diag : Output) {
578578
if (const char *ClangDiag = getDiagnosticCode(Diag.ID)) {
579579
// Warnings controlled by -Wfoo are better recognized by that name.
580-
StringRef Warning = DiagnosticIDs::getWarningOptionForDiag(Diag.ID);
580+
StringRef Warning = [&] {
581+
if (OrigSrcMgr) {
582+
return OrigSrcMgr->getDiagnostics()
583+
.getDiagnosticIDs()
584+
->getWarningOptionForDiag(Diag.ID);
585+
}
586+
if (!DiagnosticIDs::IsCustomDiag(Diag.ID))
587+
return DiagnosticIDs{}.getWarningOptionForDiag(Diag.ID);
588+
return StringRef{};
589+
}();
590+
581591
if (!Warning.empty()) {
582592
Diag.Name = ("-W" + Warning).str();
583593
} else {
@@ -894,20 +904,23 @@ void StoreDiags::flushLastDiag() {
894904
Output.push_back(std::move(*LastDiag));
895905
}
896906

897-
bool isBuiltinDiagnosticSuppressed(unsigned ID,
898-
const llvm::StringSet<> &Suppress,
899-
const LangOptions &LangOpts) {
907+
bool isDiagnosticSuppressed(const clang::Diagnostic &Diag,
908+
const llvm::StringSet<> &Suppress,
909+
const LangOptions &LangOpts) {
900910
// Don't complain about header-only stuff in mainfiles if it's a header.
901911
// FIXME: would be cleaner to suppress in clang, once we decide whether the
902912
// behavior should be to silently-ignore or respect the pragma.
903-
if (ID == diag::pp_pragma_sysheader_in_main_file && LangOpts.IsHeaderFile)
913+
if (Diag.getID() == diag::pp_pragma_sysheader_in_main_file &&
914+
LangOpts.IsHeaderFile)
904915
return true;
905916

906-
if (const char *CodePtr = getDiagnosticCode(ID)) {
917+
if (const char *CodePtr = getDiagnosticCode(Diag.getID())) {
907918
if (Suppress.contains(normalizeSuppressedCode(CodePtr)))
908919
return true;
909920
}
910-
StringRef Warning = DiagnosticIDs::getWarningOptionForDiag(ID);
921+
StringRef Warning =
922+
Diag.getDiags()->getDiagnosticIDs()->getWarningOptionForDiag(
923+
Diag.getID());
911924
if (!Warning.empty() && Suppress.contains(Warning))
912925
return true;
913926
return false;

clang-tools-extra/clangd/Diagnostics.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ class StoreDiags : public DiagnosticConsumer {
181181
};
182182

183183
/// Determine whether a (non-clang-tidy) diagnostic is suppressed by config.
184-
bool isBuiltinDiagnosticSuppressed(unsigned ID,
185-
const llvm::StringSet<> &Suppressed,
186-
const LangOptions &);
184+
bool isDiagnosticSuppressed(const clang::Diagnostic &Diag,
185+
const llvm::StringSet<> &Suppressed,
186+
const LangOptions &);
187187
/// Take a user-specified diagnostic code, and convert it to a normalized form
188-
/// stored in the config and consumed by isBuiltinDiagnosticsSuppressed.
188+
/// stored in the config and consumed by isDiagnosticsSuppressed.
189189
///
190190
/// (This strips err_ and -W prefix so we can match with or without them.)
191191
llvm::StringRef normalizeSuppressedCode(llvm::StringRef);

clang-tools-extra/clangd/ParsedAST.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ void applyWarningOptions(llvm::ArrayRef<std::string> ExtraArgs,
342342
if (Enable) {
343343
if (Diags.getDiagnosticLevel(ID, SourceLocation()) <
344344
DiagnosticsEngine::Warning) {
345-
auto Group = DiagnosticIDs::getGroupForDiag(ID);
345+
auto Group = Diags.getDiagnosticIDs()->getGroupForDiag(ID);
346346
if (!Group || !EnabledGroups(*Group))
347347
continue;
348348
Diags.setSeverity(ID, diag::Severity::Warning, SourceLocation());
@@ -585,8 +585,8 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
585585
ASTDiags.setLevelAdjuster([&](DiagnosticsEngine::Level DiagLevel,
586586
const clang::Diagnostic &Info) {
587587
if (Cfg.Diagnostics.SuppressAll ||
588-
isBuiltinDiagnosticSuppressed(Info.getID(), Cfg.Diagnostics.Suppress,
589-
Clang->getLangOpts()))
588+
isDiagnosticSuppressed(Info, Cfg.Diagnostics.Suppress,
589+
Clang->getLangOpts()))
590590
return DiagnosticsEngine::Ignored;
591591

592592
auto It = OverriddenSeverity.find(Info.getID());

clang-tools-extra/clangd/Preamble.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,8 @@ buildPreamble(PathRef FileName, CompilerInvocation CI,
622622
PreambleDiagnostics.setLevelAdjuster([&](DiagnosticsEngine::Level DiagLevel,
623623
const clang::Diagnostic &Info) {
624624
if (Cfg.Diagnostics.SuppressAll ||
625-
isBuiltinDiagnosticSuppressed(Info.getID(), Cfg.Diagnostics.Suppress,
626-
CI.getLangOpts()))
625+
isDiagnosticSuppressed(Info, Cfg.Diagnostics.Suppress,
626+
CI.getLangOpts()))
627627
return DiagnosticsEngine::Ignored;
628628
switch (Info.getID()) {
629629
case diag::warn_no_newline_eof:

clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -298,20 +298,41 @@ TEST_F(ConfigCompileTests, DiagnosticSuppression) {
298298
"unreachable-code", "unused-variable",
299299
"typecheck_bool_condition",
300300
"unexpected_friend", "warn_alloca"));
301-
EXPECT_TRUE(isBuiltinDiagnosticSuppressed(
302-
diag::warn_unreachable, Conf.Diagnostics.Suppress, LangOptions()));
301+
clang::DiagnosticsEngine DiagEngine(new DiagnosticIDs, nullptr,
302+
new clang::IgnoringDiagConsumer);
303+
304+
using Diag = clang::Diagnostic;
305+
{
306+
auto D = DiagEngine.Report(diag::warn_unreachable);
307+
EXPECT_TRUE(isDiagnosticSuppressed(
308+
Diag{&DiagEngine, D}, Conf.Diagnostics.Suppress, LangOptions()));
309+
}
303310
// Subcategory not respected/suppressed.
304-
EXPECT_FALSE(isBuiltinDiagnosticSuppressed(
305-
diag::warn_unreachable_break, Conf.Diagnostics.Suppress, LangOptions()));
306-
EXPECT_TRUE(isBuiltinDiagnosticSuppressed(
307-
diag::warn_unused_variable, Conf.Diagnostics.Suppress, LangOptions()));
308-
EXPECT_TRUE(isBuiltinDiagnosticSuppressed(diag::err_typecheck_bool_condition,
309-
Conf.Diagnostics.Suppress,
310-
LangOptions()));
311-
EXPECT_TRUE(isBuiltinDiagnosticSuppressed(
312-
diag::err_unexpected_friend, Conf.Diagnostics.Suppress, LangOptions()));
313-
EXPECT_TRUE(isBuiltinDiagnosticSuppressed(
314-
diag::warn_alloca, Conf.Diagnostics.Suppress, LangOptions()));
311+
{
312+
auto D = DiagEngine.Report(diag::warn_unreachable_break);
313+
EXPECT_FALSE(isDiagnosticSuppressed(
314+
Diag{&DiagEngine, D}, Conf.Diagnostics.Suppress, LangOptions()));
315+
}
316+
{
317+
auto D = DiagEngine.Report(diag::warn_unused_variable);
318+
EXPECT_TRUE(isDiagnosticSuppressed(
319+
Diag{&DiagEngine, D}, Conf.Diagnostics.Suppress, LangOptions()));
320+
}
321+
{
322+
auto D = DiagEngine.Report(diag::err_typecheck_bool_condition);
323+
EXPECT_TRUE(isDiagnosticSuppressed(
324+
Diag{&DiagEngine, D}, Conf.Diagnostics.Suppress, LangOptions()));
325+
}
326+
{
327+
auto D = DiagEngine.Report(diag::err_unexpected_friend);
328+
EXPECT_TRUE(isDiagnosticSuppressed(
329+
Diag{&DiagEngine, D}, Conf.Diagnostics.Suppress, LangOptions()));
330+
}
331+
{
332+
auto D = DiagEngine.Report(diag::warn_alloca);
333+
EXPECT_TRUE(isDiagnosticSuppressed(
334+
Diag{&DiagEngine, D}, Conf.Diagnostics.Suppress, LangOptions()));
335+
}
315336

316337
Frag.Diagnostics.Suppress.emplace_back("*");
317338
EXPECT_TRUE(compileAndApply());

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ foreach(target aarch64-unknown-linux-gnu;armv7-unknown-linux-gnueabihf;i386-unkn
190190
set(RUNTIMES_${target}_LLVM_TOOLS_DIR "${CMAKE_BINARY_DIR}/bin" CACHE BOOL "")
191191
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
192192

193+
# Enable FatLTO for Linux and baremetal runtimes
194+
set(RUNTIMES_${target}_LLVM_ENABLE_LTO ON CACHE BOOL "")
195+
set(RUNTIMES_${target}_LLVM_ENABLE_FATLTO ON CACHE BOOL "")
196+
193197
# Use .build-id link.
194198
list(APPEND RUNTIME_BUILD_ID_LINK "${target}")
195199
endif()
@@ -272,6 +276,10 @@ if(FUCHSIA_SDK)
272276
set(RUNTIMES_${target}+asan+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
273277
set(RUNTIMES_${target}+asan+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
274278

279+
# Enable FatLTO for Fuchsia runtimes
280+
set(RUNTIMES_${target}_LLVM_ENABLE_LTO ON CACHE BOOL "")
281+
set(RUNTIMES_${target}_LLVM_ENABLE_FATLTO ON CACHE BOOL "")
282+
275283
# Use .build-id link.
276284
list(APPEND RUNTIME_BUILD_ID_LINK "${target}")
277285
endforeach()
@@ -369,6 +377,10 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv7em-none-eabi;armv8m.main-n
369377
set(RUNTIMES_${target}_LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
370378
set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
371379
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "libc;libcxx" CACHE STRING "")
380+
381+
# Enable FatLTO for baremetal runtimes
382+
set(RUNTIMES_${target}_LLVM_ENABLE_LTO ON CACHE BOOL "")
383+
set(RUNTIMES_${target}_LLVM_ENABLE_FATLTO ON CACHE BOOL "")
372384
endforeach()
373385

374386
foreach(target riscv32-unknown-elf)
@@ -420,6 +432,10 @@ foreach(target riscv32-unknown-elf)
420432
set(RUNTIMES_${target}_LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
421433
set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
422434
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "libc;libcxx" CACHE STRING "")
435+
436+
# Enable FatLTO for baremetal runtimes
437+
set(RUNTIMES_${target}_LLVM_ENABLE_LTO ON CACHE BOOL "")
438+
set(RUNTIMES_${target}_LLVM_ENABLE_FATLTO ON CACHE BOOL "")
423439
endforeach()
424440

425441
set(LLVM_BUILTIN_TARGETS "${BUILTIN_TARGETS}" CACHE STRING "")

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5198,6 +5198,11 @@ the configuration (without a prefix: ``Auto``).
51985198
**PenaltyBreakBeforeFirstCallParameter** (``Unsigned``) :versionbadge:`clang-format 3.7` :ref:`<PenaltyBreakBeforeFirstCallParameter>`
51995199
The penalty for breaking a function call after ``call(``.
52005200

5201+
.. _PenaltyBreakBeforeMemberAccess:
5202+
5203+
**PenaltyBreakBeforeMemberAccess** (``Unsigned``) :versionbadge:`clang-format 20` :ref:`<PenaltyBreakBeforeMemberAccess>`
5204+
The penalty for breaking before a member access operator (``.``, ``->``).
5205+
52015206
.. _PenaltyBreakComment:
52025207

52035208
**PenaltyBreakComment** (``Unsigned``) :versionbadge:`clang-format 3.7` :ref:`<PenaltyBreakComment>`

clang/docs/LanguageExtensions.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,7 @@ available in all language modes.
514514
__nullptr
515515
---------
516516

517-
``__nullptr`` is an alternate spelling for ``nullptr``, but is also available in
518-
C++ modes prior to C++11. Note that it's currently not availbale in C despite
519-
C23 having support for ``nullptr``.
517+
``__nullptr`` is an alternate spelling for ``nullptr``. It is available in all C and C++ language modes.
520518

521519
__signed, __signed__
522520
--------------------

0 commit comments

Comments
 (0)