diff options
author | Viktoriia Bakalova <bakalova@google.com> | 2023-06-01 15:48:14 +0000 |
---|---|---|
committer | Viktoriia Bakalova <bakalova@google.com> | 2023-06-05 09:47:12 +0000 |
commit | 90c5fe9822222190b826aab90c93db9ce0f7e25d (patch) | |
tree | 0177469513005f2699527cc426f00e3f74308317 /clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp | |
parent | 9ec6ebd3ceabb29482aa18a64b943788b65223dc (diff) | |
download | llvm-90c5fe9822222190b826aab90c93db9ce0f7e25d.zip llvm-90c5fe9822222190b826aab90c93db9ce0f7e25d.tar.gz llvm-90c5fe9822222190b826aab90c93db9ce0f7e25d.tar.bz2 |
[include-cleaner] Allow multiple strategies for spelling includes.
Summary:
Reviewers:
Subscribers:
Differential Revision: https://reviews.llvm.org/D150185
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp b/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp index c7aca83..49e7581 100644 --- a/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp @@ -12,6 +12,7 @@ #include "../ClangTidyOptions.h" #include "../utils/OptionsUtils.h" #include "clang-include-cleaner/Analysis.h" +#include "clang-include-cleaner/IncludeSpeller.h" #include "clang-include-cleaner/Record.h" #include "clang-include-cleaner/Types.h" #include "clang/AST/ASTContext.h" @@ -180,7 +181,7 @@ void IncludeCleanerCheck::check(const MatchFinder::MatchResult &Result) { FileStyle->IncludeStyle); for (const auto &Inc : Missing) { std::string Spelling = - include_cleaner::spellHeader(Inc.Missing, *HS, MainFile); + include_cleaner::spellHeader({Inc.Missing, *HS, MainFile}); bool Angled = llvm::StringRef{Spelling}.starts_with("<"); // We might suggest insertion of an existing include in edge cases, e.g., // include is present in a PP-disabled region, or spelling of the header |