[PATCH] D53914: [ADT] Fix support for over-aligned pointers in PointerSumType

Eugene Sharygin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 30 17:08:36 PDT 2018


eush created this revision.
eush added reviewers: chandlerc, rsmith.
Herald added subscribers: kristina, dexonsmith.

This fixes compilation error when the tag of `PointerSumType` is wider than an
`int`, which is the case when the payload has too many low bits available.

E.g. on x86-64 when the payload is 8 bit wide and the tag is 56 bit wide, GCC
reports the following error message:

  include/llvm/ADT/PointerSumType.h:252:37: error: right operand of shift expression ‘(1 << 56)’ is >= than the precision of the left operand [-fpermissive]
       static_assert(MemberT::Tag < (1 << NumTagBits),
                                    ~~~^~~~~~~~~~~~~~


Repository:
  rL LLVM

https://reviews.llvm.org/D53914

Files:
  include/llvm/ADT/PointerSumType.h
  unittests/ADT/PointerSumTypeTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53914.171840.patch
Type: text/x-patch
Size: 3995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181031/066f682f/attachment.bin>


More information about the llvm-commits mailing list