]> granicus.if.org Git - llvm/commitdiff
[TableGen] Skip CRLF conversion when writing output
authorReid Kleckner <rnk@google.com>
Wed, 11 Sep 2019 22:33:50 +0000 (22:33 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 11 Sep 2019 22:33:50 +0000 (22:33 +0000)
Doing the CRLF translation while writing the file defeats our
optimization to not update the file if it hasn't changed.

Fixes PR43271.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371683 91177308-0d34-0410-b5e6-96231b3b80d8

lib/TableGen/Main.cpp

index f51267f7ce468c42c0173a8386d75755f8a82130..34195c31a8b841cfd77415121e07f7e465892e5f 100644 (file)
@@ -64,7 +64,7 @@ static int createDependencyFile(const TGParser &Parser, const char *argv0) {
     return reportError(argv0, "the option -d must be used together with -o\n");
 
   std::error_code EC;
-  ToolOutputFile DepOut(DependFilename, EC, sys::fs::OF_Text);
+  ToolOutputFile DepOut(DependFilename, EC, sys::fs::OF_None);
   if (EC)
     return reportError(argv0, "error opening " + DependFilename + ":" +
                                   EC.message() + "\n");
@@ -122,7 +122,7 @@ int llvm::TableGenMain(char *argv0, TableGenMainFn *MainFn) {
       return 0;
 
   std::error_code EC;
-  ToolOutputFile OutFile(OutputFilename, EC, sys::fs::OF_Text);
+  ToolOutputFile OutFile(OutputFilename, EC, sys::fs::OF_None);
   if (EC)
     return reportError(argv0, "error opening " + OutputFilename + ":" +
                                   EC.message() + "\n");