[cfe-commits] r116703 - /cfe/trunk/include/clang/Lex/PreprocessorLexer.h

Douglas Gregor dgregor at apple.com
Mon Oct 18 07:43:21 PDT 2010


Author: dgregor
Date: Mon Oct 18 09:43:21 2010
New Revision: 116703

URL: http://llvm.org/viewvc/llvm-project?rev=116703&view=rev
Log:
Add iteration over the preprocessor conditional stack to PreprocessorLexer

Modified:
    cfe/trunk/include/clang/Lex/PreprocessorLexer.h

Modified: cfe/trunk/include/clang/Lex/PreprocessorLexer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/PreprocessorLexer.h?rev=116703&r1=116702&r2=116703&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/PreprocessorLexer.h (original)
+++ cfe/trunk/include/clang/Lex/PreprocessorLexer.h Mon Oct 18 09:43:21 2010
@@ -155,6 +155,18 @@
   /// 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





More information about the cfe-commits mailing list