clang-tools  14.0.0git
Namespaces | Functions
IncludeCleaner.cpp File Reference
#include "IncludeCleaner.h"
#include "Config.h"
#include "Headers.h"
#include "ParsedAST.h"
#include "Protocol.h"
#include "SourceCode.h"
#include "support/Logger.h"
#include "support/Trace.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Tooling/Syntax/Tokens.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/Path.h"
Include dependency graph for IncludeCleaner.cpp:

Go to the source code of this file.

Namespaces

 clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
 clang::clangd
 

Functions

ReferencedLocations clang::clangd::findReferencedLocations (ParsedAST &AST)
 Finds locations of all symbols used in the main file. More...
 
llvm::DenseSet< FileID > clang::clangd::findReferencedFiles (const ReferencedLocations &Locs, const IncludeStructure &Includes, const SourceManager &SM)
 Retrieves IDs of all files containing SourceLocations from Locs. More...
 
std::vector< const Inclusion * > clang::clangd::getUnused (ParsedAST &AST, const llvm::DenseSet< IncludeStructure::HeaderID > &ReferencedFiles)
 Retrieves headers that are referenced from the main file but not used. More...
 
static bool clang::clangd::isSpecialBuffer (FileID FID, const SourceManager &SM)
 
llvm::DenseSet< IncludeStructure::HeaderID > clang::clangd::translateToHeaderIDs (const llvm::DenseSet< FileID > &Files, const IncludeStructure &Includes, const SourceManager &SM)
 Maps FileIDs to the internal IncludeStructure representation (HeaderIDs). More...
 
std::vector< const Inclusion * > clang::clangd::computeUnusedIncludes (ParsedAST &AST)
 
std::vector< Diag > clang::clangd::issueUnusedIncludesDiagnostics (ParsedAST &AST, llvm::StringRef Code)
 

Variable Documentation

◆ Files

llvm::DenseSet<FileID> Files

◆ Macros

llvm::DenseSet<FileID> Macros

Definition at line 139 of file IncludeCleaner.cpp.

Referenced by clang::clangd::ParsedAST::getMacros().

◆ SM

const SourceManager& SM

Definition at line 140 of file IncludeCleaner.cpp.

Referenced by clang::move::ClangMoveTool::addIncludes(), clang::move::ClangMoveTool::addRemovedDecl(), clang::replace::applyChanges(), clang::clangd::IncludeStructure::collect(), clang::clangd::collectPragmaMarksCallback(), clang::clangd::config::Fragment::compile(), clang::clangd::computeUnusedIncludes(), clang::clangd::declToHierarchyItem(), clang::clangd::ASTSignals::derive(), clang::tidy::ClangTidyContext::diag(), clang::clangd::digestFile(), clang::tidy::modernize::expandIfMacroId(), clang::clangd::findDocumentHighlights(), clang::clangd::findImplementations(), clang::clangd::SymbolCollector::finish(), getBuffer(), clang::tidy::bugprone::getCommentsInRange(), clang::tidy::readability::IdentifierNamingCheck::HungarianNotation::getDeclTypeName(), clang::clangd::getDocumentLinks(), clang::find_all_symbols::getIncludePath(), clang::clangd::getSemanticRanges(), clang::clangd::getSymbolInfo(), clang::replace::groupReplacements(), clang::clangd::SymbolCollector::handleDeclOccurrence(), clang::clangd::SymbolCollector::handleMacroOccurrence(), clang::clangd::SymbolCollector::handleMacros(), CollectEntitiesConsumer::HandleTranslationUnit(), clang::tidy::readability::hasPreprocessorBranchEndBetweenLocations(), clang::clangd::includeHashLoc(), clang::tidy::utils::isExpansionLocInHeaderFile(), clang::clangd::isInsideMainFile(), clang::tidy::utils::isPresumedLocInHeaderFile(), clang::clangd::isProtoFile(), clang::clangd::isSelfContainedHeader(), clang::clangd::isSpecialBuffer(), clang::clangd::isSpelledInSource(), clang::tidy::utils::isSpellingLocInHeaderFile(), clang::clangd::locateMacroAt(), clang::clangd::locateSymbolAt(), clang::clangd::locateSymbolTextually(), Location::Location(), clang::replace::mergeAndDeduplicate(), clang::move::ClangMoveTool::onEndOfTranslationUnit(), clang::clangd::config::Fragment::parseYAML(), clang::tidy::utils::rangeCanBeFixed(), clang::tidy::utils::rangeContainsMacroExpansion(), clang::tidy::utils::rangeIsEntirelyWithinMacroArgument(), clang::tidy::llvm_check::IncludeOrderCheck::registerPPCallbacks(), clang::tidy::readability::ElseAfterReturnCheck::registerPPCallbacks(), clang::tidy::altera::KernelNameRestrictionCheck::registerPPCallbacks(), clang::tidy::portability::RestrictSystemIncludesCheck::registerPPCallbacks(), clang::tidy::cppcoreguidelines::MacroUsageCheck::registerPPCallbacks(), clang::tidy::bugprone::SuspiciousIncludeCheck::registerPPCallbacks(), clang::clangd::sourceLocationInMainFile(), clang::clangd::sourceLocToPosition(), clang::clangd::config::toRange(), clang::clangd::toSourceCode(), clang::clangd::translatePreamblePatchLocation(), and CollectEntitiesVisitor::VisitNamedDecl().