diff options
author | Chris Lattner <sabre@nondot.org> | 2010-10-14 00:05:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-10-14 00:05:07 +0000 |
commit | eafc5cb80d58cb9447623a557be4d4f55f42fbc3 (patch) | |
tree | 56190b2247d2cd228717675daad96d9864deee39 /include/llvm/ADT/APInt.h | |
parent | 08e90f5646e61c3be0eebfa172ec73a8b56abee8 (diff) | |
download | external_llvm-eafc5cb80d58cb9447623a557be4d4f55f42fbc3.zip external_llvm-eafc5cb80d58cb9447623a557be4d4f55f42fbc3.tar.gz external_llvm-eafc5cb80d58cb9447623a557be4d4f55f42fbc3.tar.bz2 |
add uadd_ov/usub_ov to apint, consolidate constant folding
logic to use the new APInt methods. Among other things this
implements rdar://8501501 - llvm.smul.with.overflow.i32 should constant fold
which comes from "clang -ftrapv", originally brought to my attention from PR8221.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/APInt.h')
-rw-r--r-- | include/llvm/ADT/APInt.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index 22c54f3..e03f63b 100644 --- a/include/llvm/ADT/APInt.h +++ b/include/llvm/ADT/APInt.h @@ -806,10 +806,10 @@ public: // Operations that return overflow indicators. - - // ssub_ov - Signed subtraction. Unsigned subtraction never overflows. APInt sadd_ov(const APInt &RHS, bool &Overflow) const; + APInt uadd_ov(const APInt &RHS, bool &Overflow) const; APInt ssub_ov(const APInt &RHS, bool &Overflow) const; + APInt usub_ov(const APInt &RHS, bool &Overflow) const; APInt sdiv_ov(const APInt &RHS, bool &Overflow) const; APInt smul_ov(const APInt &RHS, bool &Overflow) const; APInt sshl_ov(unsigned Amt, bool &Overflow) const; @@ -877,7 +877,7 @@ public: /// the validity of the less-than relationship. /// @returns true if *this < RHS when both are considered unsigned. /// @brief Unsigned less than comparison - bool ult(const APInt& RHS) const; + bool ult(const APInt &RHS) const; /// Regards both *this as an unsigned quantity and compares it with RHS for /// the validity of the less-than relationship. |