[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 21 09:30:03 PDT 2025


================
@@ -858,12 +865,28 @@ const CGFunctionInfo &CodeGenTypes::arrangeLLVMFunctionInfo(
   // Construct the function info.  We co-allocate the ArgInfos.
   FI = CGFunctionInfo::create(CC, isInstanceMethod, isChainCall, isDelegateCall,
                               info, paramInfos, resultType, argTypes, required);
+
+  llvm::BumpPtrAllocator Alloc;
+  llvm::abi::TypeBuilder TB(Alloc);
+
+  QualTypeMapper Mapper(CGM.getContext(), Alloc);
+
+  SmallVector<const llvm::abi::Type *, 8> MappedArgTypes;
+  for (CanQualType ArgType : argTypes) {
+    MappedArgTypes.push_back(Mapper.convertType(ArgType));
+  }
+  ArrayRef<const llvm::abi::Type *> ABIArgTypes = MappedArgTypes;
----------------
nikic wrote:

No need to explicitly create ArrayRef.

https://github.com/llvm/llvm-project/pull/140112


More information about the llvm-commits mailing list