diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-16 07:02:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-16 07:02:14 +0000 |
commit | 9938d0731d627fd6dad28faa3acd07f1c6050af0 (patch) | |
tree | 34b374bc60ea569ae5ea3c73bb35d2e9e64a7f62 /lib/Lex/Preprocessor.cpp | |
parent | 18376ddf4d900f5e79deb40e43984df4f06e92d9 (diff) |
remove an unneeded const_cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62311 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 12 |
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 |