diff options
author | Chris Lattner <sabre@nondot.org> | 2010-10-13 23:54:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-10-13 23:54:10 +0000 |
commit | 2c819b0358cff980cada4e8fd37212cb19c80534 (patch) | |
tree | f78c29b6914f458002a15f89cefc83cbe89026ff /llvm/lib/Support/APInt.cpp | |
parent | d100ed858e240b1ed132df00b6fed293fc4d669a (diff) | |
download | llvm-2c819b0358cff980cada4e8fd37212cb19c80534.zip llvm-2c819b0358cff980cada4e8fd37212cb19c80534.tar.gz llvm-2c819b0358cff980cada4e8fd37212cb19c80534.tar.bz2 |
constify these methods.
llvm-svn: 116455
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index 51203f6..ca68988 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -2046,27 +2046,27 @@ void APInt::udivrem(const APInt &LHS, const APInt &RHS, divide(LHS, lhsWords, RHS, rhsWords, &Quotient, &Remainder); } -APInt APInt::sadd_ov(const APInt &RHS, bool &Overflow) { +APInt APInt::sadd_ov(const APInt &RHS, bool &Overflow) const { APInt Res = *this+RHS; Overflow = isNonNegative() == RHS.isNonNegative() && Res.isNonNegative() != isNonNegative(); return Res; } -APInt APInt::ssub_ov(const APInt &RHS, bool &Overflow) { +APInt APInt::ssub_ov(const APInt &RHS, bool &Overflow) const { APInt Res = *this - RHS; Overflow = isNonNegative() != RHS.isNonNegative() && Res.isNonNegative() != isNonNegative(); return Res; } -APInt APInt::sdiv_ov(const APInt &RHS, bool &Overflow) { +APInt APInt::sdiv_ov(const APInt &RHS, bool &Overflow) const { // MININT/-1 --> overflow. Overflow = isMinSignedValue() && RHS.isAllOnesValue(); return sdiv(RHS); } -APInt APInt::smul_ov(const APInt &RHS, bool &Overflow) { +APInt APInt::smul_ov(const APInt &RHS, bool &Overflow) const { APInt Res = *this * RHS; if (*this != 0 && RHS != 0) @@ -2076,7 +2076,7 @@ APInt APInt::smul_ov(const APInt &RHS, bool &Overflow) { return Res; } -APInt APInt::sshl_ov(unsigned ShAmt, bool &Overflow) { +APInt APInt::sshl_ov(unsigned ShAmt, bool &Overflow) const { Overflow = ShAmt >= getBitWidth(); if (Overflow) ShAmt = getBitWidth()-1; |