diff --git a/mlir/include/mlir/Support/DebugAction.h b/mlir/include/mlir/Support/DebugAction.h --- a/mlir/include/mlir/Support/DebugAction.h +++ b/mlir/include/mlir/Support/DebugAction.h @@ -195,7 +195,7 @@ public: class Handler : public DebugActionManager::HandlerBase { public: - Handler() : HandlerBase(TypeID::get()) {} + Handler() : HandlerBase(TypeID::get()) {} /// This hook allows for controlling whether an action should execute or /// not. `parameters` correspond to the set of values provided by the @@ -207,7 +207,7 @@ /// Provide classof to allow casting between handler types. static bool classof(const DebugActionManager::HandlerBase *handler) { - return handler->getHandlerID() == TypeID::get(); + return handler->getHandlerID() == TypeID::get(); } }; diff --git a/mlir/unittests/Support/DebugActionTest.cpp b/mlir/unittests/Support/DebugActionTest.cpp --- a/mlir/unittests/Support/DebugActionTest.cpp +++ b/mlir/unittests/Support/DebugActionTest.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "mlir/Support/DebugAction.h" +#include "mlir/Support/TypeID.h" #include "gmock/gmock.h" // DebugActionManager is only enabled in DEBUG mode. @@ -16,16 +17,19 @@ namespace { struct SimpleAction : DebugAction { + MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SimpleAction) static StringRef getTag() { return "simple-action"; } static StringRef getDescription() { return "simple-action-description"; } }; struct OtherSimpleAction : DebugAction { + MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(OtherSimpleAction) static StringRef getTag() { return "other-simple-action"; } static StringRef getDescription() { return "other-simple-action-description"; } }; struct ParametricAction : DebugAction { + MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ParametricAction) static StringRef getTag() { return "param-action"; } static StringRef getDescription() { return "param-action-description"; } }; diff --git a/mlir/unittests/Support/DebugCounterTest.cpp b/mlir/unittests/Support/DebugCounterTest.cpp --- a/mlir/unittests/Support/DebugCounterTest.cpp +++ b/mlir/unittests/Support/DebugCounterTest.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "mlir/Support/DebugCounter.h" +#include "mlir/Support/TypeID.h" #include "gmock/gmock.h" using namespace mlir; @@ -17,6 +18,7 @@ namespace { struct CounterAction : public DebugAction { + MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CounterAction) static StringRef getTag() { return "counter-action"; } static StringRef getDescription() { return "Test action for debug counters"; } };