This is an archive of the discontinued LLVM Phabricator instance.

[Bitfields][NFC] Make sure bitfields are contiguous
ClosedPublic

Authored by gchatelet on Jul 6 2020, 2:33 AM.

Diff Detail

Event Timeline

gchatelet created this revision.Jul 6 2020, 2:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2020, 2:33 AM
courbet added inline comments.Jul 6 2020, 11:26 PM
llvm/include/llvm/IR/Instruction.h
70

The curretn naming does not make it immediately obvious what is a generic type (e.g. AlignmentBitfieldElement, BoolBitfieldElement) from an instantiation of this type with specific semantics (e.g. AlignmentField, SwiftErrorField). I think just appending a T or Type would make things more obvious: AlignmentBitfieldElementT, BoolBitfieldElementT.

llvm/include/llvm/IR/Instructions.h
63–68

What would you think of:

using AlignmentField = AlignmentBitfieldElement<0>;          // Next bit:5
using UsedWithInAllocaField = BoolBitfieldElement<AlignmentField::next>;        // Next bit:6
using SwiftErrorField = BoolBitfieldElement<UsedWithInAllocaField::next>;              // Next bit:7
gchatelet updated this revision to Diff 275947.Jul 7 2020, 2:03 AM
  • Address comments
gchatelet marked 2 inline comments as done.Jul 7 2020, 2:03 AM
gchatelet updated this revision to Diff 275970.Jul 7 2020, 3:09 AM
  • Various nits
courbet accepted this revision.Jul 7 2020, 4:14 AM
courbet added inline comments.
llvm/include/llvm/IR/InstrTypes.h
1098–1099

here too ?

This revision is now accepted and ready to land.Jul 7 2020, 4:14 AM
This revision was automatically updated to reflect the committed changes.
gchatelet marked an inline comment as done.