[PATCH] D100654: [SystemZ][z/OS] Set more text files as text

Abhina Sree via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 19 06:31:55 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG05b4babc9d85: [SystemZ][z/OS] Set more text files as text (authored by abhina.sreeskantharajan).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100654/new/

https://reviews.llvm.org/D100654

Files:
  clang/tools/driver/cc1gen_reproducer_main.cpp
  clang/tools/libclang/CIndexer.cpp
  llvm/include/llvm/Support/GraphWriter.h


Index: llvm/include/llvm/Support/GraphWriter.h
===================================================================
--- llvm/include/llvm/Support/GraphWriter.h
+++ llvm/include/llvm/Support/GraphWriter.h
@@ -331,7 +331,8 @@
   if (Filename.empty()) {
     Filename = createGraphFilename(Name.str(), FD);
   } else {
-    std::error_code EC = sys::fs::openFileForWrite(Filename, FD);
+    std::error_code EC = sys::fs::openFileForWrite(
+        Filename, FD, sys::fs::CD_CreateAlways, sys::fs::OF_Text);
 
     // Writing over an existing file is not considered an error.
     if (EC == std::errc::file_exists) {
Index: clang/tools/libclang/CIndexer.cpp
===================================================================
--- clang/tools/libclang/CIndexer.cpp
+++ clang/tools/libclang/CIndexer.cpp
@@ -163,7 +163,8 @@
   TempPath = Path;
   llvm::sys::path::append(TempPath, "libclang-%%%%%%%%%%%%");
   int FD;
-  if (llvm::sys::fs::createUniqueFile(TempPath, FD, TempPath))
+  if (llvm::sys::fs::createUniqueFile(TempPath, FD, TempPath,
+                                      llvm::sys::fs::OF_Text))
     return;
   File = std::string(TempPath.begin(), TempPath.end());
   llvm::raw_fd_ostream OS(FD, /*ShouldClose=*/true);
Index: clang/tools/driver/cc1gen_reproducer_main.cpp
===================================================================
--- clang/tools/driver/cc1gen_reproducer_main.cpp
+++ clang/tools/driver/cc1gen_reproducer_main.cpp
@@ -162,7 +162,7 @@
   // Parse the invocation descriptor.
   StringRef Input = Argv[0];
   llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> Buffer =
-      llvm::MemoryBuffer::getFile(Input);
+      llvm::MemoryBuffer::getFile(Input, /*IsText=*/true);
   if (!Buffer) {
     llvm::errs() << "error: failed to read " << Input << ": "
                  << Buffer.getError().message() << "\n";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100654.338505.patch
Type: text/x-patch
Size: 1841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210419/ed32d826/attachment-0001.bin>


More information about the cfe-commits mailing list