Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4aaab27
Bump version to 21.1.6
c-rhodes Nov 4, 2025
4b2ac3f
[debugserver] Fix debugserver build on < macOS 10.15 (#166599)
JDevlieghere Nov 5, 2025
251d2d3
[Github] Backport ABI Workflow Changes to Release Branch
boomanaiden154 Nov 11, 2025
2fde0df
[clang][modules] Fix crash in enum visibility lookup for C++20 header…
naveen-seth Nov 4, 2025
69586a9
[RISCV] Correct the CFA offsets for stack probing. (#166616)
topperc Nov 6, 2025
6ca6454
[MachineCopyPropagation] Remove logic to recognise and delete no-op m…
asb Nov 11, 2025
2d631cc
[CMake][Release] Stop linking against stage1 runtimes (#164017)
tstellar Oct 22, 2025
a832a52
Reland "[LoongArch] Add `isSafeToMove` hook to prevent unsafe instruc…
heiher Nov 12, 2025
33e1a55
Bump version to 21.1.7.
dyung Nov 18, 2025
922c991
[clangd] Clangd running with `--experimental-modules-support` crashes…
slavek-kucera Aug 19, 2025
9ed1927
[server-llvm-21][MC] Fixing vector overflow
Nov 21, 2025
292dc2b
[LLD][COFF] Align EC code ranges to page boundaries (#168222)
cjacek Nov 17, 2025
f68f64e
Bump version to 21.1.8
tru Dec 2, 2025
b845b4c
[rtsan] Handle attributed IR function declarations (#169577)
davidtrevelyan Dec 1, 2025
94c40c6
[clang-format] Don't swap `(const override)` with QAS_Right (#167191)
owenca Nov 13, 2025
a565880
[clang-format] Fix a crash in AlignArrayOfStructures (#167099)
owenca Nov 10, 2025
4582a80
release/21.x: [clang-format] Fix a regression in annotating star befo…
owenca Dec 6, 2025
89bab96
Merge LLVM 21.x changes
inkreasing Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 12 additions & 23 deletions .github/workflows/libclang-abi-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
LLVM_VERSION_PATCH: ${{ steps.version.outputs.patch }}
steps:
- name: Checkout source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 250

Expand Down Expand Up @@ -84,6 +84,8 @@ jobs:
if: github.repository_owner == 'llvm'
needs: abi-dump-setup
runs-on: ubuntu-24.04
container:
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:f80125c0f767e29b8616210c0fd5cea2cd1f4fb6f2ca86d89f6016b6329b8d7f" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:9524b37c503f
strategy:
matrix:
name:
Expand All @@ -100,23 +102,12 @@ jobs:
repo: ${{ github.repository }}
steps:
- name: Install Ninja
uses: llvm/actions/install-ninja@main
- name: Install abi-compliance-checker
run: |
sudo apt-get update
sudo apt-get install -y abi-dumper autoconf pkg-config
- name: Install universal-ctags
run: |
git clone https://github.com/universal-ctags/ctags.git
cd ctags
./autogen.sh
./configure
sudo make install
uses: llvm/actions/install-ninja@42d80571b13f4599bbefbc7189728b64723c7f78 # main
- name: Download source code
uses: llvm/actions/get-llvm-project-src@main
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ matrix.ref }}
repo: ${{ matrix.repo }}
repository: ${{ matrix.repo }}
- name: Configure
run: |
mkdir install
Expand All @@ -131,41 +122,39 @@ jobs:
sed -i 's/LLVM_[0-9]\+/LLVM_NOVERSION/' $lib-${{ matrix.ref }}.abi
done
- name: Upload ABI file
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # 5.0.0
with:
name: ${{ matrix.name }}
path: '*${{ matrix.ref }}.abi'

abi-compare:
if: github.repository_owner == 'llvm'
runs-on: ubuntu-24.04
container:
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:f80125c0f767e29b8616210c0fd5cea2cd1f4fb6f2ca86d89f6016b6329b8d7f" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:9524b37c503f
needs:
- abi-dump-setup
- abi-dump
steps:
- name: Download baseline
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: build-baseline
path: build-baseline
- name: Download latest
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: build-latest
path: build-latest

- name: Install abi-compliance-checker
run: |
sudo apt-get update
sudo apt-get install -y abi-compliance-checker
- name: Compare ABI
run: |
for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do
abi-compliance-checker -lib $lib -old build-baseline/$lib*.abi -new build-latest/$lib*.abi
done
- name: Upload ABI Comparison
if: always()
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # 5.0.0
with:
name: compat-report-${{ github.sha }}
path: compat_reports/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: LLVM Tests
name: LLVM ABI Tests

permissions:
contents: read
Expand All @@ -10,13 +10,13 @@ on:
- 'release/**'
paths:
- 'llvm/**'
- '.github/workflows/llvm-tests.yml'
- '.github/workflows/llvm-abi-tests.yml'
pull_request:
branches:
- 'release/**'
paths:
- 'llvm/**'
- '.github/workflows/llvm-tests.yml'
- '.github/workflows/llvm-abi-tests.yml'

concurrency:
# Skip intermediate builds: always.
Expand All @@ -38,7 +38,7 @@ jobs:
LLVM_VERSION_PATCH: ${{ steps.version.outputs.patch }}
steps:
- name: Checkout source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 250

Expand Down Expand Up @@ -72,6 +72,8 @@ jobs:
if: github.repository_owner == 'llvm'
needs: abi-dump-setup
runs-on: ubuntu-24.04
container:
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:01e66b0847c1e9c88f0bd0492ed7c3374550a0730b48040f63888393f1ff6c13" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:bb0bd382ab2b"
strategy:
matrix:
name:
Expand All @@ -87,24 +89,11 @@ jobs:
ref: ${{ github.sha }}
repo: ${{ github.repository }}
steps:
- name: Install Ninja
uses: llvm/actions/install-ninja@main
- name: Install abi-compliance-checker
run: |
sudo apt-get update
sudo apt-get -y install abi-dumper autoconf pkg-config
- name: Install universal-ctags
run: |
git clone https://github.com/universal-ctags/ctags.git
cd ctags
./autogen.sh
./configure
sudo make install
- name: Download source code
uses: llvm/actions/get-llvm-project-src@main
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ matrix.ref }}
repo: ${{ matrix.repo }}
repository: ${{ matrix.repo }}
- name: Configure
run: |
mkdir install
Expand All @@ -128,45 +117,43 @@ jobs:
# Remove symbol versioning from dumps, so we can compare across major versions.
sed -i 's/LLVM_${{ matrix.llvm_version_major }}/LLVM_NOVERSION/' ${{ matrix.ref }}.abi
- name: Upload ABI file
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # 5.0.0
with:
name: ${{ matrix.name }}
path: ${{ matrix.ref }}.abi

- name: Upload symbol list file
if: matrix.name == 'build-baseline'
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # 5.0.0
with:
name: symbol-list
path: llvm.symbols

abi-compare:
if: github.repository_owner == 'llvm'
runs-on: ubuntu-24.04
container:
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:01e66b0847c1e9c88f0bd0492ed7c3374550a0730b48040f63888393f1ff6c13" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:bb0bd382ab2b
needs:
- abi-dump-setup
- abi-dump
steps:
- name: Download baseline
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: build-baseline
path: build-baseline
- name: Download latest
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: build-latest
path: build-latest
- name: Download symbol list
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: symbol-list
path: symbol-list

- name: Install abi-compliance-checker
run: |
sudo apt-get update
sudo apt-get -y install abi-compliance-checker
- name: Compare ABI
run: |
if [ -s symbol-list/llvm.symbols ]; then
Expand All @@ -179,7 +166,7 @@ jobs:
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"
- name: Upload ABI Comparison
if: always()
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # 5.0.0
with:
name: compat-report-${{ github.sha }}
path: compat_reports/
4 changes: 4 additions & 0 deletions clang-tools-extra/clangd/GlobalCompilationDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,10 @@ bool OverlayCDB::setCompileCommand(PathRef File,
std::unique_ptr<ProjectModules>
OverlayCDB::getProjectModules(PathRef File) const {
auto MDB = DelegatingCDB::getProjectModules(File);
if (!MDB) {
log("Failed to get compilation Database for {0}", File);
return {};
}
MDB->setCommandMangler([&Mangler = Mangler](tooling::CompileCommand &Command,
PathRef CommandPath) {
Mangler(Command, CommandPath);
Expand Down
66 changes: 66 additions & 0 deletions clang-tools-extra/clangd/test/modules_no_cdb.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# A smoke test to check that clangd works without compilation database
#
# Windows have different escaping modes.
# FIXME: We should add one for windows.
# UNSUPPORTED: system-windows
#
# RUN: rm -fr %t
# RUN: mkdir -p %t
# RUN: split-file %s %t
#
# RUN: sed -e "s|DIR|%/t|g" %t/definition.jsonrpc.tmpl > %t/definition.jsonrpc
#
# RUN: clangd -experimental-modules-support -lit-test < %t/definition.jsonrpc \
# RUN: | FileCheck -strict-whitespace %t/definition.jsonrpc

#--- A.h
void printA();

#--- Use.cpp
#include "A.h"
void foo() {
print
}

#--- definition.jsonrpc.tmpl
{
"jsonrpc": "2.0",
"id": 0,
"method": "initialize",
"params": {
"processId": 123,
"rootPath": "clangd",
"capabilities": {
"textDocument": {
"completion": {
"completionItem": {
"snippetSupport": true
}
}
}
},
"trace": "off"
}
}
---
{
"jsonrpc": "2.0",
"method": "textDocument/didOpen",
"params": {
"textDocument": {
"uri": "file://DIR/Use.cpp",
"languageId": "cpp",
"version": 1,
"text": "#include \"A.h\"\nvoid foo() {\n print\n}\n"
}
}
}

# CHECK: "message"{{.*}}printA{{.*}}(fix available)

---
{"jsonrpc":"2.0","id":1,"method":"textDocument/completion","params":{"textDocument":{"uri":"file://DIR/Use.cpp"},"context":{"triggerKind":1},"position":{"line":2,"character":6}}}
---
{"jsonrpc":"2.0","id":2,"method":"shutdown"}
---
{"jsonrpc":"2.0","method":"exit"}
39 changes: 30 additions & 9 deletions clang/cmake/caches/Release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ set(LLVM_RELEASE_ENABLE_LTO THIN CACHE STRING "")
set(LLVM_RELEASE_ENABLE_PGO ON CACHE BOOL "")
set(LLVM_RELEASE_ENABLE_RUNTIMES ${DEFAULT_RUNTIMES} CACHE STRING "")
set(LLVM_RELEASE_ENABLE_PROJECTS ${DEFAULT_PROJECTS} CACHE STRING "")

# This option enables linking stage2 clang statically with the runtimes
# (libc++ and compiler-rt) from stage1. In theory this will give the
# binaries better performance and make them more portable. However,
# this configuration is not well tested and causes build failures with
# the flang-rt tests cases, since the -stclib=libc++ flag does not
# get propagated to the runtimes build. There is also a separate
# issue on Darwin where clang will use the local libc++ headers, but
# link with system libc++ which can cause some incompatibilities.
# See https://github.com/llvm/llvm-project/issues/77653
# Because of these problems, this option will default to OFF.
set(LLVM_RELEASE_ENABLE_LINK_LOCAL_RUNTIMES OFF CACHE BOOL "")

# Note we don't need to add install here, since it is one of the pre-defined
# steps.
set(LLVM_RELEASE_FINAL_STAGE_TARGETS "clang;package;check-all;check-llvm;check-clang" CACHE STRING "")
Expand All @@ -55,8 +68,12 @@ set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")

set(STAGE1_PROJECTS "clang")

# Need to build compiler-rt in order to use PGO for later stages.
set(STAGE1_RUNTIMES "compiler-rt")
# Build all runtimes so we can statically link them into the stage2 compiler.
set(STAGE1_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind")
if(LLVM_RELEASE_ENABLE_LINK_LOCAL_RUNTIMES)
list(APPEND STAGE1_RUNTIMES "libcxx;libcxxabi;libunwind")
endif()

if (LLVM_RELEASE_ENABLE_PGO)
list(APPEND STAGE1_PROJECTS "lld")
Expand Down Expand Up @@ -118,21 +135,25 @@ set_instrument_and_final_stage_var(LLVM_ENABLE_LTO "${LLVM_RELEASE_ENABLE_LTO}"
if (LLVM_RELEASE_ENABLE_LTO)
set_instrument_and_final_stage_var(LLVM_ENABLE_LLD "ON" BOOL)
endif()
set_instrument_and_final_stage_var(LLVM_ENABLE_LIBCXX "ON" BOOL)
set_instrument_and_final_stage_var(LLVM_STATIC_LINK_CXX_STDLIB "ON" BOOL)
set(RELEASE_LINKER_FLAGS "-rtlib=compiler-rt --unwindlib=libunwind")
if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin")
set(RELEASE_LINKER_FLAGS "${RELEASE_LINKER_FLAGS} -static-libgcc")
if(LLVM_RELEASE_ENABLE_LINK_LOCAL_RUNTIMES)
set_instrument_and_final_stage_var(LLVM_ENABLE_LIBCXX "ON" BOOL)
set_instrument_and_final_stage_var(LLVM_STATIC_LINK_CXX_STDLIB "ON" BOOL)
set(RELEASE_LINKER_FLAGS "-rtlib=compiler-rt --unwindlib=libunwind")
if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin")
set(RELEASE_LINKER_FLAGS "${RELEASE_LINKER_FLAGS} -static-libgcc")
endif()
endif()

# Set flags for bolt
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
set(RELEASE_LINKER_FLAGS "${RELEASE_LINKER_FLAGS} -Wl,--emit-relocs,-znow")
endif()

set_instrument_and_final_stage_var(CMAKE_EXE_LINKER_FLAGS ${RELEASE_LINKER_FLAGS} STRING)
set_instrument_and_final_stage_var(CMAKE_SHARED_LINKER_FLAGS ${RELEASE_LINKER_FLAGS} STRING)
set_instrument_and_final_stage_var(CMAKE_MODULE_LINKER_FLAGS ${RELEASE_LINKER_FLAGS} STRING)
if (RELEASE_LINKER_FLAGS)
set_instrument_and_final_stage_var(CMAKE_EXE_LINKER_FLAGS ${RELEASE_LINKER_FLAGS} STRING)
set_instrument_and_final_stage_var(CMAKE_SHARED_LINKER_FLAGS ${RELEASE_LINKER_FLAGS} STRING)
set_instrument_and_final_stage_var(CMAKE_MODULE_LINKER_FLAGS ${RELEASE_LINKER_FLAGS} STRING)
endif()

# Final Stage Config (stage2)
set_final_stage_var(LLVM_ENABLE_RUNTIMES "${LLVM_RELEASE_ENABLE_RUNTIMES}" STRING)
Expand Down
17 changes: 13 additions & 4 deletions clang/lib/Format/QualifierAlignmentFixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ const FormatToken *LeftRightQualifierAlignmentFixer::analyzeRight(
// We only need to think about streams that begin with a qualifier.
if (Tok->isNot(QualifierType))
return Tok;

const auto *Next = Tok->getNextNonComment();

// Don't concern yourself if nothing follows the qualifier.
if (!Tok->Next)
if (!Next)
return Tok;

// Skip qualifiers to the left to find what preceeds the qualifiers.
Expand Down Expand Up @@ -247,9 +250,15 @@ const FormatToken *LeftRightQualifierAlignmentFixer::analyzeRight(
}();

// Find the last qualifier to the right.
const FormatToken *LastQual = Tok;
while (isQualifier(LastQual->getNextNonComment()))
LastQual = LastQual->getNextNonComment();
const auto *LastQual = Tok;
for (; isQualifier(Next); Next = Next->getNextNonComment())
LastQual = Next;

if (!LastQual || !Next ||
(LastQual->isOneOf(tok::kw_const, tok::kw_volatile) &&
Next->isOneOf(Keywords.kw_override, Keywords.kw_final))) {
return Tok;
}

// If this qualifier is to the right of a type or pointer do a partial sort
// and return.
Expand Down
Loading
Loading