Skip to content

Commit 5c7302a

Browse files
Fix issue found by @ftynse. Also make init function private.
1 parent 822d127 commit 5c7302a

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

mlir/include/mlir/Dialect/Transform/IR/TransformDialect.td

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ def Transform_Dialect : Dialect {
7878
using ExtensionTypePrintingHook =
7979
std::function<void(::mlir::Type, ::mlir::AsmPrinter &)>;
8080

81-
/// Loads the given module into the transform symbol library module.
82-
void initializeLibraryModule();
83-
8481
/// Loads the given module into the transform symbol library module.
8582
LogicalResult loadIntoLibraryModule(::mlir::OwningOpRef<::mlir::ModuleOp> &&
8683
library);
@@ -94,6 +91,10 @@ def Transform_Dialect : Dialect {
9491
}
9592

9693
private:
94+
/// Initializes the transform symbol library module. Must be called from
95+
/// `TransformDialect::initialize` for the library module to work.
96+
void initializeLibraryModule();
97+
9798
/// Registers operations specified as template parameters with this
9899
/// dialect. Checks that they implement the required interfaces.
99100
template <typename... OpTys>

mlir/lib/Dialect/Transform/IR/TransformDialect.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ void transform::TransformDialect::printType(Type type,
9191
it->getSecond()(type, printer);
9292
}
9393

94+
LogicalResult transform::TransformDialect::loadIntoLibraryModule(
95+
::mlir::OwningOpRef<::mlir::ModuleOp> &&library) {
96+
return detail::mergeSymbolsInto(getLibraryModule(), std::move(library));
97+
}
98+
9499
void transform::TransformDialect::initializeLibraryModule() {
95100
MLIRContext *context = getContext();
96101
auto loc =
@@ -100,11 +105,6 @@ void transform::TransformDialect::initializeLibraryModule() {
100105
UnitAttr::get(context));
101106
}
102107

103-
LogicalResult transform::TransformDialect::loadIntoLibraryModule(
104-
::mlir::OwningOpRef<::mlir::ModuleOp> &&library) {
105-
return detail::mergeSymbolsInto(getLibraryModule(), std::move(library));
106-
}
107-
108108
void transform::TransformDialect::reportDuplicateTypeRegistration(
109109
StringRef mnemonic) {
110110
std::string buffer;

0 commit comments

Comments
 (0)