aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Bytecode/Reader/BytecodeReader.cpp')
-rw-r--r--mlir/lib/Bytecode/Reader/BytecodeReader.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/mlir/lib/Bytecode/Reader/BytecodeReader.cpp b/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
index d6163406..dd1e4ab 100644
--- a/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
+++ b/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
@@ -1854,22 +1854,18 @@ BytecodeReader::Impl::parseOpName(EncodingReader &reader,
// Check to see if this operation name has already been resolved. If we
// haven't, load the dialect and build the operation name.
if (!opName->opName) {
- // Load the dialect and its version.
- DialectReader dialectReader(attrTypeReader, stringReader, resourceReader,
- dialectsMap, reader, version);
- if (failed(opName->dialect->load(dialectReader, getContext())))
- return failure();
// If the opName is empty, this is because we use to accept names such as
// `foo` without any `.` separator. We shouldn't tolerate this in textual
// format anymore but for now we'll be backward compatible. This can only
// happen with unregistered dialects.
if (opName->name.empty()) {
- if (opName->dialect->getLoadedDialect())
- return emitError(fileLoc) << "has an empty opname for dialect '"
- << opName->dialect->name << "'\n";
-
opName->opName.emplace(opName->dialect->name, getContext());
} else {
+ // Load the dialect and its version.
+ DialectReader dialectReader(attrTypeReader, stringReader, resourceReader,
+ dialectsMap, reader, version);
+ if (failed(opName->dialect->load(dialectReader, getContext())))
+ return failure();
opName->opName.emplace((opName->dialect->name + "." + opName->name).str(),
getContext());
}