Skip to content

Commit 4e1fa51

Browse files
Merge branch 'ldc-developers:master' into dladdr-callstack
2 parents 3c679f5 + b4d6fc5 commit 4e1fa51

Some content is hidden

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

41 files changed

+435
-156
lines changed

.github/actions/1-setup/action.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
2424
packages=( \
2525
git-core cmake g++ \
26-
libcurl4 libxml2-dev libzstd-dev \
26+
libcurl4 libzstd-dev \
2727
curl gdb p7zip-full tzdata unzip zip python3-pip \
2828
)
2929
if [[ $arch == x86_64 ]]; then
@@ -37,30 +37,30 @@ runs:
3737
# Make sure to link libzstd statically
3838
sudo rm /usr/lib/$arch-linux-gnu/libzstd.so
3939
40-
- name: 'Linux: Install clang 19 from apt.llvm.org'
40+
- name: 'Linux: Install clang 20 from apt.llvm.org'
4141
if: runner.os == 'Linux'
4242
shell: bash
4343
run: |
4444
set -eux
4545
cd ..
4646
curl -fL --retry 3 --max-time 30 -O https://apt.llvm.org/llvm.sh
47-
sudo bash llvm.sh 19
47+
sudo bash llvm.sh 20
4848
for tool in clang clang++ ld.lld; do
49-
sudo ln -sf $tool-19 /usr/bin/$tool
49+
sudo ln -sf $tool-20 /usr/bin/$tool
5050
$tool --version
5151
done
52-
- name: 'macOS arm64: Install Homebrew clang 19' # see mimalloc comment in ../3-build-native/action.yml
52+
- name: 'macOS arm64: Install Homebrew clang 20' # see mimalloc comment in ../3-build-native/action.yml
5353
if: runner.os == 'macOS' && inputs.arch == 'arm64'
5454
shell: bash
55-
run: brew install llvm@19
56-
- name: 'Windows: Install clang v19.1.3 from GitHub'
55+
run: brew install llvm@20
56+
- name: 'Windows: Install clang v20.1.3 from GitHub'
5757
if: runner.os == 'Windows'
5858
shell: bash
5959
run: |
6060
set -eux
6161
cd ..
6262
curl -fL --retry 3 --max-time 300 -o clang.exe \
63-
https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.3/LLVM-19.1.3-win64.exe
63+
https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.3/LLVM-20.1.3-win64.exe
6464
./clang.exe //S # double-slash for bash
6565
rm clang.exe
6666
# C:\Program Files\LLVM\bin should already be in PATH
@@ -119,9 +119,6 @@ runs:
119119
sudo ln -sf ld.lld /usr/bin/ld
120120
ld --version
121121
122-
- name: Install ninja v1.12.1
123-
uses: Ahajha/gha-setup-ninja@69595b0cf872acdad8ce599142fbdc88724b9a2b
124-
125122
- name: Install D host compiler
126123
uses: dlang-community/setup-dlang@v1
127124
with:

.github/actions/3-build-cross/android-llvm-config.in

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,36 +45,36 @@ prefix=@LLVM_INSTALL_DIR@
4545
has_rtti=NO
4646
CPPFLAGS="-I${prefix}/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
4747
CFLAGS="${CPPFLAGS} ${CFLAGS}"
48-
CXXFLAGS="${CFLAGS} -std=c++17 -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables"
48+
CXXFLAGS="${CFLAGS} -std=c++17 -fno-exceptions -funwind-tables"
4949
if [ "$has_rtti" != "YES" ]; then CXXFLAGS="$CXXFLAGS -fno-rtti"; fi
5050
LDFLAGS="-L${prefix}/lib"
5151
LIBFILE="${prefix}/lib/libLLVM-$version.so"
5252

5353
components="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils \
5454
aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils \
55-
asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen codegendata codegentypes core coroutines coverage \
55+
asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard cgdata codegen codegentypes core coroutines coverage \
5656
debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerclassic dwarflinkerparallel dwp \
57-
engine executionengine extensions filecheck frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hipstdpar instcombine \
57+
engine executionengine extensions filecheck frontendatomic frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hipstdpar instcombine \
5858
instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler \
5959
mcjit mcparser mirparser native nativecodegen objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess \
60-
passes profiledata remarks runtimedyld sandboxir scalaropts selectiondag spirv spirvanalysis spirvcodegen spirvdesc spirvinfo support symbolize tablegen target targetparser textapi \
60+
passes profiledata remarks runtimedyld sandboxir scalaropts selectiondag spirv spirvanalysis spirvcodegen spirvdesc spirvinfo support symbolize tablegen target targetparser telemetry textapi \
6161
textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler \
6262
webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info \
6363
x86targetmca xray"
64-
static_libs="-lLLVMWindowsManifest -lLLVMXRay -lLLVMLibDriver -lLLVMDlltoolDriver -lLLVMTextAPIBinaryReader -lLLVMCoverage -lLLVMLineEditor \
65-
-lLLVMSandboxIR -lLLVMSPIRVCodeGen -lLLVMSPIRVDesc -lLLVMSPIRVInfo -lLLVMSPIRVAnalysis \
66-
-lLLVMX86TargetMCA -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMWebAssemblyDisassembler \
64+
static_libs="-lLLVMWindowsManifest -lLLVMXRay -lLLVMLibDriver -lLLVMDlltoolDriver -lLLVMTelemetry -lLLVMTextAPIBinaryReader -lLLVMCoverage -lLLVMLineEditor \
65+
-lLLVMX86TargetMCA -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info \
66+
-lLLVMSPIRVCodeGen -lLLVMSPIRVDesc -lLLVMSPIRVInfo -lLLVMSPIRVAnalysis -lLLVMWebAssemblyDisassembler \
6767
-lLLVMWebAssemblyAsmParser -lLLVMWebAssemblyCodeGen -lLLVMWebAssemblyUtils -lLLVMWebAssemblyDesc -lLLVMWebAssemblyInfo -lLLVMARMDisassembler \
6868
-lLLVMARMAsmParser -lLLVMARMCodeGen -lLLVMARMDesc -lLLVMARMUtils -lLLVMARMInfo -lLLVMAArch64Disassembler \
6969
-lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMOrcDebugging -lLLVMOrcJIT \
7070
-lLLVMWindowsDriver -lLLVMMCJIT -lLLVMJITLink -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared \
7171
-lLLVMDWP -lLLVMDebugInfoLogicalView -lLLVMDebugInfoGSYM -lLLVMOption -lLLVMObjectYAML -lLLVMObjCopy -lLLVMMCA \
7272
-lLLVMMCDisassembler -lLLVMLTO -lLLVMPasses -lLLVMHipStdPar -lLLVMCFGuard -lLLVMCoroutines -lLLVMipo \
73-
-lLLVMVectorize -lLLVMLinker -lLLVMInstrumentation -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMFrontendOpenACC -lLLVMFrontendHLSL -lLLVMFrontendDriver -lLLVMExtensions \
74-
-lLLVMDWARFLinkerParallel -lLLVMDWARFLinkerClassic -lLLVMDWARFLinker -lLLVMCodeGenData -lLLVMGlobalISel -lLLVMMIRParser -lLLVMAsmPrinter -lLLVMSelectionDAG \
75-
-lLLVMCodeGen -lLLVMTarget -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMIRPrinter -lLLVMInterfaceStub -lLLVMFileCheck -lLLVMFuzzMutate \
73+
-lLLVMVectorize -lLLVMSandboxIR -lLLVMLinker -lLLVMInstrumentation -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMFrontendOpenACC -lLLVMFrontendHLSL -lLLVMFrontendDriver -lLLVMFrontendAtomic -lLLVMExtensions \
74+
-lLLVMDWARFLinkerParallel -lLLVMDWARFLinkerClassic -lLLVMDWARFLinker -lLLVMGlobalISel -lLLVMMIRParser -lLLVMAsmPrinter -lLLVMSelectionDAG \
75+
-lLLVMCodeGen -lLLVMTarget -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMCGData -lLLVMIRPrinter -lLLVMInterfaceStub -lLLVMFileCheck -lLLVMFuzzMutate \
7676
-lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis \
77-
-lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView \
77+
-lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoCodeView -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC \
7878
-lLLVMBitReader -lLLVMFuzzerCLI -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMTableGen -lLLVMSupport \
7979
-lLLVMDemangle"
8080
shared_libs="-lLLVM-$version"

.github/actions/6-integration-test/action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ runs:
4545
run: |
4646
set -eux
4747
cd ..
48-
if type -P apk &>/dev/null; then
49-
exit 0 # Alpine: disabled dynamic-compile support
48+
if ! ls installed/lib/*ldc-jit-rt* &>/dev/null; then
49+
echo "ldc-jit-rt library not found, skipping test"
50+
exit 0
5051
fi
5152
if [[ '${{ runner.os }}' == Windows ]]; then
5253
# add ldc-jit.dll dir to PATH

.github/actions/merge-windows/action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ runs:
6868
ldc2-multilib\bin\ldc2 -link-defaultlib-shared -m32 -run hello.d || exit /b
6969
7070
# preliminary arm64 cross-compilation support
71-
- name: Install ninja v1.12.1
72-
uses: Ahajha/gha-setup-ninja@69595b0cf872acdad8ce599142fbdc88724b9a2b
7371
- name: Set VSDIR env variable
7472
shell: bash
7573
run: echo "VSDIR=$(vswhere -latest -property installationPath)" >> $GITHUB_ENV

.github/workflows/main.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
env:
17-
LLVM_VERSION: 19.1.7
17+
LLVM_VERSION: 20.1.5
1818

1919
jobs:
2020
build-native:
@@ -82,11 +82,11 @@ jobs:
8282
with_pgo: true
8383

8484
- job_name: macOS arm64
85-
os: macos-14
85+
os: macos-15
8686
arch: arm64
8787
extra_cmake_flags: >-
88-
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm@19/bin/clang
89-
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@19/bin/clang++
88+
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm@20/bin/clang
89+
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@20/bin/clang++
9090
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
9191
-DEXTRA_CXXFLAGS=-flto=full
9292
with_pgo: true
@@ -159,9 +159,6 @@ jobs:
159159
uses: ./.github/actions/helper-build-gdb
160160
with:
161161
arch: ${{ matrix.arch }}
162-
- name: 'macOS arm64: Switch to Xcode 16'
163-
if: runner.os == 'macOS' && matrix.arch == 'arm64'
164-
run: sudo xcode-select -switch /Applications/Xcode_16.1.app
165162
- name: Build bootstrap LDC
166163
uses: ./.github/actions/2-build-bootstrap
167164
with:

.github/workflows/supported_llvm_versions.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
include:
22+
- job_name: Ubuntu 24.04, LLVM 19, latest LDC beta
23+
os: ubuntu-24.04
24+
host_dc: ldc-beta
25+
llvm_version: 19
26+
cmake_flags: -DRT_SUPPORT_SANITIZERS=ON
2227
- job_name: Ubuntu 24.04, LLVM 18, bootstrap LDC
2328
os: ubuntu-24.04
2429
host_dc: ldc-1.19.0
2530
llvm_version: 18
26-
cmake_flags: -DRT_SUPPORT_SANITIZERS=ON -DPHOBOS_SYSTEM_ZLIB=ON
31+
cmake_flags: -DBUILD_SHARED_LIBS=OFF -DPHOBOS_SYSTEM_ZLIB=ON
2732
- job_name: macOS 14, LLVM 17, latest LDC beta
2833
os: macos-14
2934
host_dc: ldc-beta
@@ -49,8 +54,6 @@ jobs:
4954
with:
5055
submodules: true
5156
fetch-depth: 50
52-
- name: Install ninja
53-
uses: symmetryinvestments/gha-setup-ninja@v2
5457
- name: Install D host compiler
5558
uses: dlang-community/setup-dlang@v1
5659
with:

CHANGELOG.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
11
# LDC master
22

33
#### Big news
4-
- Frontend, druntime and Phobos are at version [2.111.0+](https://dlang.org/changelog/2.111.0.html). (#4877, #4910, #4918)
4+
- **Breaking change for dcompute**: The special `@kernel` UDA is now a function and _**requires**_ parentheses as in `@kernel() void foo(){}`. Optionally you can provide launch dimensions, `@kernel([2,4,8])`, to specify to the compute runtime how the kernel is intended to be launched.
5+
6+
#### Platform support
7+
8+
#### Bug fixes
9+
10+
# LDC 1.41.0 (2025-06-07)
11+
12+
#### Big news
13+
- Frontend, druntime and Phobos are at version [2.111.0+](https://dlang.org/changelog/2.111.0.html). (#4877, #4910, #4918, #4941)
14+
- Support for [LLVM 20](https://releases.llvm.org/20.1.0/docs/ReleaseNotes.html). The prebuilt packages use v20.1.5. (#4843, #4911, #4935)
15+
- The dynamic-compile (JIT) feature has regressed with LLVM 20. Use LLVM 18 or 19 for that feature.
516
- Keep frame pointers by default with `-O` for some targets, notably AArch64 (except Windows), x86_64 (except Windows and glibc Linux), Windows x86, and Android. This fixes druntime backtraces with optimized code (incl. prebuilt druntime/Phobos). (#4889)
617
- The prebuilt (non-musl) Linux packages are now generated on Ubuntu 22.04; the minimum glibc version has accordingly been raised from v2.31 to v2.35. (#4893)
18+
- druntime: Optimize `core.int128` via inline IR/assembly. (#4892)
19+
- Follow clang wrt. unwind tables emission, enabling them for most popular targets. (#4888)
720
- ldc2.conf: Arrays can now be appended to via the `~=` operator. (#4848, #4856)
821
- New `--installWithSuffix` command-line option for the `ldc-build-runtime` tool, to simplify copying the libraries to an existing LDC installation. (#4870)
22+
- CMake changes (for building LDC itself):
23+
- Minimum CMake version bumped to v3.16. (#4898)
24+
- macOS: Fix weird linker error when running CMake the first time. (#3901, #4926)
25+
- Reworked integration of the LLVM compiler-rt libraries. Package maintainers may want to see [docs/compiler_rt.md](https://github.com/ldc-developers/ldc/blob/master/docs/compiler_rt.md). (#4665)
26+
- Somewhat simplify separate compiler and runtime builds, incl. cross-compiling LDC itself. (#4872)
927

1028
#### Platform support
29+
- Supports LLVM 15 - 20.
30+
- RISC-V: Fiber context switching is now implemented natively. (#4867)
1131

1232
#### Bug fixes
33+
- Prebuilt macOS packages: Fix `ldmd2` and other bundled executables crashing on macOS v15.4. (#4899, #4912)
34+
- ImportC: Run C preprocessor in C11 mode. (#4933)
35+
- ImportC Windows: Disable clang headers when C-preprocessing with `clang-cl`. (#4934)
36+
- Fix ICE on invalid constant address-of expressions. (#4938, #4939)
37+
- Allow Unicode in fully qualified label names. (#4927, #4929)
1338

1439
# LDC 1.40.1 (2025-03-20)
1540

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,11 @@ option(LDC_DYNAMIC_COMPILE_USE_CUSTOM_PASSES "Use custom LDC passes in jit" ON)
457457
if(LDC_DYNAMIC_COMPILE STREQUAL "AUTO")
458458
if(LDC_LLVM_VER LESS 1800)
459459
set(LDC_DYNAMIC_COMPILE OFF)
460-
else()
460+
# FIXME: dynamic-compile regressions with LLVM 20
461+
elseif(LDC_LLVM_VER LESS 2000)
461462
set(LDC_DYNAMIC_COMPILE ON)
463+
else()
464+
set(LDC_DYNAMIC_COMPILE OFF)
462465
endif()
463466
endif()
464467
# https://llvm.org/docs/JITLink.html for the list of supported platforms

dmd/cparse.d

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3437,6 +3437,11 @@ final class CParser(AST) : Parser!AST
34373437
cparseParens();
34383438
}
34393439
}
3440+
else if (token.value == TOK._Noreturn)
3441+
{
3442+
specifier.noreturn = true;
3443+
nextToken();
3444+
}
34403445
else if (token.value == TOK.restrict) // ImportC assigns no semantics to `restrict`, so just ignore the keyword.
34413446
nextToken();
34423447
else

dmd/expressionsem.d

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5672,7 +5672,6 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
56725672
s = "__funcliteral";
56735673

56745674
DsymbolTable symtab;
5675-
string parentMangle;
56765675
if (FuncDeclaration func = sc.parent.isFuncDeclaration())
56775676
{
56785677
if (func.localsymtab is null)
@@ -5682,7 +5681,6 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
56825681
func.localsymtab = new DsymbolTable();
56835682
}
56845683
symtab = func.localsymtab;
5685-
parentMangle = cast(string) mangleExact(func).toDString();
56865684
}
56875685
else
56885686
{
@@ -5695,13 +5693,9 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
56955693
sds.symtab = new DsymbolTable();
56965694
}
56975695
symtab = sds.symtab;
5698-
5699-
OutBuffer buf;
5700-
mangleToBuffer(sds, buf);
5701-
parentMangle = buf.extractSlice();
57025696
}
57035697
assert(symtab);
5704-
Identifier id = Identifier.generateIdWithLoc(s, exp.loc, parentMangle);
5698+
Identifier id = Identifier.generateIdWithLoc(s, exp.loc, cast(const void*) sc.parent);
57055699
exp.fd.ident = id;
57065700
if (exp.td)
57075701
exp.td.ident = id;

0 commit comments

Comments
 (0)