Deleted Added
full compact
APSInt.h (256281) APSInt.h (263508)
1//===-- llvm/ADT/APSInt.h - Arbitrary Precision Signed Int -----*- C++ -*--===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 54 unchanged lines hidden (view full) ---

63 }
64 /// toString - Converts an APInt to a std::string. This is an inefficient
65 /// method, your should prefer passing in a SmallString instead.
66 std::string toString(unsigned Radix) const {
67 return APInt::toString(Radix, isSigned());
68 }
69 using APInt::toString;
70
1//===-- llvm/ADT/APSInt.h - Arbitrary Precision Signed Int -----*- C++ -*--===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 54 unchanged lines hidden (view full) ---

63 }
64 /// toString - Converts an APInt to a std::string. This is an inefficient
65 /// method, your should prefer passing in a SmallString instead.
66 std::string toString(unsigned Radix) const {
67 return APInt::toString(Radix, isSigned());
68 }
69 using APInt::toString;
70
71 APSInt trunc(uint32_t width) const {
71 APSInt LLVM_ATTRIBUTE_UNUSED_RESULT trunc(uint32_t width) const {
72 return APSInt(APInt::trunc(width), IsUnsigned);
73 }
74
72 return APSInt(APInt::trunc(width), IsUnsigned);
73 }
74
75 APSInt extend(uint32_t width) const {
75 APSInt LLVM_ATTRIBUTE_UNUSED_RESULT extend(uint32_t width) const {
76 if (IsUnsigned)
77 return APSInt(zext(width), IsUnsigned);
78 else
79 return APSInt(sext(width), IsUnsigned);
80 }
81
76 if (IsUnsigned)
77 return APSInt(zext(width), IsUnsigned);
78 else
79 return APSInt(sext(width), IsUnsigned);
80 }
81
82 APSInt extOrTrunc(uint32_t width) const {
82 APSInt LLVM_ATTRIBUTE_UNUSED_RESULT extOrTrunc(uint32_t width) const {
83 if (IsUnsigned)
84 return APSInt(zextOrTrunc(width), IsUnsigned);
85 else
86 return APSInt(sextOrTrunc(width), IsUnsigned);
87 }
88
89 const APSInt &operator%=(const APSInt &RHS) {
90 assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");

--- 116 unchanged lines hidden (view full) ---

207 static_cast<APInt&>(*this) ^= RHS;
208 return *this;
209 }
210
211 APSInt operator&(const APSInt& RHS) const {
212 assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
213 return APSInt(static_cast<const APInt&>(*this) & RHS, IsUnsigned);
214 }
83 if (IsUnsigned)
84 return APSInt(zextOrTrunc(width), IsUnsigned);
85 else
86 return APSInt(sextOrTrunc(width), IsUnsigned);
87 }
88
89 const APSInt &operator%=(const APSInt &RHS) {
90 assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");

--- 116 unchanged lines hidden (view full) ---

207 static_cast<APInt&>(*this) ^= RHS;
208 return *this;
209 }
210
211 APSInt operator&(const APSInt& RHS) const {
212 assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
213 return APSInt(static_cast<const APInt&>(*this) & RHS, IsUnsigned);
214 }
215 APSInt And(const APSInt& RHS) const {
215 APSInt LLVM_ATTRIBUTE_UNUSED_RESULT And(const APSInt& RHS) const {
216 return this->operator&(RHS);
217 }
218
219 APSInt operator|(const APSInt& RHS) const {
220 assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
221 return APSInt(static_cast<const APInt&>(*this) | RHS, IsUnsigned);
222 }
216 return this->operator&(RHS);
217 }
218
219 APSInt operator|(const APSInt& RHS) const {
220 assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
221 return APSInt(static_cast<const APInt&>(*this) | RHS, IsUnsigned);
222 }
223 APSInt Or(const APSInt& RHS) const {
223 APSInt LLVM_ATTRIBUTE_UNUSED_RESULT Or(const APSInt& RHS) const {
224 return this->operator|(RHS);
225 }
226
227
228 APSInt operator^(const APSInt& RHS) const {
229 assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
230 return APSInt(static_cast<const APInt&>(*this) ^ RHS, IsUnsigned);
231 }
224 return this->operator|(RHS);
225 }
226
227
228 APSInt operator^(const APSInt& RHS) const {
229 assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
230 return APSInt(static_cast<const APInt&>(*this) ^ RHS, IsUnsigned);
231 }
232 APSInt Xor(const APSInt& RHS) const {
232 APSInt LLVM_ATTRIBUTE_UNUSED_RESULT Xor(const APSInt& RHS) const {
233 return this->operator^(RHS);
234 }
235
236 APSInt operator*(const APSInt& RHS) const {
237 assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
238 return APSInt(static_cast<const APInt&>(*this) * RHS, IsUnsigned);
239 }
240 APSInt operator+(const APSInt& RHS) const {

--- 72 unchanged lines hidden ---
233 return this->operator^(RHS);
234 }
235
236 APSInt operator*(const APSInt& RHS) const {
237 assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
238 return APSInt(static_cast<const APInt&>(*this) * RHS, IsUnsigned);
239 }
240 APSInt operator+(const APSInt& RHS) const {

--- 72 unchanged lines hidden ---