diff options
author | Chris Lattner <sabre@nondot.org> | 2008-03-05 18:54:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-03-05 18:54:05 +0000 |
commit | 37e058783948f450f26dc863a694d28146a06d78 (patch) | |
tree | c8ac9f121af67cc67e4e079c0ea8eee6aec25224 /clang/Lex/PPExpressions.cpp | |
parent | ae3429f5f1287cc953f5f4cafcc99b684e9f1e96 (diff) | |
download | bcm5719-llvm-37e058783948f450f26dc863a694d28146a06d78.tar.gz bcm5719-llvm-37e058783948f450f26dc863a694d28146a06d78.zip |
remove the source location arguments to various target query methods.
llvm-svn: 47954
Diffstat (limited to 'clang/Lex/PPExpressions.cpp')
-rw-r--r-- | clang/Lex/PPExpressions.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/clang/Lex/PPExpressions.cpp b/clang/Lex/PPExpressions.cpp index c56692e1f47..cca76289176 100644 --- a/clang/Lex/PPExpressions.cpp +++ b/clang/Lex/PPExpressions.cpp @@ -195,25 +195,17 @@ static bool EvaluateValue(llvm::APSInt &Result, Token &PeekTok, // Character literals are always int or wchar_t, expand to intmax_t. TargetInfo &TI = PP.getTargetInfo(); - unsigned NumBits; - if (Literal.isWide()) - NumBits = TI.getWCharWidth(PP.getFullLoc(PeekTok.getLocation())); - else - NumBits = TI.getCharWidth(PP.getFullLoc(PeekTok.getLocation())); + unsigned NumBits = TI.getCharWidth(Literal.isWide()); // Set the width. llvm::APSInt Val(NumBits); // Set the value. Val = Literal.getValue(); // Set the signedness. - Val.setIsUnsigned(!TI.isCharSigned(PP.getFullLoc(PeekTok.getLocation()))); + Val.setIsUnsigned(!TI.isCharSigned()); if (Result.getBitWidth() > Val.getBitWidth()) { - if (Val.isSigned()) - Result = Val.sext(Result.getBitWidth()); - else - Result = Val.zext(Result.getBitWidth()); - Result.setIsUnsigned(Val.isUnsigned()); + Result = Val.extend(Result.getBitWidth()); } else { assert(Result.getBitWidth() == Val.getBitWidth() && "intmax_t smaller than char/wchar_t?"); @@ -603,8 +595,7 @@ EvaluateDirectiveExpression(IdentifierInfo *&IfNDefMacro) { Lex(Tok); // C99 6.10.1p3 - All expressions are evaluated as intmax_t or uintmax_t. - unsigned BitWidth = - getTargetInfo().getIntMaxTWidth(getFullLoc(Tok.getLocation())); + unsigned BitWidth = getTargetInfo().getIntMaxTWidth(); llvm::APSInt ResVal(BitWidth); DefinedTracker DT; |