[PATCH] D140059: [APSInt] Fix bug in APSInt mentioned in https://github.com/llvm/llvm-project/issues/59515

Sergei Barannikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 13:22:16 PST 2022


barannikov88 added inline comments.


================
Comment at: llvm/include/llvm/ADT/APSInt.h:94
+    // not give them a vague value at the first place.
+    return (isSigned() && getMinSignedBits() <= 64) ||
+           (!isSigned() && getActiveBits() <= 63);
----------------
The comment near `getMinSignBits` says that it is deprecated (and "use `getSignificantBits()` instead").
There are also `isSignedIntN` and `isIntN`, which can be useful:
```
    return isSigned() ? isSignedIntN(64) : isIntN(63);
```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140059



More information about the llvm-commits mailing list