10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDEINSERTER_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDEINSERTER_H
14 #include "clang/Basic/Diagnostic.h"
15 #include "clang/Basic/LangOptions.h"
16 #include "clang/Basic/SourceManager.h"
17 #include "clang/Lex/PPCallbacks.h"
57 IncludeInserter(
const SourceManager &SourceMgr,
const LangOptions &LangOpts,
66 llvm::Optional<FixItHint>
70 void AddInclude(StringRef FileName,
bool IsAngled,
71 SourceLocation HashLocation, SourceLocation EndLocation);
73 llvm::DenseMap<FileID, std::unique_ptr<IncludeSorter>> IncludeSorterByFile;
74 llvm::DenseMap<FileID, std::set<std::string>> InsertedHeaders;
75 const SourceManager &SourceMgr;
76 const LangOptions &LangOpts;
84 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDEINSERTER_H
std::unique_ptr< PPCallbacks > CreatePPCallbacks()
Create PPCallbacks for registration with the compiler's preprocessor.
IncludeStyle
Supported include styles.
bool IsAngled
true if this was an include with angle brackets
IncludeInserter(const SourceManager &SourceMgr, const LangOptions &LangOpts, IncludeSorter::IncludeStyle Style)
Produces fixes to insert specified includes to source files, if not yet present.
llvm::Optional< FixItHint > CreateIncludeInsertion(FileID FileID, llvm::StringRef Header, bool IsAngled)
Creates a Header inclusion directive fixit.