Skip to content

Commit 8f3c8da

Browse files
[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.
1 parent 87bf5ee commit 8f3c8da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mlir/lib/Bytecode/Reader/BytecodeReader.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,8 +1320,9 @@ LogicalResult AttrTypeReader::initialize(
13201320
}
13211321

13221322
template <typename T>
1323-
T AttrTypeReader::resolveEntry(SmallVectorImpl<Entry<T>> &entries, size_t index,
1324-
StringRef entryType, uint64_t depth) {
1323+
T AttrTypeReader::resolveEntry(SmallVectorImpl<Entry<T>> &entries,
1324+
uint64_t index, StringRef entryType,
1325+
uint64_t depth) {
13251326
if (index >= entries.size()) {
13261327
emitError(fileLoc) << "invalid " << entryType << " index: " << index;
13271328
return {};

0 commit comments

Comments
 (0)