From 41938c8493b4380df738263166b746eacb33c309 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 19 Nov 2008 21:57:25 +0000 Subject: - Move static function IsNonPragmaNonMacroLexer into Preprocessor.h. - Add variants of IsNonPragmaNonMacroLexer to accept an IncludeMacroStack entry (simplifies some uses). - Use IsNonPragmaNonMacroLexer in Preprocessor::LookupFile. - Add 'FileID' to PreprocessorLexer, and have Preprocessor query this fileid when looking up the FileEntry for a file Performance testing of -Eonly on Cocoa.h shows no performance regression because of this patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59666 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/PreprocessorLexer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/Lex/PreprocessorLexer.cpp') diff --git a/lib/Lex/PreprocessorLexer.cpp b/lib/Lex/PreprocessorLexer.cpp index 20bce413b7..2ce181ef83 100644 --- a/lib/Lex/PreprocessorLexer.cpp +++ b/lib/Lex/PreprocessorLexer.cpp @@ -18,6 +18,9 @@ using namespace clang; +PreprocessorLexer::PreprocessorLexer(Preprocessor* pp, SourceLocation L) + : PP(pp), FileID(pp->getSourceManager().getPhysicalLoc(L).getFileID()) {} + PreprocessorLexer::~PreprocessorLexer() {} void PreprocessorLexer::Diag(SourceLocation Loc, unsigned DiagID, -- cgit v1.2.1