[PATCH] D23035: [Support] Add LLVM_BITFIELD_WIDTH and LLVM_CHECKED_BITFIELD_ASSIGN macros.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 14:32:02 PDT 2016


jlebar created this revision.
jlebar added a reviewer: chandlerc.
jlebar added subscribers: llvm-commits, majnemer, timshen.

The latter lets us assign to a bitfield while also checking that the RHS
fits into the field.

There are many places where we check that the RHS "fits" before
assigning it to a bitfield; this lets us replace those with a single
line (which also correctly infers the size of the LHS).

https://reviews.llvm.org/D23035

Files:
  llvm/include/llvm/Support/Bitfields.h
  llvm/unittests/Support/BitfieldsTest.cpp
  llvm/unittests/Support/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23035.66381.patch
Type: text/x-patch
Size: 5264 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160801/2dbd064e/attachment.bin>


More information about the llvm-commits mailing list