From b69143c6a9bfc969e7c95bbd48b83bb962086070 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 16 Nov 2013 16:25:41 +0000 Subject: Annotate APInt methods where it's not clear whether they are in place with warn_unused_result. Fix ScalarEvolution bugs uncovered by this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194928 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/ScalarEvolution.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 0f54d7e..0a02f4e 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -6684,9 +6684,9 @@ static const APInt gcd(const SCEVConstant *C1, const SCEVConstant *C2) { uint32_t BBW = B.getBitWidth(); if (ABW > BBW) - B.zext(ABW); + B = B.zext(ABW); else if (ABW < BBW) - A.zext(BBW); + A = A.zext(BBW); return APIntOps::GreatestCommonDivisor(A, B); } @@ -6698,9 +6698,9 @@ static const APInt srem(const SCEVConstant *C1, const SCEVConstant *C2) { uint32_t BBW = B.getBitWidth(); if (ABW > BBW) - B.sext(ABW); + B = B.sext(ABW); else if (ABW < BBW) - A.sext(BBW); + A = A.sext(BBW); return APIntOps::srem(A, B); } @@ -6712,9 +6712,9 @@ static const APInt sdiv(const SCEVConstant *C1, const SCEVConstant *C2) { uint32_t BBW = B.getBitWidth(); if (ABW > BBW) - B.sext(ABW); + B = B.sext(ABW); else if (ABW < BBW) - A.sext(BBW); + A = A.sext(BBW); return APIntOps::sdiv(A, B); } -- cgit v1.1