aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Rewrite/HTMLRewrite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Rewrite/HTMLRewrite.cpp')
-rw-r--r--clang/lib/Rewrite/HTMLRewrite.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/clang/lib/Rewrite/HTMLRewrite.cpp b/clang/lib/Rewrite/HTMLRewrite.cpp
index e304fbbed729..2f5f2734aa46 100644
--- a/clang/lib/Rewrite/HTMLRewrite.cpp
+++ b/clang/lib/Rewrite/HTMLRewrite.cpp
@@ -107,9 +107,9 @@ void html::HighlightRange(RewriteBuffer &RB, unsigned B, unsigned E,
void html::EscapeText(Rewriter &R, FileID FID,
bool EscapeSpaces, bool ReplaceTabs) {
- const llvm::MemoryBuffer *Buf = R.getSourceMgr().getBuffer(FID);
- const char* C = Buf->getBufferStart();
- const char* FileEnd = Buf->getBufferEnd();
+ llvm::MemoryBufferRef Buf = R.getSourceMgr().getBufferOrFake(FID);
+ const char* C = Buf.getBufferStart();
+ const char* FileEnd = Buf.getBufferEnd();
assert (C <= FileEnd);
@@ -226,9 +226,9 @@ static void AddLineNumber(RewriteBuffer &RB, unsigned LineNo,
void html::AddLineNumbers(Rewriter& R, FileID FID) {
- const llvm::MemoryBuffer *Buf = R.getSourceMgr().getBuffer(FID);
- const char* FileBeg = Buf->getBufferStart();
- const char* FileEnd = Buf->getBufferEnd();
+ llvm::MemoryBufferRef Buf = R.getSourceMgr().getBufferOrFake(FID);
+ const char* FileBeg = Buf.getBufferStart();
+ const char* FileEnd = Buf.getBufferEnd();
const char* C = FileBeg;
RewriteBuffer &RB = R.getEditBuffer(FID);
@@ -274,9 +274,9 @@ void html::AddLineNumbers(Rewriter& R, FileID FID) {
void html::AddHeaderFooterInternalBuiltinCSS(Rewriter &R, FileID FID,
StringRef title) {
- const llvm::MemoryBuffer *Buf = R.getSourceMgr().getBuffer(FID);
- const char* FileStart = Buf->getBufferStart();
- const char* FileEnd = Buf->getBufferEnd();
+ llvm::MemoryBufferRef Buf = R.getSourceMgr().getBufferOrFake(FID);
+ const char* FileStart = Buf.getBufferStart();
+ const char* FileEnd = Buf.getBufferEnd();
SourceLocation StartLoc = R.getSourceMgr().getLocForStartOfFile(FID);
SourceLocation EndLoc = StartLoc.getLocWithOffset(FileEnd-FileStart);
@@ -445,7 +445,7 @@ void html::SyntaxHighlight(Rewriter &R, FileID FID, const Preprocessor &PP) {
RewriteBuffer &RB = R.getEditBuffer(FID);
const SourceManager &SM = PP.getSourceManager();
- const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID);
+ llvm::MemoryBufferRef FromFile = SM.getBufferOrFake(FID);
Lexer L(FID, FromFile, SM, PP.getLangOpts());
const char *BufferStart = L.getBuffer().data();
@@ -536,7 +536,7 @@ void html::HighlightMacros(Rewriter &R, FileID FID, const Preprocessor& PP) {
const SourceManager &SM = PP.getSourceManager();
std::vector<Token> TokenStream;
- const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID);
+ llvm::MemoryBufferRef FromFile = SM.getBufferOrFake(FID);
Lexer L(FID, FromFile, SM, PP.getLangOpts());
// Lex all the tokens in raw mode, to avoid entering #includes or expanding