[Mlir-commits] [mlir] c502f91 - [mlir] Move ApplyConversionAction into an anonymous namespace (#238420)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Nov 3 08:57:13 PST 2026
Author: Eugene Epshteyn
Date: 2026-11-03T11:57:07-05:00
New Revision: c502f911c720e8f90a3b835a5d9f459a0a3af001
URL: https://github.com/llvm/llvm-project/commit/c502f911c720e8f90a3b835a5d9f459a0a3af001
DIFF: https://github.com/llvm/llvm-project/commit/c502f911c720e8f90a3b835a5d9f459a0a3af001.diff
LOG: [mlir] Move ApplyConversionAction into an anonymous namespace (#238420)
ApplyConversionAction is local to DialectConversion.cpp but was declared
at global scope, so its vtable had external linkage. In a dylib build
with ClangIR enabled, libclang-cpp.so links its own static copy of MLIR
and exports this vtable alongside libMLIR.so's. This is the same
interposition hazard that 238091 removed for two arith patterns (issue
235982).
Move the class into an anonymous namespace, as the coding standards ask.
Its TypeID can no longer come from the name-based fallback, so define it
explicitly with MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID, as
GreedyPatternRewriteIteration does. Drop the unused `desc` member, which
now triggers -Wunused-const-variable.
Assisted-by: AI
Added:
Modified:
mlir/lib/Transforms/Utils/DialectConversion.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp
index c949433644c02f..4123592a45e4b0 100644
--- a/mlir/lib/Transforms/Utils/DialectConversion.cpp
+++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp
@@ -4202,18 +4202,19 @@ void mlir::registerConversionPDLFunctions(RewritePatternSet &patterns) {
// Op Conversion Entry Points
//===----------------------------------------------------------------------===//
+namespace {
/// This is the type of Action that is dispatched when a conversion is applied.
class ApplyConversionAction
: public tracing::ActionImpl<ApplyConversionAction> {
public:
+ MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ApplyConversionAction)
using Base = tracing::ActionImpl<ApplyConversionAction>;
ApplyConversionAction(ArrayRef<IRUnit> irUnits) : Base(irUnits) {}
static constexpr StringLiteral tag = "apply-conversion";
- static constexpr StringLiteral desc =
- "Encapsulate the application of a dialect conversion";
void print(raw_ostream &os) const override { os << tag; }
};
+} // namespace
static LogicalResult applyConversion(ArrayRef<Operation *> ops,
const ConversionTarget &target,
More information about the Mlir-commits
mailing list