[PATCH] D99837: [Windows] Turn off text mode correctly in Rewriter to stop CRLF translation

2021-04-06 Thread Abhina Sree via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG23929af383f2: [Windows] Turn off text mode correctly in 
Rewriter to stop CRLF translation (authored by abhina.sreeskantharajan).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99837

Files:
  clang/lib/Frontend/Rewrite/FrontendActions.cpp


Index: clang/lib/Frontend/Rewrite/FrontendActions.cpp
===
--- clang/lib/Frontend/Rewrite/FrontendActions.cpp
+++ clang/lib/Frontend/Rewrite/FrontendActions.cpp
@@ -194,7 +194,7 @@
 void RewriteTestAction::ExecuteAction() {
   CompilerInstance &CI = getCompilerInstance();
   std::unique_ptr OS =
-  CI.createDefaultOutputFile(/*Binary=*/true, 
getCurrentFileOrBufferName());
+  CI.createDefaultOutputFile(/*Binary=*/false, 
getCurrentFileOrBufferName());
   if (!OS) return;
 
   DoRewriteTest(CI.getPreprocessor(), OS.get());
@@ -270,7 +270,7 @@
 bool RewriteIncludesAction::BeginSourceFileAction(CompilerInstance &CI) {
   if (!OutputStream) {
 OutputStream =
-CI.createDefaultOutputFile(/*Binary=*/false, 
getCurrentFileOrBufferName());
+CI.createDefaultOutputFile(/*Binary=*/true, 
getCurrentFileOrBufferName());
 if (!OutputStream)
   return false;
   }


Index: clang/lib/Frontend/Rewrite/FrontendActions.cpp
===
--- clang/lib/Frontend/Rewrite/FrontendActions.cpp
+++ clang/lib/Frontend/Rewrite/FrontendActions.cpp
@@ -194,7 +194,7 @@
 void RewriteTestAction::ExecuteAction() {
   CompilerInstance &CI = getCompilerInstance();
   std::unique_ptr OS =
-  CI.createDefaultOutputFile(/*Binary=*/true, getCurrentFileOrBufferName());
+  CI.createDefaultOutputFile(/*Binary=*/false, getCurrentFileOrBufferName());
   if (!OS) return;
 
   DoRewriteTest(CI.getPreprocessor(), OS.get());
@@ -270,7 +270,7 @@
 bool RewriteIncludesAction::BeginSourceFileAction(CompilerInstance &CI) {
   if (!OutputStream) {
 OutputStream =
-CI.createDefaultOutputFile(/*Binary=*/false, getCurrentFileOrBufferName());
+CI.createDefaultOutputFile(/*Binary=*/true, getCurrentFileOrBufferName());
 if (!OutputStream)
   return false;
   }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D99837: [Windows] Turn off text mode correctly in Rewriter to stop CRLF translation

2021-04-06 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea accepted this revision.
aganea added a comment.
This revision is now accepted and ready to land.

It works now, thanks! :-)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99837

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D99837: [Windows] Turn off text mode correctly in Rewriter to stop CRLF translation

2021-04-03 Thread Abhina Sree via Phabricator via cfe-commits
abhina.sreeskantharajan created this revision.
abhina.sreeskantharajan added a reviewer: aganea.
abhina.sreeskantharajan requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

I incorrectly changed the RewriteTestAction::ExecuteAction's file to binary 
instead of the proper RewriteIncludesAction::BeginSourceFileAction in 
https://reviews.llvm.org/rGbc5d4bcc2deb71ab647270c9754a83484b3d6f87. In the 
original commit, I actually changed 
RewriteIncludesAction::BeginSourceFileAction in 
https://reviews.llvm.org/rGfdb640ea30d416368b76b68b106deda580c6aced. This 
should fix the issue @aganea is facing.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99837

Files:
  clang/lib/Frontend/Rewrite/FrontendActions.cpp


Index: clang/lib/Frontend/Rewrite/FrontendActions.cpp
===
--- clang/lib/Frontend/Rewrite/FrontendActions.cpp
+++ clang/lib/Frontend/Rewrite/FrontendActions.cpp
@@ -194,7 +194,7 @@
 void RewriteTestAction::ExecuteAction() {
   CompilerInstance &CI = getCompilerInstance();
   std::unique_ptr OS =
-  CI.createDefaultOutputFile(/*Binary=*/true, 
getCurrentFileOrBufferName());
+  CI.createDefaultOutputFile(/*Binary=*/false, 
getCurrentFileOrBufferName());
   if (!OS) return;
 
   DoRewriteTest(CI.getPreprocessor(), OS.get());
@@ -270,7 +270,7 @@
 bool RewriteIncludesAction::BeginSourceFileAction(CompilerInstance &CI) {
   if (!OutputStream) {
 OutputStream =
-CI.createDefaultOutputFile(/*Binary=*/false, 
getCurrentFileOrBufferName());
+CI.createDefaultOutputFile(/*Binary=*/true, 
getCurrentFileOrBufferName());
 if (!OutputStream)
   return false;
   }


Index: clang/lib/Frontend/Rewrite/FrontendActions.cpp
===
--- clang/lib/Frontend/Rewrite/FrontendActions.cpp
+++ clang/lib/Frontend/Rewrite/FrontendActions.cpp
@@ -194,7 +194,7 @@
 void RewriteTestAction::ExecuteAction() {
   CompilerInstance &CI = getCompilerInstance();
   std::unique_ptr OS =
-  CI.createDefaultOutputFile(/*Binary=*/true, getCurrentFileOrBufferName());
+  CI.createDefaultOutputFile(/*Binary=*/false, getCurrentFileOrBufferName());
   if (!OS) return;
 
   DoRewriteTest(CI.getPreprocessor(), OS.get());
@@ -270,7 +270,7 @@
 bool RewriteIncludesAction::BeginSourceFileAction(CompilerInstance &CI) {
   if (!OutputStream) {
 OutputStream =
-CI.createDefaultOutputFile(/*Binary=*/false, getCurrentFileOrBufferName());
+CI.createDefaultOutputFile(/*Binary=*/true, getCurrentFileOrBufferName());
 if (!OutputStream)
   return false;
   }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits