[cfe-commits] r62311 - /cfe/trunk/lib/Lex/Preprocessor.cpp
Chris Lattner
sabre at nondot.org
Thu Jan 15 23:02:15 PST 2009
Author: lattner
Date: Fri Jan 16 01:02:14 2009
New Revision: 62311
URL: http://llvm.org/viewvc/llvm-project?rev=62311&view=rev
Log:
remove an unneeded const_cast.
Modified:
cfe/trunk/lib/Lex/Preprocessor.cpp
Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=62311&r1=62310&r2=62311&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Fri Jan 16 01:02:14 2009
@@ -260,15 +260,13 @@
// 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
More information about the cfe-commits
mailing list