From 9938d0731d627fd6dad28faa3acd07f1c6050af0 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 16 Jan 2009 07:02:14 +0000 Subject: [PATCH] remove an unneeded const_cast. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62311 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/Preprocessor.cpp | 12 +++++------- 1 file 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(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 -- 2.40.0