[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 16:41:36 PDT 2016


jlebar updated this revision to Diff 66401.
jlebar marked 4 inline comments as done.
jlebar added a comment.

In IRL conversation, we realized that this patch would be a lot simpler if we
relied on the fact that assigning a too-large value to an unsigned bitfield
field is guaranteed to truncate.

This gets around the assumptions I was making in the LLVM_BITFIELD_WIDTH macro,
that the target type is default-constructible and so on.  It's also just less
code.


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.66401.patch
Type: text/x-patch
Size: 4176 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160801/f21eec6f/attachment.bin>


More information about the llvm-commits mailing list