summaryrefslogtreecommitdiff
path: root/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
diff options
context:
space:
mode:
authorRiver Riddle <riddleriver@gmail.com>2022-09-13 01:07:29 -0700
committerRiver Riddle <riddleriver@gmail.com>2022-09-13 11:39:20 -0700
commit34300ee3697e32926e998d1036925d0f59ffae02 (patch)
tree45b7a5d80550dc2fa48da6f14ef186002f035c56 /mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
parent6ab2bcffe45e660a68493e6a7cd04b6f05da51dc (diff)
[mlir] Add fallback support for parsing/printing unknown external resources
This is necessary/useful for building generic tooling that can roundtrip external resources without needing to explicitly handle them. For example, this allows for viewing the resources encoded within a bytecode file without having to explicitly know how to process them (e.g. making it easier to interact with a reproducer encoded in bytecode). Differential Revision: https://reviews.llvm.org/D133460
Diffstat (limited to 'mlir/lib/Bytecode/Writer/BytecodeWriter.cpp')
-rw-r--r--mlir/lib/Bytecode/Writer/BytecodeWriter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp b/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
index ff53cec15d77..7bcc1a841c24 100644
--- a/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
+++ b/mlir/lib/Bytecode/Writer/BytecodeWriter.cpp
@@ -39,6 +39,11 @@ struct BytecodeWriterConfig::Impl {
BytecodeWriterConfig::BytecodeWriterConfig(StringRef producer)
: impl(std::make_unique<Impl>(producer)) {}
+BytecodeWriterConfig::BytecodeWriterConfig(FallbackAsmResourceMap &map,
+ StringRef producer)
+ : BytecodeWriterConfig(producer) {
+ attachFallbackResourcePrinter(map);
+}
BytecodeWriterConfig::~BytecodeWriterConfig() = default;
void BytecodeWriterConfig::attachResourcePrinter(