Fix SectionPiece size when compiling with MSVC
authorHans Wennborg <hans@hanshq.net>
Thu, 20 Oct 2016 15:59:08 +0000 (15:59 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 20 Oct 2016 15:59:08 +0000 (15:59 +0000)
Builds were failing with:

  InputSection.h(139): error C2338: SectionPiece is too big

because MSVC does record layout differently, probably not packing the
'OutputOff' and 'Live' bitfields because their types are of different
size. Using size_t for 'Live' seems to fix it.

llvm-svn: 284740

lld/ELF/InputSection.h

index fdbe537..1efaeaf 100644 (file)
@@ -133,7 +133,7 @@ struct SectionPiece {
 
   size_t InputOff;
   ssize_t OutputOff : 8 * sizeof(ssize_t) - 1;
-  uint32_t Live : 1;
+  size_t Live : 1;
 };
 static_assert(sizeof(SectionPiece) == 2 * sizeof(size_t),
               "SectionPiece is too big");