]> granicus.if.org Git - clang/commitdiff
Add iteration over the preprocessor conditional stack to PreprocessorLexer
authorDouglas Gregor <dgregor@apple.com>
Mon, 18 Oct 2010 14:43:21 +0000 (14:43 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 18 Oct 2010 14:43:21 +0000 (14:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116703 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/PreprocessorLexer.h

index 477a2130cf0ebb9e656d7d28906c4aea3922c458..d8332938a7ed440a3f8c5a6c729cb70e326de973 100644 (file)
@@ -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