Skip to content

Commit 7fa57cd

Browse files
authored
[MLIR] Add move constructor to BytecodeWriterConfig (#126130)
The config is currently not movable and because there are constructors the default move won't be generated, which prevents it from being moved. Also, it is not copyable because of the unique_ptr. This PR adds move constructor to allow moving it.
1 parent 4d3148d commit 7fa57cd

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

mlir/include/mlir/Bytecode/BytecodeWriter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class BytecodeWriterConfig {
8282
/// printers for the fallback resources within the map.
8383
BytecodeWriterConfig(FallbackAsmResourceMap &map,
8484
StringRef producer = "MLIR" LLVM_VERSION_STRING);
85+
BytecodeWriterConfig(BytecodeWriterConfig &&);
8586
~BytecodeWriterConfig();
8687

8788
/// An internal implementation class that contains the state of the

mlir/lib/Bytecode/Writer/BytecodeWriter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ BytecodeWriterConfig::BytecodeWriterConfig(FallbackAsmResourceMap &map,
6666
: BytecodeWriterConfig(producer) {
6767
attachFallbackResourcePrinter(map);
6868
}
69+
BytecodeWriterConfig::BytecodeWriterConfig(BytecodeWriterConfig &&config)
70+
: impl(std::move(config.impl)) {}
71+
6972
BytecodeWriterConfig::~BytecodeWriterConfig() = default;
7073

7174
ArrayRef<std::unique_ptr<AttrTypeBytecodeWriter<Attribute>>>

0 commit comments

Comments
 (0)