clang-tools 20.0.0git
Classes | Namespaces | Typedefs | Functions
IncludeCleaner.h File Reference

Include Cleaner is clangd functionality for providing diagnostics for misuse of transitive headers and unused includes. More...

#include "Diagnostics.h"
#include "Headers.h"
#include "ParsedAST.h"
#include "Protocol.h"
#include "clang-include-cleaner/Types.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Tooling/Syntax/Tokens.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include <functional>
#include <optional>
#include <string>
#include <tuple>
#include <vector>

Go to the source code of this file.

Classes

struct  clang::clangd::MissingIncludeDiagInfo
 
struct  clang::clangd::IncludeCleanerFindings
 

Namespaces

namespace  clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
namespace  clang::clangd
 FIXME: Skip testing on windows temporarily due to the different escaping code mode.
 

Typedefs

using clang::clangd::HeaderFilter = llvm::ArrayRef< std::function< bool(llvm::StringRef)> >
 

Functions

IncludeCleanerFindings clang::clangd::computeIncludeCleanerFindings (ParsedAST &AST, bool AnalyzeAngledIncludes)
 
std::vector< Diag > clang::clangd::issueIncludeCleanerDiagnostics (ParsedAST &AST, llvm::StringRef Code, const IncludeCleanerFindings &Findings, const ThreadsafeFS &TFS, HeaderFilter IgnoreHeaders)
 
include_cleaner::Includes clang::clangd::convertIncludes (const ParsedAST &)
 Converts the clangd include representation to include-cleaner include representation.
 
std::vector< include_cleaner::SymbolReference > clang::clangd::collectMacroReferences (ParsedAST &AST)
 
bool clang::clangd::isPreferredProvider (const Inclusion &, const include_cleaner::Includes &, llvm::ArrayRef< include_cleaner::Header > Providers)
 Whether this #include is considered to provide a particular symbol.
 

Detailed Description

Include Cleaner is clangd functionality for providing diagnostics for misuse of transitive headers and unused includes.

It is inspired by Include-What-You-Use tool (https://include-what-you-use.org/). Our goal is to provide useful warnings in most popular scenarios but not 1:1 exact feature compatibility.

Definition in file IncludeCleaner.h.