9 #ifndef LLVM_CLANG_TOOLING_EXPANDMODULARHEADERSPPCALLBACKS_H_ 10 #define LLVM_CLANG_TOOLING_EXPANDMODULARHEADERSPPCALLBACKS_H_ 12 #include "clang/Lex/PPCallbacks.h" 13 #include "clang/Lex/Preprocessor.h" 14 #include "llvm/ADT/DenseSet.h" 17 class CompilerInstance;
19 namespace serialization {
39 CompilerInstance *Compiler,
40 IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS);
49 Preprocessor *getPreprocessor()
const;
54 void handleModuleFile(serialization::ModuleFile *MF);
55 void parseToLocation(SourceLocation
Loc);
58 void FileChanged(SourceLocation Loc, FileChangeReason Reason,
59 SrcMgr::CharacteristicKind FileType,
60 FileID PrevFID)
override;
62 void InclusionDirective(SourceLocation DirectiveLoc,
63 const Token &IncludeToken, StringRef IncludedFilename,
64 bool IsAngled, CharSourceRange FilenameRange,
65 const FileEntry *IncludedFile, StringRef SearchPath,
66 StringRef RelativePath,
const Module *Imported,
67 SrcMgr::CharacteristicKind FileType)
override;
69 void EndOfMainFile()
override;
74 void Ident(SourceLocation Loc, StringRef)
override;
75 void PragmaDirective(SourceLocation Loc, PragmaIntroducerKind)
override;
76 void PragmaComment(SourceLocation Loc,
const IdentifierInfo *,
78 void PragmaDetectMismatch(SourceLocation Loc, StringRef, StringRef)
override;
79 void PragmaDebug(SourceLocation Loc, StringRef)
override;
80 void PragmaMessage(SourceLocation Loc, StringRef, PragmaMessageKind,
82 void PragmaDiagnosticPush(SourceLocation Loc, StringRef)
override;
83 void PragmaDiagnosticPop(SourceLocation Loc, StringRef)
override;
84 void PragmaDiagnostic(SourceLocation Loc, StringRef, diag::Severity,
86 void HasInclude(SourceLocation Loc, StringRef,
bool, Optional<FileEntryRef> ,
87 SrcMgr::CharacteristicKind)
override;
88 void PragmaOpenCLExtension(SourceLocation NameLoc,
const IdentifierInfo *,
89 SourceLocation StateLoc,
unsigned)
override;
90 void PragmaWarning(SourceLocation Loc, StringRef, ArrayRef<int>)
override;
91 void PragmaWarningPush(SourceLocation Loc,
int)
override;
92 void PragmaWarningPop(SourceLocation Loc)
override;
93 void PragmaAssumeNonNullBegin(SourceLocation Loc)
override;
94 void PragmaAssumeNonNullEnd(SourceLocation Loc)
override;
95 void MacroExpands(
const Token &MacroNameTok,
const MacroDefinition &,
96 SourceRange
Range,
const MacroArgs *)
override;
97 void MacroDefined(
const Token &MacroNameTok,
98 const MacroDirective *
MD)
override;
99 void MacroUndefined(
const Token &,
const MacroDefinition &,
100 const MacroDirective *Undef)
override;
101 void Defined(
const Token &MacroNameTok,
const MacroDefinition &,
102 SourceRange Range)
override;
103 void SourceRangeSkipped(SourceRange Range, SourceLocation EndifLoc)
override;
104 void If(SourceLocation Loc, SourceRange, ConditionValueKind)
override;
105 void Elif(SourceLocation Loc, SourceRange, ConditionValueKind,
106 SourceLocation)
override;
107 void Ifdef(SourceLocation Loc,
const Token &,
108 const MacroDefinition &)
override;
109 void Ifndef(SourceLocation Loc,
const Token &,
110 const MacroDefinition &)
override;
111 void Else(SourceLocation Loc, SourceLocation)
override;
112 void Endif(SourceLocation Loc, SourceLocation)
override;
114 std::unique_ptr<FileRecorder> Recorder;
116 llvm::DenseSet<serialization::ModuleFile *> VisitedModules;
118 CompilerInstance &Compiler;
120 llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFs;
122 SourceManager &Sources;
123 DiagnosticsEngine Diags;
124 LangOptions LangOpts;
125 TrivialModuleLoader ModuleLoader;
127 std::unique_ptr<HeaderSearch> HeaderInfo;
128 std::unique_ptr<Preprocessor>
PP;
129 bool EnteredMainFile =
false;
130 bool StartedLexing =
false;
137 #endif // LLVM_CLANG_TOOLING_EXPANDMODULARHEADERSPPCALLBACKS_H_ SourceLocation Loc
'#' location in the include directive
bool IsAngled
true if this was an include with angle brackets
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
static GeneratorRegistry::Add< MDGenerator > MD(MDGenerator::Format, "Generator for MD output.")
CharSourceRange Range
SourceRange for the file name.