[PATCH] D100056: [SystemZ][z/OS] Set files in FileRemapper.cpp are text

Abhina Sree via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 7 11:39:24 PDT 2021


abhina.sreeskantharajan created this revision.
abhina.sreeskantharajan requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch sets files in FileRemapper to open as text.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100056

Files:
  clang/lib/ARCMigrate/FileRemapper.cpp


Index: clang/lib/ARCMigrate/FileRemapper.cpp
===================================================================
--- clang/lib/ARCMigrate/FileRemapper.cpp
+++ clang/lib/ARCMigrate/FileRemapper.cpp
@@ -63,7 +63,7 @@
   std::vector<std::pair<const FileEntry *, const FileEntry *> > pairs;
 
   llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> fileBuf =
-      llvm::MemoryBuffer::getFile(infoFile);
+      llvm::MemoryBuffer::getFile(infoFile, /*IsText=*/true);
   if (!fileBuf)
     return report("Error opening file: " + infoFile, Diag);
 
@@ -121,7 +121,7 @@
 
   std::error_code EC;
   std::string infoFile = std::string(outputPath);
-  llvm::raw_fd_ostream infoOut(infoFile, EC, llvm::sys::fs::OF_None);
+  llvm::raw_fd_ostream infoOut(infoFile, EC, llvm::sys::fs::OF_Text);
   if (EC)
     return report(EC.message(), Diag);
 
@@ -144,7 +144,7 @@
       int fd;
       if (fs::createTemporaryFile(path::filename(origFE->getName()),
                                   path::extension(origFE->getName()).drop_front(), fd,
-                                  tempPath))
+                                  tempPath, llvm::sys::fs::OF_Text))
         return report("Could not create file: " + tempPath.str(), Diag);
 
       llvm::raw_fd_ostream newOut(fd, /*shouldClose=*/true);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100056.335883.patch
Type: text/x-patch
Size: 1280 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210407/f45b5251/attachment-0001.bin>


More information about the cfe-commits mailing list