[flang][NFC] centralize FreeMemOp generation in IntrinsicCall.cpp
The current intrinsic call lowering contains a lot of repetitive patterns when it comes to dealing with temporary allocatable results allocated by the runtime that need to be dereferenced and for which a clean-up (free) must be scheduled in the StatementContext. For HLFIR lowering, I will need to deal with the clean-up in a different way since the results will be "moved" into expression nodes and the clean-up will be inserted in bufferization after the last hlfir.expr usage. Centralizing the clean-up code will make that easier, and is regardless of this motivation a quality improvement. Some static helpers had to be moved to IntrinsicBuilder method so that they could call the readAndAddCleanUp code. Differential Revision: https://reviews.llvm.org/D141669
Loading
Please sign in to comment