[clang-tools-extra] r216584 - Update for LLVM api change.

Rafael Espindola rafael.espindola at gmail.com
Wed Aug 27 13:03:22 PDT 2014


Author: rafael
Date: Wed Aug 27 15:03:22 2014
New Revision: 216584

URL: http://llvm.org/viewvc/llvm-project?rev=216584&view=rev
Log:
Update for LLVM api change.

Modified:
    clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp
    clang-tools-extra/trunk/unittests/include/common/VirtualFileHelper.h

Modified: clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp?rev=216584&r1=216583&r2=216584&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp (original)
+++ clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp Wed Aug 27 15:03:22 2014
@@ -188,8 +188,9 @@ bool applyFormatting(const std::vector<t
 
   FileManager Files((FileSystemOptions()));
   SourceManager SM(Diagnostics, Files);
-  SM.overrideFileContents(Files.getFile(FileName),
-                          llvm::MemoryBuffer::getMemBufferCopy(FileData));
+  SM.overrideFileContents(
+      Files.getFile(FileName),
+      llvm::MemoryBuffer::getMemBufferCopy(FileData).release());
   Rewriter Rewrites(SM, LangOptions());
 
   return getRewrittenData(FormattingReplacements, Rewrites, FormattedFileData);

Modified: clang-tools-extra/trunk/unittests/include/common/VirtualFileHelper.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/include/common/VirtualFileHelper.h?rev=216584&r1=216583&r2=216584&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/include/common/VirtualFileHelper.h (original)
+++ clang-tools-extra/trunk/unittests/include/common/VirtualFileHelper.h Wed Aug 27 15:03:22 2014
@@ -59,10 +59,11 @@ public:
              I = VirtualFiles.begin(),
              E = VirtualFiles.end();
          I != E; ++I) {
-      llvm::MemoryBuffer *Buf = llvm::MemoryBuffer::getMemBuffer(I->Code);
+      std::unique_ptr<llvm::MemoryBuffer> Buf =
+          llvm::MemoryBuffer::getMemBuffer(I->Code);
       const FileEntry *Entry = SM.getFileManager().getVirtualFile(
           I->FileName, Buf->getBufferSize(), /*ModificationTime=*/0);
-      SM.overrideFileContents(Entry, Buf);
+      SM.overrideFileContents(Entry, Buf.release());
     }
   }
 





More information about the cfe-commits mailing list