summaryrefslogtreecommitdiffstats
path: root/clang/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
commit3793bba26f07de9be04930dcce2c631c715e9a5c (patch)
treea48bbc432a74bc0ef3bb0206e78c0761aee13183 /clang/lib/Lex/Preprocessor.cpp
parentd32480d3db582186355d575db0421dd2823080b6 (diff)
downloadbcm5719-llvm-3793bba26f07de9be04930dcce2c631c715e9a5c.tar.gz
bcm5719-llvm-3793bba26f07de9be04930dcce2c631c715e9a5c.zip
suck the call to "getSpellingLoc" that all clients do into
the implementation of PTHManager::getSpelling. llvm-svn: 62408
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 976e1a2f7ab..ff84b0abf36 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud