[clang] [CIR] cir.call with scalar return type (PR #135552)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 15 13:47:40 PDT 2025


================
@@ -18,9 +18,12 @@
 using namespace clang;
 using namespace clang::CIRGen;
 
-CIRGenFunctionInfo *CIRGenFunctionInfo::create() {
-  // For now we just create an empty CIRGenFunctionInfo.
-  CIRGenFunctionInfo *fi = new CIRGenFunctionInfo();
+CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
+  void *buffer = operator new(totalSizeToAlloc<ArgInfo>(1));
----------------
andykaylor wrote:

This is a common idiom for objects that use the llvm::TrailingObjects base class, and it doesn't seem especially uncommon in clang to use global operator new for the allocation.

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


More information about the cfe-commits mailing list