aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp b/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp
index 49e7581..b9f44c9 100644
--- a/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp
@@ -45,7 +45,7 @@ namespace clang::tidy::misc {
namespace {
struct MissingIncludeInfo {
- SourceLocation SymRefLocation;
+ include_cleaner::SymbolReference SymRef;
include_cleaner::Header Missing;
};
} // namespace
@@ -134,7 +134,7 @@ void IncludeCleanerCheck::check(const MatchFinder::MatchResult &Result) {
if (!Satisfied && !Providers.empty() &&
Ref.RT == include_cleaner::RefType::Explicit &&
!shouldIgnore(Providers.front()))
- Missing.push_back({Ref.RefLocation, Providers.front()});
+ Missing.push_back({Ref, Providers.front()});
});
std::vector<const include_cleaner::Include *> Unused;
@@ -190,9 +190,9 @@ void IncludeCleanerCheck::check(const MatchFinder::MatchResult &Result) {
if (auto Replacement =
HeaderIncludes.insert(llvm::StringRef{Spelling}.trim("\"<>"),
Angled, tooling::IncludeDirective::Include))
- diag(SM->getSpellingLoc(Inc.SymRefLocation),
- "no header providing %0 is directly included")
- << Spelling
+ diag(SM->getSpellingLoc(Inc.SymRef.RefLocation),
+ "no header providing \"%0\" is directly included")
+ << Inc.SymRef.Target.name()
<< FixItHint::CreateInsertion(
SM->getComposedLoc(SM->getMainFileID(),
Replacement->getOffset()),