diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-11-20 01:49:44 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-11-20 01:49:44 +0000 |
commit | 68e48e4a81767997ef0231e47eca4f665102c95e (patch) | |
tree | d9f40900556ed1e908dc4ec32c116a76a78c634c /lib/Lex/PPLexerChange.cpp | |
parent | 35c10c25ddec4effbd26dead23ea5b04ee32f45a (diff) |
Preprocessor::getCurrentFileLexer() now returns a PreprocessorLexer* instead of
a Lexer*. This means it will either return the current (normal) file Lexer or a
PTHLexer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59694 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPLexerChange.cpp')
-rw-r--r-- | lib/Lex/PPLexerChange.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp index 0d5147c5b2..09b60768fc 100644 --- a/lib/Lex/PPLexerChange.cpp +++ b/lib/Lex/PPLexerChange.cpp @@ -43,14 +43,15 @@ bool Preprocessor::isInPrimaryFile() const { /// getCurrentLexer - Return the current file lexer being lexed from. Note /// that this ignores any potentially active macro expansions and _Pragma /// expansions going on at the time. -Lexer *Preprocessor::getCurrentFileLexer() const { - if (CurLexer && !CurLexer->Is_PragmaLexer) return CurLexer.get(); +PreprocessorLexer *Preprocessor::getCurrentFileLexer() const { + if (IsNonPragmaNonMacroLexer()) + return CurPPLexer; // Look for a stacked lexer. for (unsigned i = IncludeMacroStack.size(); i != 0; --i) { - Lexer *L = IncludeMacroStack[i-1].TheLexer; - if (L && !L->Is_PragmaLexer) // Ignore macro & _Pragma expansions. - return L; + const IncludeStackInfo& ISI = IncludeMacroStack[i-1]; + if (IsNonPragmaNonMacroLexer(ISI)) + return ISI.ThePPLexer; } return 0; } |