[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
Wed Oct 9 07:25:58 PDT 2024


================
@@ -173,6 +173,7 @@ class Action : public clang::ASTFrontendAction {
     if (!HTMLReportPath.empty())
       writeHTML();
 
+    // Source File's path relative to compilation database.
     llvm::StringRef Path =
----------------
kadircet wrote:

can we keep reporting with abs-paths here, i.e:
```
llvm::SmallString<256> AbsPath(SM.getFileEntryRefForID(SM.getMainFileID())->getName());
SM.getFileManager().makeAbsolutePath(AbsPath);
...
```

This way we can recognize these paths in main and perform the mapping accordingly.

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


More information about the cfe-commits mailing list