[PATCH] D109555: [APInt] Enable APInt to support zero bit integers.

Andrew Young via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 9 18:08:25 PDT 2021


youngar added inline comments.


================
Comment at: llvm/include/llvm/ADT/APInt.h:1440-1444
   uint64_t getZExtValue() const {
-    if (isSingleWord())
+    if (isSingleWord()) {
+      assert(BitWidth && "zero width values not allowed");
       return U.VAL;
+    }
----------------
youngar wrote:
> In the initial comment block you mention that zext is defined, should this assert be removed?
Oh, this should be moved to `getSExtValue()`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109555/new/

https://reviews.llvm.org/D109555



More information about the llvm-commits mailing list