[clang-tools-extra] e7b4b43 - [include-cleaner] Use filename as requested, not resolved path
Kadir Cetinkaya via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 19 03:08:32 PDT 2024
Author: Kadir Cetinkaya
Date: 2024-06-19T12:04:42+02:00
New Revision: e7b4b437fbbf087ac4955ed5945c3e2f3dd2b702
URL: https://github.com/llvm/llvm-project/commit/e7b4b437fbbf087ac4955ed5945c3e2f3dd2b702
DIFF: https://github.com/llvm/llvm-project/commit/e7b4b437fbbf087ac4955ed5945c3e2f3dd2b702.diff
LOG: [include-cleaner] Use filename as requested, not resolved path
This was an unintended change in d5297b72aa32ad3a69563a1fcc61294282f0b379.
We don't want to resolve symlinks in filenames, as these might lead to
unexpected spellings, compared to requested filenames.
Added:
Modified:
clang-tools-extra/include-cleaner/lib/IncludeSpeller.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/include-cleaner/lib/IncludeSpeller.cpp b/clang-tools-extra/include-cleaner/lib/IncludeSpeller.cpp
index 8332eb685d652..d0549825d4c40 100644
--- a/clang-tools-extra/include-cleaner/lib/IncludeSpeller.cpp
+++ b/clang-tools-extra/include-cleaner/lib/IncludeSpeller.cpp
@@ -37,8 +37,8 @@ class DefaultIncludeSpeller : public IncludeSpeller {
.getCurrentWorkingDirectory())
WorkingDir = *WD;
std::string FinalSpelling = Input.HS.suggestPathToFileForDiagnostics(
- Input.H.resolvedPath(), WorkingDir, Input.Main->tryGetRealPathName(),
- &IsAngled);
+ Input.H.physical().getName(), WorkingDir,
+ Input.Main->tryGetRealPathName(), &IsAngled);
return IsAngled ? "<" + FinalSpelling + ">" : "\"" + FinalSpelling + "\"";
}
llvm_unreachable("Unknown clang::include_cleaner::Header::Kind enum");
More information about the cfe-commits
mailing list