[Mlir-commits] [mlir] 8f3c8da - [MLIR][Bytecode] Use consistent types for resolveEntry (#171502)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Dec 9 13:09:23 PST 2025


Author: Aiden Grossman
Date: 2025-12-09T22:09:19+01:00
New Revision: 8f3c8dabc64517132c9c438ff467e75f39fbf8a6

URL: https://github.com/llvm/llvm-project/commit/8f3c8dabc64517132c9c438ff467e75f39fbf8a6
DIFF: https://github.com/llvm/llvm-project/commit/8f3c8dabc64517132c9c438ff467e75f39fbf8a6.diff

LOG: [MLIR][Bytecode] Use consistent types for resolveEntry (#171502)

uint64_t and size_t are not the same across all platforms. This was
causing build failures when building this file for wasm:

llvm-project/mlir/lib/Bytecode/Reader/BytecodeReader.cpp:1323:19: error:
out-of-line definition of 'resolveEntry' does not match any declaration
in '(anonymous namespace)::AttrTypeReader'
1323 | T AttrTypeReader::resolveEntry(SmallVectorImpl<Entry<T>>
&entries, size_t index,
      |                   ^~~~~~~~~~~~

third_party/llvm/llvm-project/mlir/lib/Bytecode/Reader/BytecodeReader.cpp:851:7:
note: AttrTypeReader defined here
  851 | class AttrTypeReader {
      |       ^~~~~~~~~~~~~~
1 error generated.

Use uint64_t everywhere to ensure portability.

Added: 
    

Modified: 
    mlir/lib/Bytecode/Reader/BytecodeReader.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Bytecode/Reader/BytecodeReader.cpp b/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
index dd367b5922558..0ac5fc5358ea5 100644
--- a/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
+++ b/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
@@ -1320,8 +1320,9 @@ LogicalResult AttrTypeReader::initialize(
 }
 
 template <typename T>
-T AttrTypeReader::resolveEntry(SmallVectorImpl<Entry<T>> &entries, size_t index,
-                               StringRef entryType, uint64_t depth) {
+T AttrTypeReader::resolveEntry(SmallVectorImpl<Entry<T>> &entries,
+                               uint64_t index, StringRef entryType,
+                               uint64_t depth) {
   if (index >= entries.size()) {
     emitError(fileLoc) << "invalid " << entryType << " index: " << index;
     return {};


        


More information about the Mlir-commits mailing list