[flang] Support -ffunction-sections and -fdata-sections. (#199731)
Wire the flags through the driver, frontend, and TargetMachine, and add
driver and codegen lit tests.
Fixes https://github.com/llvm/llvm-project/issues/163550
---------
Co-authored-by: Cursor <cursoragent at cursor.com>
[libc] Add definition of struct in6_addr to netinet/in.h (#201057)
This patch implements the struct in6_addr definition for netinet/in.h,
mapping it from netinet/in.yaml to the generated public header.
I've defined struct in6_addr under include/llvm-libc-types/ using an
anonymous union containing s6_addr, s6_addr16, and s6_addr32 (only the
first one is mandated by POSIX). Other implementations achieve this by
using a named union and defining the members as macros. This approach is
cleaner, but could potentially run into compatibility problems with code
which expects s6_addr is a macro. If we do, we may have to re-evaluate
this approach, but I'd like to avoid uglyfying this preemptively.
I added a simple test to check the memory layout of the address.
Assisted by Gemini.
[lldb] Skip TestQemuLaunch.py on arm64e (#200969)
This test is set up to use a python-based qemu-like stub instead of the
actual qemu (which makes it far more portable). When trying to run the
test as arm64e, LLDB will attempt to launch an arm64e-based qemu.
Because the fake qemu is a python script, LLDB will try to launch python
as arm64e. Neither the python that ships with Xcode nor the python from
python.org have an arm64e slice, so this test will not work for arm64e.
[clang] Treat unnamed bitfields as padding in `__builtin_clear_padding` (#201102)
Currently Clang's implementation of `__builtin_clear_padding` diverges
from GCC in its treatment of unnamed bitfields.
GCC treats them as padding (which seems correct since they can't be
named and wouldn't be part of the value representation of an object,
though I'm not sure what the standard has to say about this).
[Gobdolt](https://godbolt.org/z/e9Mo91dhh)
GCC trunk:
```
pre-clear bytes: ff ff ff ff
post-clear bytes: 01 00 00 80
```
Clang trunk:
```
[7 lines not shown]
[SystemZ][z/OS] Add XPLink ABI on z/OS (#188501)
This patch introduces full support for the XPLINK calling convention on
z/OS within LLVM. XPLINK is documented in the Language Environment
Vendor Interface ([Chapter
22](https://www.ibm.com/docs/en/zos/3.2.0?topic=applications-call-linkage-convention-amode-64))
and in the IBM Redbook [XPLink: OS/390 Extra Performance
Linkage](http://www.redbooks.ibm.com/abstracts/sg245991.html?Open
). It defines a high‑performance linkage model used by the z/OS Language
Environment (LE) and by the XL C/C++ compiler.
This work succeeds and replaces the earlier effort in [PR
101024](https://github.com/llvm/llvm-project/pull/101024). The present
implementation restructures the original approach, significantly expands
test coverage, and aligns more closely with both the architectural
requirements of XPLINK and the de‑facto ABI behaviour of XL C/C++.
[Driver] Switch clang++ to default Solaris 11.4 compilation environment (#201063)
`clang++` has long followed `g++`'s lead predefining `_XOPEN_SOURCE=600`
on Solaris. As detailed in [Switch g++ to default Solaris 11.4
compilation
environment](https://gcc.gnu.org/pipermail/gcc-patches/2026-May/716990.html),
this is no longer necessary in Solaris 11.4.
Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
[Flang][OpenMP] Declare Target fixes for USM and declare target to (#200248)
Currently declare target enter would fall through the if statement even
though it's a synonym of declare target to, so fix this via adding a
simpler and more readable check for link clause instead.
USM declare target to works a little differently to regular link cases,
where the type is actually converted into a pointer, rather than a
global of the original typing. So, add a caveat where we convert the
type to a pointer if requires usm has been triggered. This gets the
correct behaviour in USM mode on USM devices.
[AIX][LLVM] Update the default code model for 64-bit (#199301)
This changes the default code model on 64-bit AIX to large.
For many applications, the existing small code model is simply
inadequate to build. Users often then end up relying on expensive linker
fixups (i.e. -Wl,-bigtoc) to work around the issue when they would have
been better served by moving to the larger code model. Our analysis and
benchmarking leads us to believe this's generally a net benefit to
users.
(Assisted by AI)
[ADT] Remove unused DenseMapInfo::getTombstoneKey (#200959)
#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo<T>::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.
Reland [LLVM] Add flags to crash the opt/codegen pipeline (#201146)
Will be used for testing crash reduction.
Reland of #200967. Test needs `REQUIRES: backtrace`.
[AMDGPU] Add IGLP mutations to CoexecSched (#200981)
Adds IGLP mutations support to CoexecSched -- regular handling of this
mutation in GCNSchedStage is implemented in GCNSchedStrategy.cpp
[clang][NFC] Bump the maximum number of Sema diagnostics (#200948)
The number of Sema diagnostics in DiagnosticSemaKinds.td has reached the
5000 limit. This PR increases the max limit to 6000.
[flang][OpenMP] Add structure checks for DECLARE VARIANT (#198799)
This PR adds declare-variant structure checking. Following checks are
added:
- Validate [base:]variant arguments (including implicit base for
single-name form).
- Require exactly one MATCH clause; reject a second MATCH on the same
directive.
- Reject duplicate (base, variant) across multiple declare variant
directives.
- Reject clauses not allowed on declare variant.
- Apply shared context-selector checks to MATCH (reuse metadirective
logic).
- Require constant user conditions in MATCH for declare variant (dynamic
selectors deferred).
Refactor metadirective support:
[4 lines not shown]
[PseudoProbe] Preserve pseudoprobe for tailcall pseudo instrs (#197246)
Preserve probes for tail call pseudo instructions.
On AArch64, X86, and other platforms, the lowering of tail calls
requires a pseudo instruction like `TCRETURNdi`. It is often the case
that `TCRETURNdi` is within its own MBB, and the direct call probe
associated with that tail call is considered dangling and removed. This
patch tries to preserve that.
[CI] install packaging before running lldb tests on Windows (#201112)
https://ci-external.swift.org/job/lldb-windows/job/main/ is failing
because lldb API tests require the `packaging` module.
This patch installs it before running the `check-lldb` target.