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 | 98be4943e8dc4f3905629a7102668960873cf863 (patch) | |
tree | 6f331c03a440216936c5c47e2e283b327ee46912 /Lex/PPExpressions.cpp | |
parent | 631bf6c3251e57485d6a24d1137e39434a4afaad (diff) |
remove the source location arguments to various target query methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47954 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Lex/PPExpressions.cpp')
-rw-r--r-- | Lex/PPExpressions.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/Lex/PPExpressions.cpp b/Lex/PPExpressions.cpp index c56692e1f4..cca7628917 100644 --- a/Lex/PPExpressions.cpp +++ b/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; |