[PATCH] D99363: [Windows] Turn off text mode in TableGen and Rewriter to stop CRLF translation

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 25 11:45:56 PDT 2021


rnk requested changes to this revision.
rnk added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/lib/Frontend/Rewrite/FrontendActions.cpp:190
+  std::unique_ptr<raw_ostream> OS = CI.createDefaultOutputFile(
+      /*Binary=*/llvm::Triple(LLVM_HOST_TRIPLE).isOSWindows(),
+      getCurrentFileOrBufferName());
----------------
In the long run, we really don't want this "is windows" check here in the caller. We really want a flag to push this logic down into the support library. Since we already know where we are going, I think these are the proper steps:
- revert to green
- add OF_TextWithCrLF, with the same behavior as OF_Text today
- update all callers that used OF_Text before these System/Z patches to OF_TextWithCrlf (NFC)
- make OF_Text skip CRLF conversion on Windows (check for breakage)
- start relanding OF_Text changes for System/Z again

Landing this patch as it is creates more code that we will have to edit and refactor later back to just OF_Text.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99363



More information about the cfe-commits mailing list