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

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 14 11:13:03 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));
----------------
bcardosolopes wrote:

OG is doing that in past 10 years already, I wonder what was the reason at the time, it does seems rather strange indeed.

> What is our allocation story for MLIR/CIR?

We haven't tried anything different from Clang's codegen. For the MLIR bits it's all abstracted and we usually don't have to do any of this (the value semantic handler + context does all the allocations under the hood)

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


More information about the cfe-commits mailing list