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

Byoungchan Lee via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 13 04:25:02 PDT 2024


================
@@ -305,8 +307,84 @@ 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) {
----------------
bc-lee wrote:

Done. Removed the check for Edit mode.

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


More information about the cfe-commits mailing list