Skip to content

Commit 57111d4

Browse files
committed
Merge from 'main' to 'sycl-web' (154 commits)
CONFLICT (content): Merge conflict in clang/lib/AST/DeclPrinter.cpp
2 parents 86008b8 + 2121bda commit 57111d4

File tree

594 files changed

+16944
-8768
lines changed

Some content is hidden

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

594 files changed

+16944
-8768
lines changed
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
name: LLVM ABI Tests
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- 'release/**'
11+
paths:
12+
- 'llvm/**'
13+
- '.github/workflows/llvm-tests.yml'
14+
pull_request:
15+
branches:
16+
- 'release/**'
17+
paths:
18+
- 'llvm/**'
19+
- '.github/workflows/llvm-tests.yml'
20+
21+
concurrency:
22+
# Skip intermediate builds: always.
23+
# Cancel intermediate builds: only if it is a pull request build.
24+
group: ${{ github.workflow }}-${{ github.ref }}
25+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
26+
27+
jobs:
28+
abi-dump-setup:
29+
if: github.repository_owner == 'llvm'
30+
runs-on: ubuntu-24.04
31+
outputs:
32+
BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }}
33+
ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
34+
BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }}
35+
BASELINE_VERSION_MINOR: ${{ steps.vars.outputs.BASELINE_VERSION_MINOR }}
36+
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.major }}
37+
LLVM_VERSION_MINOR: ${{ steps.version.outputs.minor }}
38+
LLVM_VERSION_PATCH: ${{ steps.version.outputs.patch }}
39+
steps:
40+
- name: Checkout source
41+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
42+
with:
43+
fetch-depth: 250
44+
45+
- name: Get LLVM version
46+
id: version
47+
uses: ./.github/workflows/get-llvm-version
48+
49+
- name: Setup Variables
50+
id: vars
51+
run: |
52+
# C++ ABI:
53+
# 18.1.0 we aren't doing ABI checks.
54+
# 18.1.1 We want to check 18.1.0.
55+
# C ABI:
56+
# 18.1.0 We want to check 17.0.x
57+
# 18.1.1 We want to check 18.1.0
58+
echo "BASELINE_VERSION_MINOR=1" >> "$GITHUB_OUTPUT"
59+
if [ ${{ steps.version.outputs.patch }} -eq 0 ]; then
60+
{
61+
echo "BASELINE_VERSION_MAJOR=$(( ${{ steps.version.outputs.major }} - 1))"
62+
echo "ABI_HEADERS=llvm-c"
63+
} >> "$GITHUB_OUTPUT"
64+
else
65+
{
66+
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.major }}"
67+
echo "ABI_HEADERS=."
68+
} >> "$GITHUB_OUTPUT"
69+
fi
70+
71+
abi-dump:
72+
if: github.repository_owner == 'llvm'
73+
needs: abi-dump-setup
74+
runs-on: ubuntu-24.04
75+
strategy:
76+
matrix:
77+
name:
78+
- build-baseline
79+
- build-latest
80+
include:
81+
- name: build-baseline
82+
llvm_version_major: ${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}
83+
ref: llvmorg-${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}.${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MINOR }}.0
84+
repo: llvm/llvm-project
85+
- name: build-latest
86+
llvm_version_major: ${{ needs.abi-dump-setup.outputs.LLVM_VERSION_MAJOR }}
87+
ref: ${{ github.sha }}
88+
repo: ${{ github.repository }}
89+
steps:
90+
- name: Install Ninja
91+
uses: llvm/actions/install-ninja@main
92+
- name: Install abi-compliance-checker
93+
run: |
94+
sudo apt-get update
95+
sudo apt-get -y install abi-dumper autoconf pkg-config
96+
- name: Install universal-ctags
97+
run: |
98+
git clone https://github.com/universal-ctags/ctags.git
99+
cd ctags
100+
./autogen.sh
101+
./configure
102+
sudo make install
103+
- name: Download source code
104+
uses: llvm/actions/get-llvm-project-src@main
105+
with:
106+
ref: ${{ matrix.ref }}
107+
repo: ${{ matrix.repo }}
108+
- name: Configure
109+
run: |
110+
mkdir install
111+
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="" -DLLVM_BUILD_LLVM_DYLIB=ON -DCMAKE_C_FLAGS_DEBUG="-g1 -Og" -DCMAKE_CXX_FLAGS_DEBUG="-g1 -Og" -DCMAKE_INSTALL_PREFIX="$(pwd)"/install llvm
112+
- name: Build
113+
# Need to run install-LLVM twice to ensure the symlink is installed (this is a bug).
114+
run: |
115+
ninja -C build install-LLVM
116+
ninja -C build install-LLVM
117+
ninja -C build install-llvm-headers
118+
- name: Dump ABI
119+
run: |
120+
if [ "${{ needs.abi-dump-setup.outputs.ABI_HEADERS }}" = "llvm-c" ]; then
121+
nm ./install/lib/libLLVM.so | awk "/T _LLVM/ || /T LLVM/ { print $3 }" | sort -u | sed -e "s/^_//g" | cut -d ' ' -f 3 > llvm.symbols
122+
# Even though the -symbols-list option doesn't seem to filter out the symbols, I believe it speeds up processing, so I'm leaving it in.
123+
export EXTRA_ARGS="-symbols-list llvm.symbols"
124+
else
125+
touch llvm.symbols
126+
fi
127+
abi-dumper $EXTRA_ARGS -lver ${{ matrix.ref }} -skip-cxx -public-headers ./install/include/${{ needs.abi-dump-setup.outputs.ABI_HEADERS }} -o ${{ matrix.ref }}.abi ./install/lib/libLLVM.so
128+
# Remove symbol versioning from dumps, so we can compare across major versions.
129+
sed -i 's/LLVM_${{ matrix.llvm_version_major }}/LLVM_NOVERSION/' ${{ matrix.ref }}.abi
130+
- name: Upload ABI file
131+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
132+
with:
133+
name: ${{ matrix.name }}
134+
path: ${{ matrix.ref }}.abi
135+
136+
- name: Upload symbol list file
137+
if: matrix.name == 'build-baseline'
138+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
139+
with:
140+
name: symbol-list
141+
path: llvm.symbols
142+
143+
abi-compare:
144+
if: github.repository_owner == 'llvm'
145+
runs-on: ubuntu-24.04
146+
needs:
147+
- abi-dump-setup
148+
- abi-dump
149+
steps:
150+
- name: Download baseline
151+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # 5.0.0
152+
with:
153+
name: build-baseline
154+
path: build-baseline
155+
- name: Download latest
156+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # 5.0.0
157+
with:
158+
name: build-latest
159+
path: build-latest
160+
- name: Download symbol list
161+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # 5.0.0
162+
with:
163+
name: symbol-list
164+
path: symbol-list
165+
166+
- name: Install abi-compliance-checker
167+
run: |
168+
sudo apt-get update
169+
sudo apt-get -y install abi-compliance-checker
170+
- name: Compare ABI
171+
run: |
172+
if [ -s symbol-list/llvm.symbols ]; then
173+
# This option doesn't seem to work with the ABI dumper, so passing it here.
174+
export EXTRA_ARGS="-symbols-list symbol-list/llvm.symbols"
175+
fi
176+
# FIXME: Reading of gzip'd abi files on the GitHub runners stop
177+
# working some time in March of 2021, likely due to a change in the
178+
# runner's environment.
179+
abi-compliance-checker $EXTRA_ARGS -l libLLVM.so -old build-baseline/*.abi -new build-latest/*.abi || test "${{ needs.abi-dump-setup.outputs.ABI_HEADERS }}" = "llvm-c"
180+
- name: Upload ABI Comparison
181+
if: always()
182+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
183+
with:
184+
name: compat-report-${{ github.sha }}
185+
path: compat_reports/

bolt/utils/dot2html/d3-graphviz-template.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
33
<body>
4-
<script src="https://d3js.org/d3.v5.min.js"></script>
5-
<script src="https://unpkg.com/@hpcc-js/wasm@0.3.11/dist/index.min.js"></script>
6-
<script src="https://unpkg.com/d3-graphviz@3.0.5/build/d3-graphviz.js"></script>
4+
<script src="https://d3js.org/d3.v7.min.js"></script>
5+
<script src="https://unpkg.com/@hpcc-js/wasm@2.20.0/dist/graphviz.umd.js"></script>
6+
<script src="https://unpkg.com/d3-graphviz@5.6.0/build/d3-graphviz.js"></script>
77
<div id="graph" style="text-align: center;"></div>
88
<script>
99
var dotSrc = `

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ static constexpr int UnsignedASCIIUpperBound = 127;
2121
SignedCharMisuseCheck::SignedCharMisuseCheck(StringRef Name,
2222
ClangTidyContext *Context)
2323
: ClangTidyCheck(Name, Context),
24-
CharTypdefsToIgnoreList(Options.get("CharTypdefsToIgnore", "")),
24+
CharTypedefsToIgnoreList(Options.get("CharTypedefsToIgnore", "")),
2525
DiagnoseSignedUnsignedCharComparisons(
2626
Options.get("DiagnoseSignedUnsignedCharComparisons", true)) {}
2727

2828
void SignedCharMisuseCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
29-
Options.store(Opts, "CharTypdefsToIgnore", CharTypdefsToIgnoreList);
29+
Options.store(Opts, "CharTypedefsToIgnore", CharTypedefsToIgnoreList);
3030
Options.store(Opts, "DiagnoseSignedUnsignedCharComparisons",
3131
DiagnoseSignedUnsignedCharComparisons);
3232
}
@@ -39,7 +39,7 @@ BindableMatcher<clang::Stmt> SignedCharMisuseCheck::charCastExpression(
3939
// (e.g. typedef char sal_Int8). In this case, we don't need to
4040
// worry about the misinterpretation of char values.
4141
const auto IntTypedef = qualType(hasDeclaration(typedefDecl(
42-
hasAnyName(utils::options::parseStringList(CharTypdefsToIgnoreList)))));
42+
hasAnyName(utils::options::parseStringList(CharTypedefsToIgnoreList)))));
4343

4444
auto CharTypeExpr = expr();
4545
if (IsSigned) {

clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SignedCharMisuseCheck : public ClangTidyCheck {
3535
const ast_matchers::internal::Matcher<clang::QualType> &IntegerType,
3636
const std::string &CastBindName) const;
3737

38-
const StringRef CharTypdefsToIgnoreList;
38+
const StringRef CharTypedefsToIgnoreList;
3939
const bool DiagnoseSignedUnsignedCharComparisons;
4040
};
4141

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,17 @@ Potentially Breaking Changes
5454
:program:`clang-tidy-20`. Users should use the check-specific options of the
5555
same name instead.
5656

57-
- Renamed :program:`clang-tidy`'s option name of check
58-
:doc:`bugprone-easily-swappable-parameters
59-
<clang-tidy/checks/bugprone/easily-swappable-parameters>` from
60-
``NamePrefixSuffixSilenceDissimilarityTreshold`` to
61-
``NamePrefixSuffixSilenceDissimilarityThreshold``,
62-
correcting a spelling mistake.
57+
- Renamed a few :program:`clang-tidy` check options, as they
58+
were misspelled:
59+
60+
- `NamePrefixSuffixSilenceDissimilarityTreshold` to
61+
`NamePrefixSuffixSilenceDissimilarityThreshold` in
62+
:doc:`bugprone-easily-swappable-parameters
63+
<clang-tidy/checks/bugprone/easily-swappable-parameters>`
64+
65+
- `CharTypdefsToIgnore` to `CharTypedefsToIgnore` in
66+
:doc:`bugprone-signed-char-misuse
67+
<clang-tidy/checks/bugprone/signed-char-misuse>`
6368

6469
Improvements to clangd
6570
----------------------

clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ so both arguments will have the same type.
107107
Options
108108
-------
109109

110-
.. option:: CharTypdefsToIgnore
110+
.. option:: CharTypedefsToIgnore
111111

112112
A semicolon-separated list of typedef names. In this list, we can list
113113
typedefs for ``char`` or ``signed char``, which will be ignored by the

clang-tools-extra/test/clang-tidy/checkers/bugprone/signed-char-misuse-with-option.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %check_clang_tidy %s bugprone-signed-char-misuse %t \
22
// RUN: -config='{CheckOptions: \
3-
// RUN: {bugprone-signed-char-misuse.CharTypdefsToIgnore: "sal_Int8;int8_t"}}' \
3+
// RUN: {bugprone-signed-char-misuse.CharTypedefsToIgnore: "sal_Int8;int8_t"}}' \
44
// RUN: --
55

66
///////////////////////////////////////////////////////////////////

clang/docs/ReleaseNotes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ AST Dumping Potentially Breaking Changes
123123

124124
``__atomic_test_and_set(p, 0)``
125125

126+
- Pretty-printing of templates with inherited (i.e. specified in a previous
127+
redeclaration) default arguments has been fixed.
128+
126129
Clang Frontend Potentially Breaking Changes
127130
-------------------------------------------
128131
- Members of anonymous unions/structs are now injected as ``IndirectFieldDecl``
@@ -250,6 +253,8 @@ Non-comprehensive list of changes in this release
250253

251254
- ``__builtin_assume_dereferenceable`` now accepts non-constant size operands.
252255

256+
- Fixed a crash when the second argument to ``__builtin_assume_aligned`` was not constant (#GH161314)
257+
253258
New Compiler Flags
254259
------------------
255260
- New option ``-fno-sanitize-debug-trap-reasons`` added to disable emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).
@@ -452,6 +457,7 @@ Bug Fixes to AST Handling
452457

453458
Miscellaneous Bug Fixes
454459
^^^^^^^^^^^^^^^^^^^^^^^
460+
- Fixed missing diagnostics of ``diagnose_if`` on templates involved in initialization. (#GH160776)
455461

456462
Miscellaneous Clang Crashes Fixed
457463
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/docs/analyzer/developer-docs/DebugChecks.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ The analyzer contains a number of checkers which can aid in debugging. Enable
99
them by using the "-analyzer-checker=" flag, followed by the name of the
1010
checker.
1111

12+
These checkers are especially useful when analyzing a specific function, using
13+
the `-analyze-function` flag. The flag accepts the function name for C code,
14+
like `-analyze-function=myfunction`.
15+
For C++ code, due to overloading, the function name must include the
16+
parameter list, like `-analyze-function="myfunction(int, _Bool)"`.
17+
18+
Note that `bool` must be spelled as `_Bool` in the parameter list.
19+
Refer to the output of `-analyzer-display-progress` to find the fully qualified
20+
function name.
21+
22+
There are cases when this name can still collide. For example with template
23+
function instances with non-deducible (aka. explicit) template parameters.
24+
In such cases, prefer passing a USR instead of a function name can resolve this
25+
ambiguity, like this: `-analyze-function="c:@S@Window@F@overloaded#I#"`.
26+
27+
Use the `clang-extdef-mapping` tool to find the USR for different functions.
1228

1329
General Analysis Dumpers
1430
========================

0 commit comments

Comments
 (0)