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 | 3e8b6ac54c4868b545b304c95789c01b90945213 (patch) | |
tree | 370888e99c990924c86e929ae0d582f172cac081 /clang/lib | |
parent | 1c5fce0ebb301d85d7f0ad03a41b96d57a211c32 (diff) | |
download | bcm5719-llvm-3e8b6ac54c4868b545b304c95789c01b90945213.tar.gz bcm5719-llvm-3e8b6ac54c4868b545b304c95789c01b90945213.zip |
Fix the build
llvm-svn: 219637
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Lex/PPExpressions.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/clang/lib/Lex/PPExpressions.cpp b/clang/lib/Lex/PPExpressions.cpp index a96fb4edc3e..8408aa2314d 100644 --- a/clang/lib/Lex/PPExpressions.cpp +++ b/clang/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: { |