[PATCH] D70258: [OpenMP][IR-Builder] Introduce the finalization stack

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 11 16:37:09 PST 2019


ABataev added inline comments.


================
Comment at: llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h:51
+  /// at the time, and location, the callback is invoked.
+  using FinalizeCallbackTy = std::function<void(InsertPointTy /* CodeGenIP */)>;
+
----------------
jdoerfert wrote:
> ABataev wrote:
> > `llvm::function_ref`?
> The lambda that is passed in here might go out of scope so we need to own it. This is intentional.
Maybe better to save the intermediate data in CGOpenMPRuntime class rather than rely on owning lambda ref here? Clang does not use escaping decls and instead stores intermediate data explicitly. It really complicates analysis and potential source of resource leakage.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70258/new/

https://reviews.llvm.org/D70258





More information about the cfe-commits mailing list