[clang] [CIR] cir.call with scalar return type (PR #135552)
Sirui Mu via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 17 07:27:23 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));
----------------
Lancern wrote:
> That being delete instead of operator delete (or just new here...) don't necessarily match.
`CIRGenFunctionInfo` (and also `CGFunctionInfo`) defines its own `operator delete`, which just simply calls `::operator delete`:
https://github.com/llvm/llvm-project/blob/9ee4fdf4990f7dbdc0cfc30a8f733f676dbdcb51/clang/include/clang/CodeGen/CGFunctionInfo.h#L662
Thus the `delete` and `new` indeed match.
https://github.com/llvm/llvm-project/pull/135552
More information about the cfe-commits
mailing list