summaryrefslogtreecommitdiffstats
path: root/clang/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
commit45245217bcf82bccad31d4eb63e2dc827c5dca35 (patch)
tree23707291ed965503dd47ff02f9d41a43fa3610ef /clang/lib/Lex/Lexer.cpp
parent78fb6214f39f2bec2468af7997dc0e43e0ef2188 (diff)
downloadbcm5719-llvm-45245217bcf82bccad31d4eb63e2dc827c5dca35.tar.gz
bcm5719-llvm-45245217bcf82bccad31d4eb63e2dc827c5dca35.zip
- 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. llvm-svn: 59666
Diffstat (limited to 'clang/lib/Lex/Lexer.cpp')
-rw-r--r--clang/lib/Lex/Lexer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp
index 8ddd62fe998..eebdd1e2eb3 100644
--- a/clang/lib/Lex/Lexer.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud