[Mlir-commits] [mlir] [MLIR] modify BytecodeWriterConfig to return const refs for callbacks (PR #85926)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Mar 20 05:59:54 PDT 2024


https://github.com/0x00006000 updated https://github.com/llvm/llvm-project/pull/85926

>From 17294ada0845ad59a19681553d9f70c56e0a2981 Mon Sep 17 00:00:00 2001
From: Matrix <alexsei at cock.pm>
Date: Wed, 20 Mar 2024 12:49:19 +0000
Subject: [PATCH 1/2] [MLIR] modify BytecodeWriterConfig to return const refs
 for callbacks

---
 mlir/lib/Bytecode/Writer/BytecodeWriter.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp b/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
index 9493a6c19a1067..33b25bf38a74d3 100644
--- a/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
+++ b/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
@@ -68,12 +68,12 @@ BytecodeWriterConfig::BytecodeWriterConfig(FallbackAsmResourceMap &map,
 }
 BytecodeWriterConfig::~BytecodeWriterConfig() = default;
 
-ArrayRef<std::unique_ptr<AttrTypeBytecodeWriter<Attribute>>>
+ArrayRef<const std::unique_ptr<AttrTypeBytecodeWriter<Attribute>> &>
 BytecodeWriterConfig::getAttributeWriterCallbacks() const {
   return impl->attributeWriterCallbacks;
 }
 
-ArrayRef<std::unique_ptr<AttrTypeBytecodeWriter<Type>>>
+ArrayRef<const std::unique_ptr<AttrTypeBytecodeWriter<Type>> &> 
 BytecodeWriterConfig::getTypeWriterCallbacks() const {
   return impl->typeWriterCallbacks;
 }

>From 074fd2eb35993fec809ba3d16a0891087e954760 Mon Sep 17 00:00:00 2001
From: Matrix <alexsei at cock.pm>
Date: Wed, 20 Mar 2024 12:59:46 +0000
Subject: [PATCH 2/2] [MLIR] fixed

---
 mlir/lib/Bytecode/Writer/BytecodeWriter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp b/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
index 33b25bf38a74d3..2bdb496d054324 100644
--- a/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
+++ b/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
@@ -73,7 +73,7 @@ BytecodeWriterConfig::getAttributeWriterCallbacks() const {
   return impl->attributeWriterCallbacks;
 }
 
-ArrayRef<const std::unique_ptr<AttrTypeBytecodeWriter<Type>> &> 
+ArrayRef<const std::unique_ptr<AttrTypeBytecodeWriter<Type>>>
 BytecodeWriterConfig::getTypeWriterCallbacks() const {
   return impl->typeWriterCallbacks;
 }



More information about the Mlir-commits mailing list