[clang] Integrate LLVMABI for function call ABI lowering (#194460)
This PR wires the LLVM ABI library (prototyped in
https://github.com/llvm/llvm-project/pull/140112) into Clang's function
call ABI lowering pipeline, behind a new `-fexperimental-abi-lowering`
cc1 flag.
When the flag is enabled and the active target has an LLVMABI
implementation, `CodeGenTypes::arrangeLLVMFunctionInfo` constructs an
`llvm::abi::FunctionInfo` from the call's argument and result types
(using QualTypeMapper(https://github.com/llvm/llvm-project/pull/174634)
to translate Clang QualTypes into ABI types).
Asks the target's `llvm::abi::TargetInfo` to classify it, and then
translates each `llvm::abi::ArgInfo` back into the ABIArgInfo consumed
by the rest of CodeGen. The translation is handled by a new
`convertABIArgInfo` helper covering the Direct, Extend, Indirect, and
Ignore kinds, with coerce-to types lifted back into LLVM IR via a new
IRTypeMapper.
The integration is intentionally narrow and existing code paths are
untouched. `CodeGenModule::shouldUseLLVMABILowering` only opts in for
targets explicitly wired to the new library(currently only BPF).
GitOrigin-RevId: 07b5dfe9473c6f864027855b68fa5775d0adf2d9
3 files changed