aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r--lib/Lex/Preprocessor.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index c1d30573cd..f7c38e773a 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -260,15 +260,13 @@ unsigned Preprocessor::getSpelling(const Token &Tok,
// getting token spellings in the order of tokens, and thus can update
// its internal state so that it can quickly fetch spellings from the PTH
// file.
- Len =
- const_cast<PTHLexer*>(CurPTHLexer.get())->getSpelling(Tok.getLocation(),
- Buffer);
+ Len = CurPTHLexer.get()->getSpelling(Tok.getLocation(), Buffer);
}
else {
- SourceLocation sloc = SourceMgr.getSpellingLoc(Tok.getLocation());
- unsigned fid = SourceMgr.getCanonicalFileID(sloc);
- unsigned fpos = SourceMgr.getFullFilePos(sloc);
- Len = PTH->getSpelling(fid, fpos, Buffer);
+ SourceLocation SLoc = SourceMgr.getSpellingLoc(Tok.getLocation());
+ unsigned FID = SourceMgr.getCanonicalFileID(SLoc);
+ unsigned FPos = SourceMgr.getFullFilePos(SLoc);
+ Len = PTH->getSpelling(FID, FPos, Buffer);
}
// Did we find a spelling? If so return its length. Otherwise fall