aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-17 06:29:33 +0000
committerChris Lattner <sabre@nondot.org>2009-01-17 06:29:33 +0000
commit6b7b84036126a8f2a3e312cfec0a9a4f8ae9d8ed (patch)
tree50bcfc6617efa112aa3896ec7b96512744b4cd63 /lib/Lex/Preprocessor.cpp
parent2b2453a7d8fe732561795431f39ceb2b2a832d84 (diff)
suck the call to "getSpellingLoc" that all clients do into
the implementation of PTHManager::getSpelling. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r--lib/Lex/Preprocessor.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index 976e1a2f7a..ff84b0abf3 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -199,8 +199,7 @@ std::string Preprocessor::getSpelling(const Token &Tok) const {
const char* TokStart;
if (PTH) {
- SourceLocation SLoc = SourceMgr.getSpellingLoc(Tok.getLocation());
- if (unsigned Len = PTH->getSpelling(SLoc, TokStart)) {
+ if (unsigned Len = PTH->getSpelling(Tok.getLocation(), TokStart)) {
assert(!Tok.needsCleaning());
return std::string(TokStart, TokStart+Len);
}
@@ -254,8 +253,7 @@ unsigned Preprocessor::getSpelling(const Token &Tok,
if (CurPTHLexer) {
Len = CurPTHLexer.get()->getSpelling(Tok.getLocation(), Buffer);
} else {
- Len = PTH->getSpelling(SourceMgr.getSpellingLoc(Tok.getLocation()),
- Buffer);
+ Len = PTH->getSpelling(Tok.getLocation(), Buffer);
}
// Did we find a spelling? If so return its length. Otherwise fall