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 | 15af77f67939d927e3164a39edf2a17a68fad68e (patch) | |
tree | a0899741c5f2b9efe30862c887534859bd58e86c /clang/lib/Lex/Preprocessor.cpp | |
parent | ca0c7e5a34ef90b9c71145adaffb474613df9e3d (diff) | |
download | bcm5719-llvm-15af77f67939d927e3164a39edf2a17a68fad68e.tar.gz bcm5719-llvm-15af77f67939d927e3164a39edf2a17a68fad68e.zip |
remove an unneeded const_cast.
llvm-svn: 62311
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index c1d30573cda..f7c38e773a5 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/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 |