[cfe-commits] r59731 - in /cfe/trunk: include/clang/Lex/Preprocessor.h lib/Lex/PPDirectives.cpp lib/Lex/PPLexerChange.cpp
Ted Kremenek
kremenek at apple.com
Thu Nov 20 08:19:56 PST 2008
Author: kremenek
Date: Thu Nov 20 10:19:53 2008
New Revision: 59731
URL: http://llvm.org/viewvc/llvm-project?rev=59731&view=rev
Log:
Rename IsNonPragmaNonMacroLexer to IsFileLexer.
Modified:
cfe/trunk/include/clang/Lex/Preprocessor.h
cfe/trunk/lib/Lex/PPDirectives.cpp
cfe/trunk/lib/Lex/PPLexerChange.cpp
Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=59731&r1=59730&r2=59731&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Thu Nov 20 10:19:53 2008
@@ -611,7 +611,7 @@
- static bool IsNonPragmaNonMacroLexer(const Lexer* L,
+ static bool IsFileLexer(const Lexer* L,
const PreprocessorLexer* P) {
if (L)
return !L->isPragmaLexer();
@@ -619,12 +619,12 @@
return P != 0;
}
- static bool IsNonPragmaNonMacroLexer(const IncludeStackInfo& I) {
- return IsNonPragmaNonMacroLexer(I.TheLexer, I.ThePPLexer);
+ static bool IsFileLexer(const IncludeStackInfo& I) {
+ return IsFileLexer(I.TheLexer, I.ThePPLexer);
}
- bool IsNonPragmaNonMacroLexer() const {
- return IsNonPragmaNonMacroLexer(CurLexer.get(), CurPPLexer);
+ bool IsFileLexer() const {
+ return IsFileLexer(CurLexer.get(), CurPPLexer);
}
//===--------------------------------------------------------------------===//
Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=59731&r1=59730&r2=59731&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Thu Nov 20 10:19:53 2008
@@ -317,7 +317,7 @@
// 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 (IsNonPragmaNonMacroLexer()) {
+ if (IsFileLexer()) {
if ((CurFileEnt = SourceMgr.getFileEntryForID(CurPPLexer->getFileID())))
if ((FE = HeaderInfo.LookupSubframeworkHeader(FilenameStart, FilenameEnd,
CurFileEnt)))
@@ -326,7 +326,7 @@
for (unsigned i = 0, e = IncludeMacroStack.size(); i != e; ++i) {
IncludeStackInfo &ISEntry = IncludeMacroStack[e-i-1];
- if (IsNonPragmaNonMacroLexer(ISEntry)) {
+ if (IsFileLexer(ISEntry)) {
if ((CurFileEnt =
SourceMgr.getFileEntryForID(ISEntry.ThePPLexer->getFileID())))
if ((FE = HeaderInfo.LookupSubframeworkHeader(FilenameStart,
Modified: cfe/trunk/lib/Lex/PPLexerChange.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPLexerChange.cpp?rev=59731&r1=59730&r2=59731&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPLexerChange.cpp (original)
+++ cfe/trunk/lib/Lex/PPLexerChange.cpp Thu Nov 20 10:19:53 2008
@@ -30,14 +30,14 @@
/// isInPrimaryFile - Return true if we're in the top-level file, not in a
/// #include. This looks through macro expansions and active _Pragma lexers.
bool Preprocessor::isInPrimaryFile() const {
- if (IsNonPragmaNonMacroLexer())
+ if (IsFileLexer())
return IncludeMacroStack.empty();
// If there are any stacked lexers, we're in a #include.
- assert(IsNonPragmaNonMacroLexer(IncludeMacroStack[0]) &&
+ assert(IsFileLexer(IncludeMacroStack[0]) &&
"Top level include stack isn't our primary lexer?");
for (unsigned i = 1, e = IncludeMacroStack.size(); i != e; ++i)
- if (IsNonPragmaNonMacroLexer(IncludeMacroStack[i]))
+ if (IsFileLexer(IncludeMacroStack[i]))
return false;
return true;
}
@@ -46,13 +46,13 @@
/// that this ignores any potentially active macro expansions and _Pragma
/// expansions going on at the time.
PreprocessorLexer *Preprocessor::getCurrentFileLexer() const {
- if (IsNonPragmaNonMacroLexer())
+ if (IsFileLexer())
return CurPPLexer;
// Look for a stacked lexer.
for (unsigned i = IncludeMacroStack.size(); i != 0; --i) {
const IncludeStackInfo& ISI = IncludeMacroStack[i-1];
- if (IsNonPragmaNonMacroLexer(ISI))
+ if (IsFileLexer(ISI))
return ISI.ThePPLexer;
}
return 0;
More information about the cfe-commits
mailing list