[clang] 0bf833f - [SystemZ][z/OS] JSON file should be text files

Abhina Sreeskantharajan via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 24 10:28:15 PDT 2021


Author: Abhina Sreeskantharajan
Date: 2021-03-24T13:28:08-04:00
New Revision: 0bf833f670bdc42009b0ff208e8266f528e0a82c

URL: https://github.com/llvm/llvm-project/commit/0bf833f670bdc42009b0ff208e8266f528e0a82c
DIFF: https://github.com/llvm/llvm-project/commit/0bf833f670bdc42009b0ff208e8266f528e0a82c.diff

LOG: [SystemZ][z/OS] JSON file should be text files

This patch sets the OF_Text flag correctly for the json file created in Clang::DumpCompilationDatabaseFragmentToDir.

Reviewed By: amccarth

Differential Revision: https://reviews.llvm.org/D99200

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Clang.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 95275b14cabe..a64dc4e80dec 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -2336,7 +2336,8 @@ void Clang::DumpCompilationDatabaseFragmentToDir(
       Twine(llvm::sys::path::filename(Input.getFilename())) + ".%%%%.json");
   int FD;
   SmallString<256> TempPath;
-  Err = llvm::sys::fs::createUniqueFile(Path, FD, TempPath);
+  Err = llvm::sys::fs::createUniqueFile(Path, FD, TempPath,
+                                        llvm::sys::fs::OF_Text);
   if (Err) {
     Driver.Diag(diag::err_drv_compilationdatabase) << Path << Err.message();
     return;


        


More information about the cfe-commits mailing list