[mlir][transform] Expose transform op from TrackingListener
authorMatthias Springer <me@m-sp.org>
Wed, 24 May 2023 13:02:56 +0000 (15:02 +0200)
committerMatthias Springer <me@m-sp.org>
Wed, 24 May 2023 13:11:24 +0000 (15:11 +0200)
This allows subclasses (such as the ErrorCheckingTrackingListener in IREE) to produce better error messages.

Differential Revision: https://reviews.llvm.org/D151322

mlir/include/mlir/Dialect/Transform/IR/TransformOps.h

index 543eba9..f77982f 100644 (file)
@@ -68,6 +68,9 @@ protected:
   /// Return the single op that defines all given values (if any).
   static Operation *getCommonDefiningOp(ValueRange values);
 
+  /// Return the transform op in which this TrackingListener is used.
+  TransformOpInterface getTransformOp() const { return transformOp; }
+
 private:
   void notifyOperationRemoved(Operation *op) override;