[mlir] Fix compile errors with bytecode support
authorGoran Flegar <gflegar@google.com>
Mon, 22 Aug 2022 15:59:51 +0000 (17:59 +0200)
committerGoran Flegar <gflegar@google.com>
Mon, 22 Aug 2022 15:59:51 +0000 (17:59 +0200)
mlir/lib/Bytecode/Reader/BytecodeReader.cpp
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

index c23640d..cbb9719 100644 (file)
@@ -165,14 +165,14 @@ public:
   /// contents of the section in `sectionData`.
   LogicalResult parseSection(bytecode::Section::ID &sectionID,
                              ArrayRef<uint8_t> &sectionData) {
-    size_t length;
+    uint64_t length;
     if (failed(parseByte(sectionID)) || failed(parseVarInt(length)))
       return failure();
     if (sectionID >= bytecode::Section::kNumSections)
       return emitError("invalid section ID: ", unsigned(sectionID));
 
     // Parse the actua section data now that we have its length.
-    return parseBytes(length, sectionData);
+    return parseBytes(static_cast<size_t>(length), sectionData);
   }
 
 private:
index 1336ef8..f6f9539 100644 (file)
@@ -6189,6 +6189,7 @@ cc_library(
     hdrs = ["include/mlir/Tools/mlir-opt/MlirOptMain.h"],
     includes = ["include"],
     deps = [
+        ":BytecodeReader",
         ":BytecodeWriter",
         ":IR",
         ":Parser",