[PATCH] D25073: [DebugInfo]: preparation to implement DW_AT_alignment

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 14:10:06 PDT 2016


probinson added inline comments.


================
Comment at: include/llvm/IR/DebugInfoMetadata.h:1829
   unsigned Line;
+  uint64_t AlignInBits;
 
----------------
aprantl wrote:
> vleschuk wrote:
> > aprantl wrote:
> > > Sorry for noticing this so late:
> > > Does this really need to be a 64bit integer, or would a 32-bit unsigned be sufficient?
> > > A 32-bit unsigned could immediately follow the previous unsigned field und thus save 8 bytes.
> > SizeInBits and OffsetInBits in DebugInfoMetadata scope are 64bit. If we change this to 32bit for efficiency I'd suggest to make it as separate commit and change all of them.
> I don't see how that follows: SizeInBits may legitimately have values larger than 2^32, but the alignment should rarely be anything larger than fits in one byte?
It's not hard to imagine page-aligned items and pages are generally bigger than what a byte can express.  But it is hard to imagine needing more than a 32-bit value to express alignment.


https://reviews.llvm.org/D25073





More information about the llvm-commits mailing list