diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-30 17:37:44 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-30 17:37:44 +0000 |
commit | 550ae89a710bf458d47e5b1d183f5e7039c2b384 (patch) | |
tree | 4eab680d9198cddf87acb23a14c836472b21ae89 /lib/Lex/PPLexerChange.cpp | |
parent | b5aee35cc5d62f11d98539f62e4fe63f0ac9edc6 (diff) |
Diffstat (limited to 'lib/Lex/PPLexerChange.cpp')
-rw-r--r-- | lib/Lex/PPLexerChange.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp index 5a589d6a17b36..1c0cd5636835e 100644 --- a/lib/Lex/PPLexerChange.cpp +++ b/lib/Lex/PPLexerChange.cpp @@ -46,6 +46,12 @@ bool Preprocessor::isInPrimaryFile() const { }); } +bool Preprocessor::isInMainFile() const { + if (IsFileLexer()) + return IncludeMacroStack.size() == 0; + return true; +} + /// 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. |