Luckily getBufferStart only has one user. Replaced getBufferStart+getBufferEnd
with to StringRef getBuffer().
Hi jordan_rose,
http://llvm-reviews.chandlerc.com/D916
CHANGE SINCE LAST DIFF
http://llvm-reviews.chandlerc.com/D916?vs=2261&id=2263#toc
Files:
include/clang/Lex/Lexer.h
lib/Rewrite/Core/HTMLRewrite.cpp
Index: include/clang/Lex/Lexer.h
===================================================================
--- include/clang/Lex/Lexer.h
+++ include/clang/Lex/Lexer.h
@@ -202,7 +202,10 @@
/// lexer has nothing to reset to.
void resetExtendedTokenMode();
- const char *getBufferStart() const { return BufferStart; }
+ /// Gets source code buffer.
+ StringRef getBuffer() const {
+ return StringRef(BufferStart, BufferEnd - BufferStart);
+ }
/// ReadToEndOfLine - Read the rest of the current preprocessor line as an
/// uninterpreted string. This switches the lexer out of directive mode.
Index: lib/Rewrite/Core/HTMLRewrite.cpp
===================================================================
--- lib/Rewrite/Core/HTMLRewrite.cpp
+++ lib/Rewrite/Core/HTMLRewrite.cpp
@@ -361,7 +361,7 @@
const SourceManager &SM = PP.getSourceManager();
const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID);
Lexer L(FID, FromFile, SM, PP.getLangOpts());
- const char *BufferStart = L.getBufferStart();
+ const char *BufferStart = L.getBuffer().data();
// Inform the preprocessor that we want to retain comments as tokens, so we
// can highlight them.
Index: include/clang/Lex/Lexer.h
===================================================================
--- include/clang/Lex/Lexer.h
+++ include/clang/Lex/Lexer.h
@@ -202,7 +202,10 @@
/// lexer has nothing to reset to.
void resetExtendedTokenMode();
- const char *getBufferStart() const { return BufferStart; }
+ /// Gets source code buffer.
+ StringRef getBuffer() const {
+ return StringRef(BufferStart, BufferEnd - BufferStart);
+ }
/// ReadToEndOfLine - Read the rest of the current preprocessor line as an
/// uninterpreted string. This switches the lexer out of directive mode.
Index: lib/Rewrite/Core/HTMLRewrite.cpp
===================================================================
--- lib/Rewrite/Core/HTMLRewrite.cpp
+++ lib/Rewrite/Core/HTMLRewrite.cpp
@@ -361,7 +361,7 @@
const SourceManager &SM = PP.getSourceManager();
const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID);
Lexer L(FID, FromFile, SM, PP.getLangOpts());
- const char *BufferStart = L.getBufferStart();
+ const char *BufferStart = L.getBuffer().data();
// Inform the preprocessor that we want to retain comments as tokens, so we
// can highlight them.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits