9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_INCLUDEINSERTER_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_INCLUDEINSERTER_H
13#include "clang/Basic/Diagnostic.h"
14#include "llvm/ADT/StringSet.h"
55class IncludeInserter {
62 explicit IncludeInserter(IncludeSorter::IncludeStyle Style,
63 bool SelfContainedDiags);
67 void registerPreprocessor(Preprocessor *PP);
84 IncludeSorter::IncludeStyle
getStyle()
const {
return Style; }
87 void addInclude(StringRef FileName,
bool IsAngled,
88 SourceLocation HashLocation, SourceLocation EndLocation);
90 IncludeSorter &getOrCreate(FileID FileID);
92 llvm::DenseMap<FileID, std::unique_ptr<IncludeSorter>> IncludeSorterByFile;
93 llvm::DenseMap<FileID, llvm::StringSet<>> InsertedHeaders;
94 const SourceManager *SourceMgr{
nullptr};
95 const IncludeSorter::IncludeStyle Style;
96 const bool SelfContainedDiags;
IncludeSorter::IncludeStyle getStyle() const
std::optional< FixItHint > createMainFileIncludeInsertion(StringRef Header)
Produces fixes to insert specified includes to source files, if not yet present.
std::optional< FixItHint > createIncludeInsertion(StringRef FileName, bool IsAngled)
Creates a quoted inclusion directive in the right sort order.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//