diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-10-13 22:18:22 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-10-13 22:18:22 +0000 |
commit | 8fe0cabb93d385022e3cf5c3a9f0fc9f491ef827 (patch) | |
tree | 7aa39605cd7e2dd2fc66349b7f9c162a3c3b7ade /lib/Lex/PPExpressions.cpp | |
parent | c4ff5948c17bd0bd33dbca6e58370e0a5b49fb00 (diff) |
Fix the build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219637 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPExpressions.cpp')
-rw-r--r-- | lib/Lex/PPExpressions.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp index a96fb4edc3..8408aa2314 100644 --- a/lib/Lex/PPExpressions.cpp +++ b/lib/Lex/PPExpressions.cpp @@ -599,15 +599,10 @@ static bool EvaluateDirectiveSubExpr(PPValue &LHS, unsigned MinPrec, break; case tok::lessless: { // Determine whether overflow is about to happen. - unsigned ShAmt = static_cast<unsigned>(RHS.Val.getLimitedValue()); - if (LHS.isUnsigned()) { - Overflow = ShAmt >= LHS.Val.getBitWidth(); - if (Overflow) - ShAmt = LHS.Val.getBitWidth()-1; - Res = LHS.Val << ShAmt; - } else { - Res = llvm::APSInt(LHS.Val.sshl_ov(ShAmt, Overflow), false); - } + if (LHS.isUnsigned()) + Res = LHS.Val.ushl_ov(RHS.Val, Overflow); + else + Res = llvm::APSInt(LHS.Val.sshl_ov(RHS.Val, Overflow), false); break; } case tok::greatergreater: { |