[APSInt] Use APInt::compare and APInt::compareSigned to implement APSInt::compareValue
authorCraig Topper <craig.topper@gmail.com>
Fri, 21 Apr 2017 22:32:27 +0000 (22:32 +0000)
committerCraig Topper <craig.topper@gmail.com>
Fri, 21 Apr 2017 22:32:27 +0000 (22:32 +0000)
commitfeaa5514db0e622b667583b481479acc06bf9252
tree252ef50a0effdc500e053b002ee9221b464168ba
parent19ce7adc7fcf900a78d6b61875b0920085603ba8
[APSInt] Use APInt::compare and APInt::compareSigned to implement APSInt::compareValue

APInt just got compare methods that return -1, 0, or 1 instead of just having ult/slt and eq.

This patch uses these methods to implement APSInt::compareValues so that we don't have to call do an equal comparison and then possibly a second less than comparison.

Differential Revision: https://reviews.llvm.org/D32381

llvm-svn: 301053
llvm/include/llvm/ADT/APInt.h
llvm/include/llvm/ADT/APSInt.h