[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 22 04:04:30 PDT 2020


riccibruno created this revision.
riccibruno added a reviewer: MyDeveloperDay.
riccibruno added a project: clang-format.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The underlying ABI forces `FormatToken` to have a lot of padding. Currently (on x86-64 linux) `sizeof(FormatToken) == 288`. After this patch `sizeof(FormatToken) == 232`.

No functional changes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84306

Files:
  clang/lib/Format/ContinuationIndenter.cpp
  clang/lib/Format/Format.cpp
  clang/lib/Format/FormatToken.cpp
  clang/lib/Format/FormatToken.h
  clang/lib/Format/TokenAnnotator.cpp
  clang/lib/Format/UnwrappedLineFormatter.cpp
  clang/lib/Format/UnwrappedLineParser.cpp
  clang/lib/Format/WhitespaceManager.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84306.279761.patch
Type: text/x-patch
Size: 31228 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200722/adcf9aa0/attachment-0001.bin>


More information about the cfe-commits mailing list