[Flang][OpenACC] possible memory leak in generated code
https://github.com/llvm/llvm-project/blob/d1538c15f9c65a70f4650bd724972536f00f5094/flang/lib/Lower/OpenACC.cpp#L1026 and https://github.com/llvm/llvm-project/blob/d1538c15f9c65a70f4650bd724972536f00f5094/flang/lib/Lower/OpenACC.cpp#L462 both call createTempFromMold on boxed arrays. Which I think will create a heap temporary: https://github.com/llvm/llvm-project/blob/8511b320807085e88a10ae7275c2255da9d0172a/flang/lib/Optimizer/Builder/HLFIRTools.cpp#L1084-L1091
The cleanup value returned from createTempFromMold is ignored in both cases.
Both call sites are gone. Private and firstprivate recipes now heap-allocate dynamic-size temporaries in generatePrivateInit (FIROpenACCTypeInterfaces.cpp) and free them in the recipe's destroy region, added in #162702. Reductions got the same destroy region in #164988. acc-private.f90 and acc-reduction.f90 both check for fir.freemem on boxed array recipes. I think this can be closed.
Thanks. I'll close.