[clang-tools-extra] [clang] [clang][tidy] Ensure rewriter has the correct CWD (PR #67839)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 11:40:14 PST 2023


================
@@ -189,9 +191,12 @@ class ErrorReporter {
 
   void finish() {
     if (TotalFixes > 0) {
-      Rewriter Rewrite(SourceMgr, LangOpts);
+      bool AnyNotWritten = false;
       for (const auto &FileAndReplacements : FileReplacements) {
+        Rewriter Rewrite(SourceMgr, LangOpts);
         StringRef File = FileAndReplacements.first();
+        Files.getVirtualFileSystem().setCurrentWorkingDirectory(
----------------
PiotrZSL wrote:

maybe would be nice to restore CurrentWorkingDirectory after this function come to the end.

https://github.com/llvm/llvm-project/pull/67839


More information about the cfe-commits mailing list