Go to the documentation of this file.
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDEINSERTER_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDEINSERTER_H
13 #include "clang/Basic/Diagnostic.h"
14 #include "llvm/ADT/StringSet.h"
20 namespace tidy::utils {
63 bool SelfContainedDiags);
75 llvm::StringRef Header);
82 std::optional<FixItHint>
89 SourceLocation HashLocation, SourceLocation EndLocation);
93 llvm::DenseMap<FileID, std::unique_ptr<IncludeSorter>> IncludeSorterByFile;
94 llvm::DenseMap<FileID, llvm::StringSet<>> InsertedHeaders;
95 const SourceManager *SourceMgr{
nullptr};
97 const bool SelfContainedDiags;
103 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDEINSERTER_H
Class used by IncludeInserterCallback to record the names of the inclusions in a given source file be...
Produces fixes to insert specified includes to source files, if not yet present.
std::optional< FixItHint > createIncludeInsertion(FileID FileID, llvm::StringRef Header)
Creates a Header inclusion directive fixit in the File FileID.
IncludeStyle
Supported include styles.
IncludeInserter(IncludeSorter::IncludeStyle Style, bool SelfContainedDiags)
Initializes the IncludeInserter using the IncludeStyle Style.
void registerPreprocessor(Preprocessor *PP)
Registers this with the Preprocessor PP, must be called before this class is used.
std::optional< FixItHint > createMainFileIncludeInsertion(llvm::StringRef Header)
Creates a Header inclusion directive fixit in the main file.
bool IsAngled
true if this was an include with angle brackets
IncludeSorter::IncludeStyle getStyle() const
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//