Skip to content

Commit 649dbce

Browse files
rnkGeorgeARM
authored andcommitted
[mlir] Declare explicit typeid to fix dylib build (llvm#138357)
This makes the dyn_cast<PassExecutionAction> work outside the dylib, i.e. from the unit test binary, when the CMake setting MLIR_LINK_MLIR_DYLIB is ON. Fixes llvm#138202
1 parent 13568ad commit 649dbce

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

mlir/include/mlir/Pass/Pass.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,6 @@ class PassExecutionAction : public tracing::ActionImpl<PassExecutionAction> {
493493
using Base = tracing::ActionImpl<PassExecutionAction>;
494494

495495
public:
496-
/// Define a TypeID for this PassExecutionAction.
497-
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(PassExecutionAction)
498496
/// Construct a PassExecutionAction. This is called by the OpToOpPassAdaptor
499497
/// when it calls `executeAction`.
500498
PassExecutionAction(ArrayRef<IRUnit> irUnits, const Pass &pass);
@@ -526,4 +524,7 @@ class PassExecutionAction : public tracing::ActionImpl<PassExecutionAction> {
526524

527525
} // namespace mlir
528526

527+
/// Define a TypeID for this PassExecutionAction.
528+
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::PassExecutionAction)
529+
529530
#endif // MLIR_PASS_PASS_H

mlir/lib/Pass/Pass.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Operation *PassExecutionAction::getOp() const {
5151
: llvm::dyn_cast_if_present<Operation *>(irUnits[0]);
5252
}
5353

54+
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::PassExecutionAction)
55+
5456
//===----------------------------------------------------------------------===//
5557
// Pass
5658
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)