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

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 1 14:35:39 PST 2022


arphaman 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 {
----------------
aaron.ballman wrote:
> 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.
Good idea. Done.


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

https://reviews.llvm.org/D117348



More information about the cfe-commits mailing list