diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-17 06:29:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-17 06:29:33 +0000 |
commit | 3793bba26f07de9be04930dcce2c631c715e9a5c (patch) | |
tree | a48bbc432a74bc0ef3bb0206e78c0761aee13183 /clang/lib/Lex/Preprocessor.cpp | |
parent | d32480d3db582186355d575db0421dd2823080b6 (diff) | |
download | bcm5719-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.cpp | 6 |
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 |