summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-11-19 00:46:18 +0000
committerTed Kremenek <kremenek@apple.com>2008-11-19 00:46:18 +0000
commit1b167108bbbf206e9d336fa3028d53d38f88adde (patch)
tree29f1998644e27aa55e1c571e223d691f58b2ca71 /clang/lib/Lex/PPDirectives.cpp
parentc7a366309d95c60132af664f7903086352d2b5e1 (diff)
downloadbcm5719-llvm-1b167108bbbf206e9d336fa3028d53d38f88adde.tar.gz
bcm5719-llvm-1b167108bbbf206e9d336fa3028d53d38f88adde.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. Performance testing of -Eonly on Cocoa.h shows no performance regression because of this patch. llvm-svn: 59574
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 07c5f8ea68e..cee2f406cdb 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -317,7 +317,7 @@ const FileEntry *Preprocessor::LookupFile(const char *FilenameStart,
// Otherwise, see if this is a subframework header. If so, this is relative
// to one of the headers on the #include stack. Walk the list of the current
// headers on the #include stack and pass them to HeaderInfo.
- if (CurLexer && !CurLexer->Is_PragmaLexer) {
+ if (IsNonPragmaNonMacroLexer()) {
if ((CurFileEnt = SourceMgr.getFileEntryForLoc(CurLexer->getFileLoc())))
if ((FE = HeaderInfo.LookupSubframeworkHeader(FilenameStart, FilenameEnd,
CurFileEnt)))
@@ -326,7 +326,7 @@ const FileEntry *Preprocessor::LookupFile(const char *FilenameStart,
for (unsigned i = 0, e = IncludeMacroStack.size(); i != e; ++i) {
IncludeStackInfo &ISEntry = IncludeMacroStack[e-i-1];
- if (ISEntry.TheLexer && !ISEntry.TheLexer->Is_PragmaLexer) {
+ if (IsNonPragmaNonMacroLexer(ISEntry)) {
if ((CurFileEnt =
SourceMgr.getFileEntryForLoc(ISEntry.TheLexer->getFileLoc())))
if ((FE = HeaderInfo.LookupSubframeworkHeader(FilenameStart,
OpenPOWER on IntegriCloud