aboutsummaryrefslogtreecommitdiff
path: root/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
commit88d3ac1341aa016cabd966c5b113a95ac05ea43f (patch)
tree23cce01273947a09ec132c439eb43eb925b1dca5 /lib/Lex/PPLexerChange.cpp
parent28c90ad7ef7c609a0b10c2f68b519ef69e7084d1 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62422 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPLexerChange.cpp')
-rw-r--r--lib/Lex/PPLexerChange.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp
index cc8ccc4c10..60d42386d7 100644
--- a/lib/Lex/PPLexerChange.cpp
+++ b/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