clang-tools 22.0.0git
clang::tidy::misc::IncludeCleanerCheck Class Reference

Checks for unused and missing includes. More...

#include <IncludeCleanerCheck.h>

Inheritance diagram for clang::tidy::misc::IncludeCleanerCheck:
[legend]

Public Member Functions

 IncludeCleanerCheck (StringRef Name, ClangTidyContext *Context)
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override
void registerPPCallbacks (const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override
void storeOptions (ClangTidyOptions::OptionMap &Opts) override
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override

Detailed Description

Checks for unused and missing includes.

Generates findings only for the main file of a translation unit. Findings correspond to https://clangd.llvm.org/design/include-cleaner.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html

Definition at line 33 of file IncludeCleanerCheck.h.

Constructor & Destructor Documentation

◆ IncludeCleanerCheck()

clang::tidy::misc::IncludeCleanerCheck::IncludeCleanerCheck ( StringRef Name,
ClangTidyContext * Context )

Definition at line 56 of file IncludeCleanerCheck.cpp.

Member Function Documentation

◆ check()

void clang::tidy::misc::IncludeCleanerCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 121 of file IncludeCleanerCheck.cpp.

◆ isLanguageVersionSupported()

bool clang::tidy::misc::IncludeCleanerCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
override

Definition at line 87 of file IncludeCleanerCheck.cpp.

◆ registerMatchers()

void clang::tidy::misc::IncludeCleanerCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 92 of file IncludeCleanerCheck.cpp.

◆ registerPPCallbacks()

void clang::tidy::misc::IncludeCleanerCheck::registerPPCallbacks ( const SourceManager & SM,
Preprocessor * PP,
Preprocessor * ModuleExpanderPP )
override

Definition at line 96 of file IncludeCleanerCheck.cpp.

◆ storeOptions()

void clang::tidy::misc::IncludeCleanerCheck::storeOptions ( ClangTidyOptions::OptionMap & Opts)
override

The documentation for this class was generated from the following files: