[PATCH] D69471: [Coverage] Revise format to reduce binary size

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 19 16:32:47 PST 2020


rnk added a comment.

Compiling with -fdump-record-layouts revealed the problem:

  *** Dumping AST Record Layout
           0 | struct llvm::coverage::CovMapFunctionRecordV3
           0 |   struct llvm::coverage::accessors::FuncHashAndDataSize<struct llvm::coverage::CovMapFunctionRecordV3> (base) (empty)
           1 |   struct llvm::coverage::accessors::HashedNameRef<struct llvm::coverage::CovMapFunctionRecordV3> (base) (empty)
           1 |   const int64_t NameRef
           9 |   const uint32_t DataSize
          13 |   const uint64_t FuncHash
          21 |   const uint64_t FilenamesRef
          29 |   const char CoverageMapping
             | [sizeof=30, align=1,
             |  nvsize=30, nvalign=1]

Everything is off-by-one because the empty bases are not zero sized. The MSVC record layout algorithm is just different in this area. =/

So, I think this patch would be fine if you refactor it to avoid the accessor classes. I took a stab at it, but it's not straightforward.


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

https://reviews.llvm.org/D69471





More information about the cfe-commits mailing list