Hi jordan_rose,

There's Lexer::getBufferStart(), and we need getBufferEnd() to access
the whole input buffer in clang::format::reformat. We don't want to
rely on the fact that the Lexer::BufferEnd always points to '\0', as there can
be embedded '\0's as well.

http://llvm-reviews.chandlerc.com/D916

Files:
  include/clang/Lex/Lexer.h

Index: include/clang/Lex/Lexer.h
===================================================================
--- include/clang/Lex/Lexer.h
+++ include/clang/Lex/Lexer.h
@@ -202,8 +202,12 @@
   /// lexer has nothing to reset to.
   void resetExtendedTokenMode();
 
+  /// \brief Gets the start of the source buffer.
   const char *getBufferStart() const { return BufferStart; }
 
+  /// \brief Gets the end of the source buffer.
+  const char *getBufferEnd() const { return BufferEnd; }
+
   /// ReadToEndOfLine - Read the rest of the current preprocessor line as an
   /// uninterpreted string.  This switches the lexer out of directive mode.
   void ReadToEndOfLine(SmallVectorImpl<char> *Result = 0);
Index: include/clang/Lex/Lexer.h
===================================================================
--- include/clang/Lex/Lexer.h
+++ include/clang/Lex/Lexer.h
@@ -202,8 +202,12 @@
   /// lexer has nothing to reset to.
   void resetExtendedTokenMode();
 
+  /// \brief Gets the start of the source buffer.
   const char *getBufferStart() const { return BufferStart; }
 
+  /// \brief Gets the end of the source buffer.
+  const char *getBufferEnd() const { return BufferEnd; }
+
   /// ReadToEndOfLine - Read the rest of the current preprocessor line as an
   /// uninterpreted string.  This switches the lexer out of directive mode.
   void ReadToEndOfLine(SmallVectorImpl<char> *Result = 0);
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to