Skip to content

Commit 59548fe

Browse files
committed
[mlir] Fix compile errors with bytecode support
1 parent 41d4067 commit 59548fe

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mlir/lib/Bytecode/Reader/BytecodeReader.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,14 @@ class EncodingReader {
165165
/// contents of the section in `sectionData`.
166166
LogicalResult parseSection(bytecode::Section::ID &sectionID,
167167
ArrayRef<uint8_t> &sectionData) {
168-
size_t length;
168+
uint64_t length;
169169
if (failed(parseByte(sectionID)) || failed(parseVarInt(length)))
170170
return failure();
171171
if (sectionID >= bytecode::Section::kNumSections)
172172
return emitError("invalid section ID: ", unsigned(sectionID));
173173

174174
// Parse the actua section data now that we have its length.
175-
return parseBytes(length, sectionData);
175+
return parseBytes(static_cast<size_t>(length), sectionData);
176176
}
177177

178178
private:

utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

+1
Original file line numberDiff line numberDiff line change
@@ -6189,6 +6189,7 @@ cc_library(
61896189
hdrs = ["include/mlir/Tools/mlir-opt/MlirOptMain.h"],
61906190
includes = ["include"],
61916191
deps = [
6192+
":BytecodeReader",
61926193
":BytecodeWriter",
61936194
":IR",
61946195
":Parser",

0 commit comments

Comments
 (0)