aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Lexer.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-11-19 21:57:25 +0000
committerTed Kremenek <kremenek@apple.com>2008-11-19 21:57:25 +0000
commit41938c8493b4380df738263166b746eacb33c309 (patch)
tree022e9ebc4fce4341598c81f1242256cd79830325 /lib/Lex/Lexer.cpp
parentcda658e90d7ffe0ece23d741ff82cf764108f66c (diff)
- 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
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r--lib/Lex/Lexer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp
index 8ddd62fe99..eebdd1e2eb 100644
--- a/lib/Lex/Lexer.cpp
+++ b/lib/Lex/Lexer.cpp
@@ -63,7 +63,8 @@ tok::ObjCKeywordKind Token::getObjCKeywordID() const {
/// outlive it, so it doesn't take ownership of either of them.
Lexer::Lexer(SourceLocation fileloc, Preprocessor &pp,
const char *BufStart, const char *BufEnd)
- : PreprocessorLexer(&pp), FileLoc(fileloc), Features(pp.getLangOptions()) {
+ : PreprocessorLexer(&pp, fileloc), FileLoc(fileloc),
+ Features(pp.getLangOptions()) {
SourceManager &SourceMgr = PP->getSourceManager();
unsigned InputFileID = SourceMgr.getPhysicalLoc(FileLoc).getFileID();
@@ -110,7 +111,9 @@ Lexer::Lexer(SourceLocation fileloc, Preprocessor &pp,
Lexer::Lexer(SourceLocation fileloc, const LangOptions &features,
const char *BufStart, const char *BufEnd,
const llvm::MemoryBuffer *FromFile)
- : PreprocessorLexer(0), FileLoc(fileloc), Features(features) {
+ : PreprocessorLexer(), FileLoc(fileloc),
+ Features(features) {
+
Is_PragmaLexer = false;
InitCharacterInfo();