[PATCH] D47858: [New PM] Introducing PassInstrumentation framework

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 3 04:06:22 PDT 2018


philip.pfaffe added a comment.

Reconsidering passing the actual IRUnit to the callbacks, I still think that's not a good idea. Downstream users _will_ eventually use this to hook into the pipeline and mess with the IR somehow. So instead this should be opaque to clients.

What operations do clients ever have to perform on an IRUnit? The number should be tiny I believe.

I'd love to see something like a generic IRUnit wrapper, that implements these operations plus some opaque IRUnit id. Currently that'd just be print. Passing the wrapper to the callback then is safe, and it allows clients to both identify the ir object as well as do what we allow them to do with the object.


Repository:
  rL LLVM

https://reviews.llvm.org/D47858





More information about the llvm-commits mailing list