[PATCH] D97000: [clang] Increase the bitness of data length in ASTDeclContextNameLookup
Danila Kutenin via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 18 14:53:44 PST 2021
danlark created this revision.
danlark added a reviewer: rsmith.
danlark requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
We faced the assert of too many declarations for serialized lookup for a very generated C++ target. We
think moving the type to uint32_t helps us. As I am not sure in the fix, please validate the correctness.
I don't have commit rights. Email: danilak at google.com. Name: Danila Kutenin.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D97000
Files:
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
Index: clang/lib/Serialization/ASTWriter.cpp
===================================================================
--- clang/lib/Serialization/ASTWriter.cpp
+++ clang/lib/Serialization/ASTWriter.cpp
@@ -3599,9 +3599,7 @@
// 4 bytes for each DeclID.
unsigned DataLen = 4 * (Lookup.second - Lookup.first);
- assert(uint16_t(DataLen) == DataLen &&
- "too many decls for serialized lookup result");
- LE.write<uint16_t>(DataLen);
+ LE.write<uint32_t>(DataLen);
return std::make_pair(KeyLen, DataLen);
}
Index: clang/lib/Serialization/ASTReader.cpp
===================================================================
--- clang/lib/Serialization/ASTReader.cpp
+++ clang/lib/Serialization/ASTReader.cpp
@@ -1089,7 +1089,7 @@
using namespace llvm::support;
unsigned KeyLen = endian::readNext<uint16_t, little, unaligned>(d);
- unsigned DataLen = endian::readNext<uint16_t, little, unaligned>(d);
+ unsigned DataLen = endian::readNext<uint32_t, little, unaligned>(d);
return std::make_pair(KeyLen, DataLen);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97000.324781.patch
Type: text/x-patch
Size: 1056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210218/bca3b22f/attachment.bin>
More information about the cfe-commits
mailing list