llvm.org GIT mirror llvm / 5defae6
APSInt: Simplify code to reduce the number of copies. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219586 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 6 years ago
1 changed file(s) with 7 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
268268 else if (I2.getBitWidth() > I1.getBitWidth())
269269 return isSameValue(I1.extend(I2.getBitWidth()), I2);
270270
271 // We have a signedness mismatch. Turn the signed value into an unsigned
272 // value.
273 if (I1.isSigned()) {
274 if (I1.isNegative())
275 return false;
276
277 return APSInt(I1, true) == I2;
278 }
279
280 if (I2.isNegative())
271 assert(I1.isSigned() != I2.isSigned());
272
273 // We have a signedness mismatch. Check for negative values and do an
274 // unsigned compare if signs match.
275 if ((I1.isSigned() && I1.isNegative()) ||
276 (!I1.isSigned() && I2.isNegative()))
281277 return false;
282278
283 return I1 == APSInt(I2, true);
279 return I1.eq(I2);
284280 }
285281
286282 /// Profile - Used to insert APSInt objects, or objects that contain APSInt