[PATCH] D117348: [Preprocessor] Reduce the memory overhead of `#define` directives

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 20 08:16:55 PST 2022


aaron.ballman added inline comments.


================
Comment at: clang/lib/Lex/MacroInfo.cpp:33
+
+// MacroInfo is expected to take 40 bytes on platforms with an 8 byte pointer.
+template <int> class MacroInfoSizeChecker {
----------------
dexonsmith wrote:
> aaron.ballman wrote:
> > dexonsmith wrote:
> > > aaron.ballman wrote:
> > > > Should we do this dance for 32-bit systems as well?
> > > Do I remember correctly that `SourceLocation`'s size recently became configurable? Or maybe it will be soon? Should that be factored in somehow?
> > Are you thinking about this review https://reviews.llvm.org/D97204 or something else?
> Yes, I think that's the one.
Yeah, it's probably not a bad idea to use `sizeof(SourceLocation)` instead of calculating the size manually for that bit.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117348/new/

https://reviews.llvm.org/D117348



More information about the cfe-commits mailing list