46 const SourceManager &SM)
47 : Check(Check), SM(SM) {}
50 StringRef FileName,
bool IsAngled,
51 CharSourceRange FilenameRange,
52 OptionalFileEntryRef File, StringRef SearchPath,
53 StringRef RelativePath,
const Module *SuggestedModule,
55 SrcMgr::CharacteristicKind FileType)
override;
59 struct IncludeDirective {
60 IncludeDirective() =
default;
61 IncludeDirective(SourceLocation Loc, CharSourceRange Range,
62 StringRef Filename, StringRef FullPath,
bool IsInMainFile)
63 : Loc(Loc), Range(Range), IncludeFile(Filename), IncludePath(FullPath),
64 IsInMainFile(IsInMainFile) {}
67 CharSourceRange Range;
68 std::string IncludeFile;
69 std::string IncludePath;
73 using FileIncludes = llvm::SmallVector<IncludeDirective, 8>;
74 llvm::SmallDenseMap<FileID, FileIncludes> IncludeDirectives;
76 RestrictSystemIncludesCheck &Check;
77 const SourceManager &SM;
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File, StringRef SearchPath, StringRef RelativePath, const Module *SuggestedModule, bool ModuleImported, SrcMgr::CharacteristicKind FileType) override