suck the call to "getSpellingLoc" that all clients do into

the implementation of PTHManager::getSpelling.

llvm-svn: 62408
This commit is contained in:
Chris Lattner
2009-01-17 06:29:33 +00:00
parent d32480d3db
commit 3793bba26f
3 changed files with 5 additions and 7 deletions

View File

@@ -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