diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-10-18 14:43:21 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-10-18 14:43:21 +0000 |
commit | 6f2d1b111ed6d3c686303746e3949e3cbc9f3870 (patch) | |
tree | 0a42ce0fdde787f97068631ea6e6ebfa0666389a /include/clang/Lex/PreprocessorLexer.h | |
parent | cf1123b648403f159aeb705e2b8b088258a277ff (diff) |
Add iteration over the preprocessor conditional stack to PreprocessorLexer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116703 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/PreprocessorLexer.h')
-rw-r--r-- | include/clang/Lex/PreprocessorLexer.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/clang/Lex/PreprocessorLexer.h b/include/clang/Lex/PreprocessorLexer.h index 477a2130cf..d8332938a7 100644 --- a/include/clang/Lex/PreprocessorLexer.h +++ b/include/clang/Lex/PreprocessorLexer.h @@ -155,6 +155,18 @@ public: /// getFileEntry - Return the FileEntry corresponding to this FileID. Like /// getFileID(), this only works for lexers with attached preprocessors. const FileEntry *getFileEntry() const; + + /// \brief Iterator that traverses the current stack of preprocessor + /// conditional directives (#if/#ifdef/#ifndef). + typedef llvm::SmallVectorImpl<PPConditionalInfo>::const_iterator + conditional_iterator; + + conditional_iterator conditional_begin() const { + return ConditionalStack.begin(); + } + conditional_iterator conditional_end() const { + return ConditionalStack.end(); + } }; } // end namespace clang |