Skip to content

Commit c9fd81a

Browse files
authored
Merge branch 'main' into users/ojhunt/PR-153884
2 parents 1d4875d + 34c7b7c commit c9fd81a

File tree

280 files changed

+3710
-2046
lines changed

Some content is hidden

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

280 files changed

+3710
-2046
lines changed

.ci/utils.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function at-exit {
2424
retcode=$?
2525

2626
mkdir -p artifacts
27+
sccache --show-stats
2728
sccache --show-stats >> artifacts/sccache_stats.txt
2829
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
2930
cp "${MONOREPO_ROOT}"/*.log artifacts/ || :

.github/workflows/spirv-tests.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ permissions:
44
contents: read
55

66
on:
7-
workflow_dispatch:
87
pull_request:
98
paths:
109
- 'llvm/lib/Target/SPIRV/**'
@@ -21,9 +20,27 @@ jobs:
2120
check_spirv:
2221
if: github.repository_owner == 'llvm'
2322
name: Test SPIR-V
24-
uses: ./.github/workflows/llvm-project-tests.yml
25-
with:
26-
build_target: check-llvm-codegen-spirv
27-
projects:
28-
extra_cmake_args: '-DLLVM_TARGETS_TO_BUILD="SPIRV" -DLLVM_INCLUDE_SPIRV_TOOLS_TESTS=ON'
29-
os_list: '["ubuntu-24.04"]'
23+
runs-on: ubuntu-24.04
24+
container:
25+
image: ghcr.io/llvm/ci-ubuntu-24.04:latest
26+
steps:
27+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
- name: Setup ccache
29+
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
30+
with:
31+
max-size: 2G
32+
key: spirv-ubuntu-24.04
33+
variant: sccache
34+
- name: Build and Test
35+
run: |
36+
mkdir build
37+
cmake -GNinja \
38+
-S llvm \
39+
-B build \
40+
-DCMAKE_BUILD_TYPE=Release \
41+
-DLLVM_ENABLE_ASSERTIONS=ON \
42+
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
43+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
44+
-DLLVM_TARGETS_TO_BUILD="SPIRV" \
45+
-DLLVM_INCLUDE_SPIRV_TOOLS_TESTS=ON
46+
ninja -C build check-llvm-codegen-spirv

bolt/lib/Core/BinaryContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2517,7 +2517,7 @@ BinaryContext::calculateEmittedSize(BinaryFunction &BF, bool FixBranches) {
25172517
// Clean-up the effect of the code emission.
25182518
for (const MCSymbol &Symbol : Assembler.symbols()) {
25192519
MCSymbol *MutableSymbol = const_cast<MCSymbol *>(&Symbol);
2520-
MutableSymbol->setUndefined();
2520+
MutableSymbol->setFragment(nullptr);
25212521
MutableSymbol->setIsRegistered(false);
25222522
}
25232523

bolt/lib/Passes/BinaryPasses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ Error CleanMCState::runOnFunctions(BinaryContext &BC) {
662662
if (S->isDefined()) {
663663
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: Symbol \"" << S->getName()
664664
<< "\" is already defined\n");
665-
const_cast<MCSymbol *>(S)->setUndefined();
665+
const_cast<MCSymbol *>(S)->setFragment(nullptr);
666666
}
667667
if (S->isRegistered()) {
668668
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: Symbol \"" << S->getName()

clang-tools-extra/clang-tidy/ClangTidy.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,10 @@ ClangTidyASTConsumerFactory::createASTConsumer(
424424
FinderOptions.CheckProfiling.emplace(Profiling->Records);
425425
}
426426

427+
// Avoid processing system headers, unless the user explicitly requests it
428+
if (!Context.getOptions().SystemHeaders.value_or(false))
429+
FinderOptions.IgnoreSystemHeaders = true;
430+
427431
std::unique_ptr<ast_matchers::MatchFinder> Finder(
428432
new ast_matchers::MatchFinder(std::move(FinderOptions)));
429433

clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ void PreferMemberInitializerCheck::check(
191191
if (!AssignmentToMember)
192192
continue;
193193
const FieldDecl *Field = AssignmentToMember->Field;
194+
// Skip if the field is inherited from a base class.
195+
if (Field->getParent() != Class)
196+
continue;
194197
const Expr *InitValue = AssignmentToMember->Init;
195198
updateAssignmentLevel(Field, InitValue, Ctor, AssignedFields);
196199
if (!canAdvanceAssignment(AssignedFields[Field]))

clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import json
2929
import multiprocessing
3030
import os
31+
import queue
3132
import re
3233
import shutil
3334
import subprocess
@@ -42,13 +43,6 @@
4243
except ImportError:
4344
yaml = None
4445

45-
is_py2 = sys.version[0] == "2"
46-
47-
if is_py2:
48-
import Queue as queue
49-
else:
50-
import queue as queue
51-
5246

5347
def run_tidy(task_queue, lock, timeout, failed_files):
5448
watchdog = None

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ Improvements to clang-query
104104
Improvements to clang-tidy
105105
--------------------------
106106

107+
- :program:`clang-tidy` no longer attemps to analyze code from system headers
108+
by default, greatly improving performance. This behavior is disabled if the
109+
`SystemHeaders` option is enabled.
110+
107111
- The :program:`run-clang-tidy.py` and :program:`clang-tidy-diff.py` scripts
108112
now run checks in parallel by default using all available hardware threads.
109113
Both scripts display the number of threads being used in their output.
@@ -163,6 +167,10 @@ Changes in existing checks
163167
an additional matcher that generalizes the copy-and-swap idiom pattern
164168
detection.
165169

170+
- Improved :doc:`cppcoreguidelines-prefer-member-initializer
171+
<clang-tidy/checks/cppcoreguidelines/prefer-member-initializer>` check to
172+
avoid false positives on inherited members in class templates.
173+
166174
- Improved :doc:`misc-header-include-cycle
167175
<clang-tidy/checks/misc/header-include-cycle>` check performance.
168176

clang-tools-extra/docs/clang-tidy/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ Diagnostics which have a corresponding warning option, are named
111111
``-Wliteral-conversion`` will be reported with check name
112112
``clang-diagnostic-literal-conversion``.
113113

114+
Clang compiler errors (such as syntax errors, semantic errors, or other failures
115+
that prevent Clang from compiling the code) are reported with the check name
116+
``clang-diagnostic-error``. These represent fundamental compilation failures that
117+
must be fixed before :program:`clang-tidy` can perform its analysis. Unlike other
118+
diagnostics, ``clang-diagnostic-error`` cannot be disabled, as :program:`clang-tidy`
119+
requires valid code to function.
120+
114121
The ``-fix`` flag instructs :program:`clang-tidy` to fix found errors if
115122
supported by corresponding checks.
116123

clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/prefer-member-initializer.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,3 +650,16 @@ struct InitFromBindingDecl {
650650
}
651651
};
652652
} // namespace GH82970
653+
654+
struct A {
655+
int m;
656+
};
657+
658+
struct B : A {
659+
B() { m = 0; }
660+
};
661+
662+
template <class T>
663+
struct C : A {
664+
C() { m = 0; }
665+
};

0 commit comments

Comments
 (0)