[PATCH] D118315: [ADT] Refactor comparison operator in APSInt by compareValues

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 00:15:52 PST 2022


rjmccall requested changes to this revision.
rjmccall added a comment.
This revision now requires changes to proceed.

These assertions are actually protecting against some pretty significant sources of bugs, like trying to evaluate a constant comparison without applying the appropriate conversions on the operands first.  `APSInt` models a consistent integer type of statically-unknown width and signedness; if you're trying to use it as a possibly-negative arbitrary-precision integer, a lot of the behavior is wrong, like the fact that overflow will wrap around instead of extending the storage.

I do think it would be useful to have a type that models arbitrary-precision integer math, if you want to work on that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118315



More information about the llvm-commits mailing list