From 6f2d1b111ed6d3c686303746e3949e3cbc9f3870 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 18 Oct 2010 14:43:21 +0000 Subject: [PATCH] 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 --- include/clang/Lex/PreprocessorLexer.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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::const_iterator + conditional_iterator; + + conditional_iterator conditional_begin() const { + return ConditionalStack.begin(); + } + conditional_iterator conditional_end() const { + return ConditionalStack.end(); + } }; } // end namespace clang -- 2.40.0