[clang-tools-extra] [clang-include-cleaner] Fix incorrect directory issue for writing files (PR #111375)

kadir çetinkaya via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 14 05:19:17 PDT 2024


================
@@ -305,8 +307,46 @@ int main(int argc, const char **argv) {
     }
   }
 
-  clang::tooling::ClangTool Tool(OptionsParser->getCompilations(),
-                                 OptionsParser->getSourcePathList());
+  auto VFS = llvm::vfs::getRealFileSystem();
+  auto &CDB = OptionsParser->getCompilations();
+  // CDBToAbsPaths is a map from the path in the compilation database to the
+  // writable absolute path of the file.
+  std::map<std::string, std::string> CDBToAbsPaths;
+  // if Edit is enabled, `Factory.editedFiles()` will contain the final code,
----------------
kadircet wrote:

can you also drop the mention of `Edit` from the comment?

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


More information about the cfe-commits mailing list