summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPLexerChange.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-17 08:03:42 +0000
committerChris Lattner <sabre@nondot.org>2009-01-17 08:03:42 +0000
commitc809089b26dd334313b15cef0defa9e4d018a1aa (patch)
treeaa6e49adbddb1c05b8577ed35c5080bcf1352df1 /clang/lib/Lex/PPLexerChange.cpp
parent8ee1c9f220d0c9b3dab867bf3237d1400b82adfb (diff)
downloadbcm5719-llvm-c809089b26dd334313b15cef0defa9e4d018a1aa.tar.gz
bcm5719-llvm-c809089b26dd334313b15cef0defa9e4d018a1aa.zip
Change the Lexer ctor used in the non _Pragma case to take a FileID instead
of a SourceLocation. This should speed it up and definitely simplifies it. llvm-svn: 62422
Diffstat (limited to 'clang/lib/Lex/PPLexerChange.cpp')
-rw-r--r--clang/lib/Lex/PPLexerChange.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/clang/lib/Lex/PPLexerChange.cpp b/clang/lib/Lex/PPLexerChange.cpp
index cc8ccc4c107..60d42386d7a 100644
--- a/clang/lib/Lex/PPLexerChange.cpp
+++ b/clang/lib/Lex/PPLexerChange.cpp
@@ -74,16 +74,10 @@ void Preprocessor::EnterSourceFile(FileID FID, const DirectoryLookup *CurDir) {
MaxIncludeStackDepth = IncludeMacroStack.size();
if (PTH) {
- PTHLexer *PL = PTH->CreateLexer(FID, SourceMgr.getFileEntryForID(FID));
-
- if (PL) {
- EnterSourceFileWithPTH(PL, CurDir);
- return;
- }
+ if (PTHLexer *PL = PTH->CreateLexer(FID, SourceMgr.getFileEntryForID(FID)))
+ return EnterSourceFileWithPTH(PL, CurDir);
}
-
- Lexer *TheLexer = new Lexer(SourceMgr.getLocForStartOfFile(FID), *this);
- EnterSourceFileWithLexer(TheLexer, CurDir);
+ EnterSourceFileWithLexer(new Lexer(FID, *this), CurDir);
}
/// EnterSourceFileWithLexer - Add a source file to the top of the include stack
OpenPOWER on IntegriCloud