-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[MLIR] Add move constructor to BytecodeWriterConfig #126130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
karimnosseir
merged 2 commits into
llvm:main
from
karimnosseir:bytecodewriter_config_move
Feb 7, 2025
Merged
[MLIR] Add move constructor to BytecodeWriterConfig #126130
karimnosseir
merged 2 commits into
llvm:main
from
karimnosseir:bytecodewriter_config_move
Feb 7, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
|
@llvm/pr-subscribers-mlir @llvm/pr-subscribers-mlir-core Author: Karim Nosseir (karimnosseir) ChangesFull diff: https://github.com/llvm/llvm-project/pull/126130.diff 2 Files Affected:
diff --git a/mlir/include/mlir/Bytecode/BytecodeWriter.h b/mlir/include/mlir/Bytecode/BytecodeWriter.h
index 0287e004bb99367..c6cff0bc813143e 100644
--- a/mlir/include/mlir/Bytecode/BytecodeWriter.h
+++ b/mlir/include/mlir/Bytecode/BytecodeWriter.h
@@ -82,6 +82,7 @@ class BytecodeWriterConfig {
/// printers for the fallback resources within the map.
BytecodeWriterConfig(FallbackAsmResourceMap &map,
StringRef producer = "MLIR" LLVM_VERSION_STRING);
+ BytecodeWriterConfig(BytecodeWriterConfig &&);
~BytecodeWriterConfig();
/// An internal implementation class that contains the state of the
diff --git a/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp b/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
index 0e96aa97abeba6f..8af98dd137568dc 100644
--- a/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
+++ b/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
@@ -66,6 +66,9 @@ BytecodeWriterConfig::BytecodeWriterConfig(FallbackAsmResourceMap &map,
: BytecodeWriterConfig(producer) {
attachFallbackResourcePrinter(map);
}
+BytecodeWriterConfig(BytecodeWriterConfig &&config)
+ : impl(std::move(config.impl)) {}
+
BytecodeWriterConfig::~BytecodeWriterConfig() = default;
ArrayRef<std::unique_ptr<AttrTypeBytecodeWriter<Attribute>>>
|
Contributor
|
Can you some context to the description? |
River707
reviewed
Feb 6, 2025
Contributor
River707
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change LGTM.
River707
approved these changes
Feb 6, 2025
Contributor
Author
Done. |
a433db0 to
0ceea68
Compare
Icohedron
pushed a commit
to Icohedron/llvm-project
that referenced
this pull request
Feb 11, 2025
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.