summaryrefslogtreecommitdiffstats
path: root/clang/Lex/PPExpressions.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-05 18:54:05 +0000
committerChris Lattner <sabre@nondot.org>2008-03-05 18:54:05 +0000
commit37e058783948f450f26dc863a694d28146a06d78 (patch)
treec8ac9f121af67cc67e4e079c0ea8eee6aec25224 /clang/Lex/PPExpressions.cpp
parentae3429f5f1287cc953f5f4cafcc99b684e9f1e96 (diff)
downloadbcm5719-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.cpp17
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;
OpenPOWER on IntegriCloud