clang  15.0.0git
PPCallbacks.h
Go to the documentation of this file.
1 //===--- PPCallbacks.h - Callbacks for Preprocessor actions -----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// Defines the PPCallbacks interface.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_LEX_PPCALLBACKS_H
15 #define LLVM_CLANG_LEX_PPCALLBACKS_H
16 
20 #include "clang/Lex/ModuleLoader.h"
21 #include "clang/Lex/Pragma.h"
22 #include "llvm/ADT/StringRef.h"
23 
24 namespace clang {
25  class Token;
26  class IdentifierInfo;
27  class MacroDefinition;
28  class MacroDirective;
29  class MacroArgs;
30 
31 /// This interface provides a way to observe the actions of the
32 /// preprocessor as it does its thing.
33 ///
34 /// Clients can define their hooks here to implement preprocessor level tools.
35 class PPCallbacks {
36 public:
37  virtual ~PPCallbacks();
38 
41  };
42 
43  /// Callback invoked whenever a source file is entered or exited.
44  ///
45  /// \param Loc Indicates the new location.
46  /// \param PrevFID the file that was exited if \p Reason is ExitFile.
47  virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason,
49  FileID PrevFID = FileID()) {
50  }
51 
52  /// Callback invoked whenever a source file is skipped as the result
53  /// of header guard optimization.
54  ///
55  /// \param SkippedFile The file that is skipped instead of entering \#include
56  ///
57  /// \param FilenameTok The file name token in \#include "FileName" directive
58  /// or macro expanded file name token from \#include MACRO(PARAMS) directive.
59  /// Note that FilenameTok contains corresponding quotes/angles symbols.
60  virtual void FileSkipped(const FileEntryRef &SkippedFile,
61  const Token &FilenameTok,
62  SrcMgr::CharacteristicKind FileType) {}
63 
64  /// Callback invoked whenever an inclusion directive of
65  /// any kind (\c \#include, \c \#import, etc.) has been processed, regardless
66  /// of whether the inclusion will actually result in an inclusion.
67  ///
68  /// \param HashLoc The location of the '#' that starts the inclusion
69  /// directive.
70  ///
71  /// \param IncludeTok The token that indicates the kind of inclusion
72  /// directive, e.g., 'include' or 'import'.
73  ///
74  /// \param FileName The name of the file being included, as written in the
75  /// source code.
76  ///
77  /// \param IsAngled Whether the file name was enclosed in angle brackets;
78  /// otherwise, it was enclosed in quotes.
79  ///
80  /// \param FilenameRange The character range of the quotes or angle brackets
81  /// for the written file name.
82  ///
83  /// \param File The actual file that may be included by this inclusion
84  /// directive.
85  ///
86  /// \param SearchPath Contains the search path which was used to find the file
87  /// in the file system. If the file was found via an absolute include path,
88  /// SearchPath will be empty. For framework includes, the SearchPath and
89  /// RelativePath will be split up. For example, if an include of "Some/Some.h"
90  /// is found via the framework path
91  /// "path/to/Frameworks/Some.framework/Headers/Some.h", SearchPath will be
92  /// "path/to/Frameworks/Some.framework/Headers" and RelativePath will be
93  /// "Some.h".
94  ///
95  /// \param RelativePath The path relative to SearchPath, at which the include
96  /// file was found. This is equal to FileName except for framework includes.
97  ///
98  /// \param Imported The module, whenever an inclusion directive was
99  /// automatically turned into a module import or null otherwise.
100  ///
101  /// \param FileType The characteristic kind, indicates whether a file or
102  /// directory holds normal user code, system code, or system code which is
103  /// implicitly 'extern "C"' in C++ mode.
104  ///
105  virtual void InclusionDirective(SourceLocation HashLoc,
106  const Token &IncludeTok,
107  StringRef FileName,
108  bool IsAngled,
109  CharSourceRange FilenameRange,
111  StringRef SearchPath,
112  StringRef RelativePath,
113  const Module *Imported,
114  SrcMgr::CharacteristicKind FileType) {
115  }
116 
117  /// Callback invoked whenever a submodule was entered.
118  ///
119  /// \param M The submodule we have entered.
120  ///
121  /// \param ImportLoc The location of import directive token.
122  ///
123  /// \param ForPragma If entering from pragma directive.
124  ///
125  virtual void EnteredSubmodule(Module *M, SourceLocation ImportLoc,
126  bool ForPragma) { }
127 
128  /// Callback invoked whenever a submodule was left.
129  ///
130  /// \param M The submodule we have left.
131  ///
132  /// \param ImportLoc The location of import directive token.
133  ///
134  /// \param ForPragma If entering from pragma directive.
135  ///
136  virtual void LeftSubmodule(Module *M, SourceLocation ImportLoc,
137  bool ForPragma) { }
138 
139  /// Callback invoked whenever there was an explicit module-import
140  /// syntax.
141  ///
142  /// \param ImportLoc The location of import directive token.
143  ///
144  /// \param Path The identifiers (and their locations) of the module
145  /// "path", e.g., "std.vector" would be split into "std" and "vector".
146  ///
147  /// \param Imported The imported module; can be null if importing failed.
148  ///
149  virtual void moduleImport(SourceLocation ImportLoc,
150  ModuleIdPath Path,
151  const Module *Imported) {
152  }
153 
154  /// Callback invoked when the end of the main file is reached.
155  ///
156  /// No subsequent callbacks will be made.
157  virtual void EndOfMainFile() {
158  }
159 
160  /// Callback invoked when a \#ident or \#sccs directive is read.
161  /// \param Loc The location of the directive.
162  /// \param str The text of the directive.
163  ///
164  virtual void Ident(SourceLocation Loc, StringRef str) {
165  }
166 
167  /// Callback invoked when start reading any pragma directive.
168  virtual void PragmaDirective(SourceLocation Loc,
169  PragmaIntroducerKind Introducer) {
170  }
171 
172  /// Callback invoked when a \#pragma comment directive is read.
174  StringRef Str) {
175  }
176 
177  /// Callback invoked when a \#pragma mark comment is read.
178  virtual void PragmaMark(SourceLocation Loc, StringRef Trivia) {
179  }
180 
181  /// Callback invoked when a \#pragma detect_mismatch directive is
182  /// read.
183  virtual void PragmaDetectMismatch(SourceLocation Loc, StringRef Name,
184  StringRef Value) {
185  }
186 
187  /// Callback invoked when a \#pragma clang __debug directive is read.
188  /// \param Loc The location of the debug directive.
189  /// \param DebugType The identifier following __debug.
190  virtual void PragmaDebug(SourceLocation Loc, StringRef DebugType) {
191  }
192 
193  /// Determines the kind of \#pragma invoking a call to PragmaMessage.
195  /// \#pragma message has been invoked.
197 
198  /// \#pragma GCC warning has been invoked.
200 
201  /// \#pragma GCC error has been invoked.
203  };
204 
205  /// Callback invoked when a \#pragma message directive is read.
206  /// \param Loc The location of the message directive.
207  /// \param Namespace The namespace of the message directive.
208  /// \param Kind The type of the message directive.
209  /// \param Str The text of the message directive.
210  virtual void PragmaMessage(SourceLocation Loc, StringRef Namespace,
211  PragmaMessageKind Kind, StringRef Str) {
212  }
213 
214  /// Callback invoked when a \#pragma gcc diagnostic push directive
215  /// is read.
217  StringRef Namespace) {
218  }
219 
220  /// Callback invoked when a \#pragma gcc diagnostic pop directive
221  /// is read.
223  StringRef Namespace) {
224  }
225 
226  /// Callback invoked when a \#pragma gcc diagnostic directive is read.
227  virtual void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace,
228  diag::Severity mapping, StringRef Str) {}
229 
230  /// Called when an OpenCL extension is either disabled or
231  /// enabled with a pragma.
232  virtual void PragmaOpenCLExtension(SourceLocation NameLoc,
233  const IdentifierInfo *Name,
234  SourceLocation StateLoc, unsigned State) {
235  }
236 
237  /// Callback invoked when a \#pragma warning directive is read.
248  };
249  virtual void PragmaWarning(SourceLocation Loc,
250  PragmaWarningSpecifier WarningSpec,
251  ArrayRef<int> Ids) {}
252 
253  /// Callback invoked when a \#pragma warning(push) directive is read.
254  virtual void PragmaWarningPush(SourceLocation Loc, int Level) {
255  }
256 
257  /// Callback invoked when a \#pragma warning(pop) directive is read.
258  virtual void PragmaWarningPop(SourceLocation Loc) {
259  }
260 
261  /// Callback invoked when a \#pragma execution_character_set(push) directive
262  /// is read.
263  virtual void PragmaExecCharsetPush(SourceLocation Loc, StringRef Str) {}
264 
265  /// Callback invoked when a \#pragma execution_character_set(pop) directive
266  /// is read.
268 
269  /// Callback invoked when a \#pragma clang assume_nonnull begin directive
270  /// is read.
272 
273  /// Callback invoked when a \#pragma clang assume_nonnull end directive
274  /// is read.
276 
277  /// Called by Preprocessor::HandleMacroExpandedIdentifier when a
278  /// macro invocation is found.
279  virtual void MacroExpands(const Token &MacroNameTok,
280  const MacroDefinition &MD, SourceRange Range,
281  const MacroArgs *Args) {}
282 
283  /// Hook called whenever a macro definition is seen.
284  virtual void MacroDefined(const Token &MacroNameTok,
285  const MacroDirective *MD) {
286  }
287 
288  /// Hook called whenever a macro \#undef is seen.
289  /// \param MacroNameTok The active Token
290  /// \param MD A MacroDefinition for the named macro.
291  /// \param Undef New MacroDirective if the macro was defined, null otherwise.
292  ///
293  /// MD is released immediately following this callback.
294  virtual void MacroUndefined(const Token &MacroNameTok,
295  const MacroDefinition &MD,
296  const MacroDirective *Undef) {
297  }
298 
299  /// Hook called whenever the 'defined' operator is seen.
300  /// \param MD The MacroDirective if the name was a macro, null otherwise.
301  virtual void Defined(const Token &MacroNameTok, const MacroDefinition &MD,
302  SourceRange Range) {
303  }
304 
305  /// Hook called when a '__has_include' or '__has_include_next' directive is
306  /// read.
307  virtual void HasInclude(SourceLocation Loc, StringRef FileName, bool IsAngled,
309  SrcMgr::CharacteristicKind FileType);
310 
311  /// Hook called when a source range is skipped.
312  /// \param Range The SourceRange that was skipped. The range begins at the
313  /// \#if/\#else directive and ends after the \#endif/\#else directive.
314  /// \param EndifLoc The end location of the 'endif' token, which may precede
315  /// the range skipped by the directive (e.g excluding comments after an
316  /// 'endif').
317  virtual void SourceRangeSkipped(SourceRange Range, SourceLocation EndifLoc) {
318  }
319 
322  };
323 
324  /// Hook called whenever an \#if is seen.
325  /// \param Loc the source location of the directive.
326  /// \param ConditionRange The SourceRange of the expression being tested.
327  /// \param ConditionValue The evaluated value of the condition.
328  ///
329  // FIXME: better to pass in a list (or tree!) of Tokens.
330  virtual void If(SourceLocation Loc, SourceRange ConditionRange,
331  ConditionValueKind ConditionValue) {
332  }
333 
334  /// Hook called whenever an \#elif is seen.
335  /// \param Loc the source location of the directive.
336  /// \param ConditionRange The SourceRange of the expression being tested.
337  /// \param ConditionValue The evaluated value of the condition.
338  /// \param IfLoc the source location of the \#if/\#ifdef/\#ifndef directive.
339  // FIXME: better to pass in a list (or tree!) of Tokens.
340  virtual void Elif(SourceLocation Loc, SourceRange ConditionRange,
341  ConditionValueKind ConditionValue, SourceLocation IfLoc) {
342  }
343 
344  /// Hook called whenever an \#ifdef is seen.
345  /// \param Loc the source location of the directive.
346  /// \param MacroNameTok Information on the token being tested.
347  /// \param MD The MacroDefinition if the name was a macro, null otherwise.
348  virtual void Ifdef(SourceLocation Loc, const Token &MacroNameTok,
349  const MacroDefinition &MD) {
350  }
351 
352  /// Hook called whenever an \#elifdef branch is taken.
353  /// \param Loc the source location of the directive.
354  /// \param MacroNameTok Information on the token being tested.
355  /// \param MD The MacroDefinition if the name was a macro, null otherwise.
356  virtual void Elifdef(SourceLocation Loc, const Token &MacroNameTok,
357  const MacroDefinition &MD) {
358  }
359  /// Hook called whenever an \#elifdef is skipped.
360  /// \param Loc the source location of the directive.
361  /// \param ConditionRange The SourceRange of the expression being tested.
362  /// \param IfLoc the source location of the \#if/\#ifdef/\#ifndef directive.
363  // FIXME: better to pass in a list (or tree!) of Tokens.
364  virtual void Elifdef(SourceLocation Loc, SourceRange ConditionRange,
365  SourceLocation IfLoc) {
366  }
367 
368  /// Hook called whenever an \#ifndef is seen.
369  /// \param Loc the source location of the directive.
370  /// \param MacroNameTok Information on the token being tested.
371  /// \param MD The MacroDefiniton if the name was a macro, null otherwise.
372  virtual void Ifndef(SourceLocation Loc, const Token &MacroNameTok,
373  const MacroDefinition &MD) {
374  }
375 
376  /// Hook called whenever an \#elifndef branch is taken.
377  /// \param Loc the source location of the directive.
378  /// \param MacroNameTok Information on the token being tested.
379  /// \param MD The MacroDefinition if the name was a macro, null otherwise.
380  virtual void Elifndef(SourceLocation Loc, const Token &MacroNameTok,
381  const MacroDefinition &MD) {
382  }
383  /// Hook called whenever an \#elifndef is skipped.
384  /// \param Loc the source location of the directive.
385  /// \param ConditionRange The SourceRange of the expression being tested.
386  /// \param IfLoc the source location of the \#if/\#ifdef/\#ifndef directive.
387  // FIXME: better to pass in a list (or tree!) of Tokens.
388  virtual void Elifndef(SourceLocation Loc, SourceRange ConditionRange,
389  SourceLocation IfLoc) {
390  }
391 
392  /// Hook called whenever an \#else is seen.
393  /// \param Loc the source location of the directive.
394  /// \param IfLoc the source location of the \#if/\#ifdef/\#ifndef directive.
395  virtual void Else(SourceLocation Loc, SourceLocation IfLoc) {
396  }
397 
398  /// Hook called whenever an \#endif is seen.
399  /// \param Loc the source location of the directive.
400  /// \param IfLoc the source location of the \#if/\#ifdef/\#ifndef directive.
401  virtual void Endif(SourceLocation Loc, SourceLocation IfLoc) {
402  }
403 };
404 
405 /// Simple wrapper class for chaining callbacks.
407  std::unique_ptr<PPCallbacks> First, Second;
408 
409 public:
410  PPChainedCallbacks(std::unique_ptr<PPCallbacks> _First,
411  std::unique_ptr<PPCallbacks> _Second)
412  : First(std::move(_First)), Second(std::move(_Second)) {}
413 
414  ~PPChainedCallbacks() override;
415 
418  FileID PrevFID) override {
419  First->FileChanged(Loc, Reason, FileType, PrevFID);
420  Second->FileChanged(Loc, Reason, FileType, PrevFID);
421  }
422 
423  void FileSkipped(const FileEntryRef &SkippedFile, const Token &FilenameTok,
424  SrcMgr::CharacteristicKind FileType) override {
425  First->FileSkipped(SkippedFile, FilenameTok, FileType);
426  Second->FileSkipped(SkippedFile, FilenameTok, FileType);
427  }
428 
429  void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
430  StringRef FileName, bool IsAngled,
431  CharSourceRange FilenameRange,
432  Optional<FileEntryRef> File, StringRef SearchPath,
433  StringRef RelativePath, const Module *Imported,
434  SrcMgr::CharacteristicKind FileType) override {
435  First->InclusionDirective(HashLoc, IncludeTok, FileName, IsAngled,
436  FilenameRange, File, SearchPath, RelativePath,
437  Imported, FileType);
438  Second->InclusionDirective(HashLoc, IncludeTok, FileName, IsAngled,
439  FilenameRange, File, SearchPath, RelativePath,
440  Imported, FileType);
441  }
442 
444  bool ForPragma) override {
445  First->EnteredSubmodule(M, ImportLoc, ForPragma);
446  Second->EnteredSubmodule(M, ImportLoc, ForPragma);
447  }
448 
449  void LeftSubmodule(Module *M, SourceLocation ImportLoc,
450  bool ForPragma) override {
451  First->LeftSubmodule(M, ImportLoc, ForPragma);
452  Second->LeftSubmodule(M, ImportLoc, ForPragma);
453  }
454 
456  const Module *Imported) override {
457  First->moduleImport(ImportLoc, Path, Imported);
458  Second->moduleImport(ImportLoc, Path, Imported);
459  }
460 
461  void EndOfMainFile() override {
462  First->EndOfMainFile();
463  Second->EndOfMainFile();
464  }
465 
466  void Ident(SourceLocation Loc, StringRef str) override {
467  First->Ident(Loc, str);
468  Second->Ident(Loc, str);
469  }
470 
472  PragmaIntroducerKind Introducer) override {
473  First->PragmaDirective(Loc, Introducer);
474  Second->PragmaDirective(Loc, Introducer);
475  }
476 
478  StringRef Str) override {
479  First->PragmaComment(Loc, Kind, Str);
480  Second->PragmaComment(Loc, Kind, Str);
481  }
482 
483  void PragmaMark(SourceLocation Loc, StringRef Trivia) override {
484  First->PragmaMark(Loc, Trivia);
485  Second->PragmaMark(Loc, Trivia);
486  }
487 
488  void PragmaDetectMismatch(SourceLocation Loc, StringRef Name,
489  StringRef Value) override {
490  First->PragmaDetectMismatch(Loc, Name, Value);
491  Second->PragmaDetectMismatch(Loc, Name, Value);
492  }
493 
494  void PragmaDebug(SourceLocation Loc, StringRef DebugType) override {
495  First->PragmaDebug(Loc, DebugType);
496  Second->PragmaDebug(Loc, DebugType);
497  }
498 
499  void PragmaMessage(SourceLocation Loc, StringRef Namespace,
500  PragmaMessageKind Kind, StringRef Str) override {
501  First->PragmaMessage(Loc, Namespace, Kind, Str);
502  Second->PragmaMessage(Loc, Namespace, Kind, Str);
503  }
504 
505  void PragmaDiagnosticPush(SourceLocation Loc, StringRef Namespace) override {
506  First->PragmaDiagnosticPush(Loc, Namespace);
507  Second->PragmaDiagnosticPush(Loc, Namespace);
508  }
509 
510  void PragmaDiagnosticPop(SourceLocation Loc, StringRef Namespace) override {
511  First->PragmaDiagnosticPop(Loc, Namespace);
512  Second->PragmaDiagnosticPop(Loc, Namespace);
513  }
514 
515  void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace,
516  diag::Severity mapping, StringRef Str) override {
517  First->PragmaDiagnostic(Loc, Namespace, mapping, Str);
518  Second->PragmaDiagnostic(Loc, Namespace, mapping, Str);
519  }
520 
521  void HasInclude(SourceLocation Loc, StringRef FileName, bool IsAngled,
523  SrcMgr::CharacteristicKind FileType) override;
524 
526  SourceLocation StateLoc, unsigned State) override {
527  First->PragmaOpenCLExtension(NameLoc, Name, StateLoc, State);
528  Second->PragmaOpenCLExtension(NameLoc, Name, StateLoc, State);
529  }
530 
532  ArrayRef<int> Ids) override {
533  First->PragmaWarning(Loc, WarningSpec, Ids);
534  Second->PragmaWarning(Loc, WarningSpec, Ids);
535  }
536 
537  void PragmaWarningPush(SourceLocation Loc, int Level) override {
538  First->PragmaWarningPush(Loc, Level);
539  Second->PragmaWarningPush(Loc, Level);
540  }
541 
542  void PragmaWarningPop(SourceLocation Loc) override {
543  First->PragmaWarningPop(Loc);
544  Second->PragmaWarningPop(Loc);
545  }
546 
547  void PragmaExecCharsetPush(SourceLocation Loc, StringRef Str) override {
548  First->PragmaExecCharsetPush(Loc, Str);
549  Second->PragmaExecCharsetPush(Loc, Str);
550  }
551 
553  First->PragmaExecCharsetPop(Loc);
554  Second->PragmaExecCharsetPop(Loc);
555  }
556 
558  First->PragmaAssumeNonNullBegin(Loc);
559  Second->PragmaAssumeNonNullBegin(Loc);
560  }
561 
563  First->PragmaAssumeNonNullEnd(Loc);
564  Second->PragmaAssumeNonNullEnd(Loc);
565  }
566 
567  void MacroExpands(const Token &MacroNameTok, const MacroDefinition &MD,
568  SourceRange Range, const MacroArgs *Args) override {
569  First->MacroExpands(MacroNameTok, MD, Range, Args);
570  Second->MacroExpands(MacroNameTok, MD, Range, Args);
571  }
572 
573  void MacroDefined(const Token &MacroNameTok,
574  const MacroDirective *MD) override {
575  First->MacroDefined(MacroNameTok, MD);
576  Second->MacroDefined(MacroNameTok, MD);
577  }
578 
579  void MacroUndefined(const Token &MacroNameTok,
580  const MacroDefinition &MD,
581  const MacroDirective *Undef) override {
582  First->MacroUndefined(MacroNameTok, MD, Undef);
583  Second->MacroUndefined(MacroNameTok, MD, Undef);
584  }
585 
586  void Defined(const Token &MacroNameTok, const MacroDefinition &MD,
587  SourceRange Range) override {
588  First->Defined(MacroNameTok, MD, Range);
589  Second->Defined(MacroNameTok, MD, Range);
590  }
591 
592  void SourceRangeSkipped(SourceRange Range, SourceLocation EndifLoc) override {
593  First->SourceRangeSkipped(Range, EndifLoc);
594  Second->SourceRangeSkipped(Range, EndifLoc);
595  }
596 
597  /// Hook called whenever an \#if is seen.
598  void If(SourceLocation Loc, SourceRange ConditionRange,
599  ConditionValueKind ConditionValue) override {
600  First->If(Loc, ConditionRange, ConditionValue);
601  Second->If(Loc, ConditionRange, ConditionValue);
602  }
603 
604  /// Hook called whenever an \#elif is seen.
605  void Elif(SourceLocation Loc, SourceRange ConditionRange,
606  ConditionValueKind ConditionValue, SourceLocation IfLoc) override {
607  First->Elif(Loc, ConditionRange, ConditionValue, IfLoc);
608  Second->Elif(Loc, ConditionRange, ConditionValue, IfLoc);
609  }
610 
611  /// Hook called whenever an \#ifdef is seen.
612  void Ifdef(SourceLocation Loc, const Token &MacroNameTok,
613  const MacroDefinition &MD) override {
614  First->Ifdef(Loc, MacroNameTok, MD);
615  Second->Ifdef(Loc, MacroNameTok, MD);
616  }
617 
618  /// Hook called whenever an \#elifdef is taken.
619  void Elifdef(SourceLocation Loc, const Token &MacroNameTok,
620  const MacroDefinition &MD) override {
621  First->Elifdef(Loc, MacroNameTok, MD);
622  Second->Elifdef(Loc, MacroNameTok, MD);
623  }
624  /// Hook called whenever an \#elifdef is skipped.
625  void Elifdef(SourceLocation Loc, SourceRange ConditionRange,
626  SourceLocation IfLoc) override {
627  First->Elifdef(Loc, ConditionRange, IfLoc);
628  Second->Elifdef(Loc, ConditionRange, IfLoc);
629  }
630 
631  /// Hook called whenever an \#ifndef is seen.
632  void Ifndef(SourceLocation Loc, const Token &MacroNameTok,
633  const MacroDefinition &MD) override {
634  First->Ifndef(Loc, MacroNameTok, MD);
635  Second->Ifndef(Loc, MacroNameTok, MD);
636  }
637 
638  /// Hook called whenever an \#elifndef is taken.
639  void Elifndef(SourceLocation Loc, const Token &MacroNameTok,
640  const MacroDefinition &MD) override {
641  First->Elifndef(Loc, MacroNameTok, MD);
642  Second->Elifndef(Loc, MacroNameTok, MD);
643  }
644  /// Hook called whenever an \#elifndef is skipped.
645  void Elifndef(SourceLocation Loc, SourceRange ConditionRange,
646  SourceLocation IfLoc) override {
647  First->Elifndef(Loc, ConditionRange, IfLoc);
648  Second->Elifndef(Loc, ConditionRange, IfLoc);
649  }
650 
651  /// Hook called whenever an \#else is seen.
652  void Else(SourceLocation Loc, SourceLocation IfLoc) override {
653  First->Else(Loc, IfLoc);
654  Second->Else(Loc, IfLoc);
655  }
656 
657  /// Hook called whenever an \#endif is seen.
658  void Endif(SourceLocation Loc, SourceLocation IfLoc) override {
659  First->Endif(Loc, IfLoc);
660  Second->Endif(Loc, IfLoc);
661  }
662 };
663 
664 } // end namespace clang
665 
666 #endif
clang::PPCallbacks::PWS_Once
@ PWS_Once
Definition: PPCallbacks.h:242
clang::PPCallbacks::CVK_True
@ CVK_True
Definition: PPCallbacks.h:321
clang::PPCallbacks::~PPCallbacks
virtual ~PPCallbacks()
clang::diag::Severity
Severity
Enum values that allow the client to map NOTEs, WARNINGs, and EXTENSIONs to either Ignore (nothing),...
Definition: DiagnosticIDs.h:82
clang::PPChainedCallbacks::PragmaDirective
void PragmaDirective(SourceLocation Loc, PragmaIntroducerKind Introducer) override
Callback invoked when start reading any pragma directive.
Definition: PPCallbacks.h:471
clang::PPCallbacks::FileSkipped
virtual void FileSkipped(const FileEntryRef &SkippedFile, const Token &FilenameTok, SrcMgr::CharacteristicKind FileType)
Callback invoked whenever a source file is skipped as the result of header guard optimization.
Definition: PPCallbacks.h:60
clang::PPCallbacks::PragmaAssumeNonNullBegin
virtual void PragmaAssumeNonNullBegin(SourceLocation Loc)
Callback invoked when a #pragma clang assume_nonnull begin directive is read.
Definition: PPCallbacks.h:271
clang::PPCallbacks::PragmaDebug
virtual void PragmaDebug(SourceLocation Loc, StringRef DebugType)
Callback invoked when a #pragma clang __debug directive is read.
Definition: PPCallbacks.h:190
clang::PragmaIntroducerKind
PragmaIntroducerKind
Describes how the pragma was introduced, e.g., with #pragma, _Pragma, or __pragma.
Definition: Pragma.h:32
clang::FileEntryRef
A reference to a FileEntry that includes the name of the file as it was accessed by the FileManager's...
Definition: FileEntry.h:60
clang::PPChainedCallbacks::EnteredSubmodule
void EnteredSubmodule(Module *M, SourceLocation ImportLoc, bool ForPragma) override
Callback invoked whenever a submodule was entered.
Definition: PPCallbacks.h:443
clang::PPCallbacks::SourceRangeSkipped
virtual void SourceRangeSkipped(SourceRange Range, SourceLocation EndifLoc)
Hook called when a source range is skipped.
Definition: PPCallbacks.h:317
clang::DeclaratorContext::File
@ File
clang::SourceRange
A trivial tuple used to represent a source range.
Definition: SourceLocation.h:210
clang::PPCallbacks::PragmaAssumeNonNullEnd
virtual void PragmaAssumeNonNullEnd(SourceLocation Loc)
Callback invoked when a #pragma clang assume_nonnull end directive is read.
Definition: PPCallbacks.h:275
clang::PPCallbacks::Ident
virtual void Ident(SourceLocation Loc, StringRef str)
Callback invoked when a #ident or #sccs directive is read.
Definition: PPCallbacks.h:164
clang::PPCallbacks::If
virtual void If(SourceLocation Loc, SourceRange ConditionRange, ConditionValueKind ConditionValue)
Hook called whenever an #if is seen.
Definition: PPCallbacks.h:330
clang::PPCallbacks::PWS_Disable
@ PWS_Disable
Definition: PPCallbacks.h:240
clang::PPChainedCallbacks::Elif
void Elif(SourceLocation Loc, SourceRange ConditionRange, ConditionValueKind ConditionValue, SourceLocation IfLoc) override
Hook called whenever an #elif is seen.
Definition: PPCallbacks.h:605
clang::PPChainedCallbacks::If
void If(SourceLocation Loc, SourceRange ConditionRange, ConditionValueKind ConditionValue) override
Hook called whenever an #if is seen.
Definition: PPCallbacks.h:598
clang::MacroDefinition
A description of the current definition of a macro.
Definition: MacroInfo.h:588
clang::PPChainedCallbacks::InclusionDirective
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, bool IsAngled, CharSourceRange FilenameRange, Optional< FileEntryRef > File, StringRef SearchPath, StringRef RelativePath, const Module *Imported, SrcMgr::CharacteristicKind FileType) override
Callback invoked whenever an inclusion directive of any kind (#include, #import, etc....
Definition: PPCallbacks.h:429
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
clang::PPChainedCallbacks::HasInclude
void HasInclude(SourceLocation Loc, StringRef FileName, bool IsAngled, Optional< FileEntryRef > File, SrcMgr::CharacteristicKind FileType) override
Hook called when a '__has_include' or '__has_include_next' directive is read.
Definition: PPCallbacks.cpp:24
clang::PPCallbacks::PMK_Error
@ PMK_Error
#pragma GCC error has been invoked.
Definition: PPCallbacks.h:202
clang::PPCallbacks
This interface provides a way to observe the actions of the preprocessor as it does its thing.
Definition: PPCallbacks.h:35
clang::PPCallbacks::EnteredSubmodule
virtual void EnteredSubmodule(Module *M, SourceLocation ImportLoc, bool ForPragma)
Callback invoked whenever a submodule was entered.
Definition: PPCallbacks.h:125
clang::PPCallbacks::LeftSubmodule
virtual void LeftSubmodule(Module *M, SourceLocation ImportLoc, bool ForPragma)
Callback invoked whenever a submodule was left.
Definition: PPCallbacks.h:136
clang::PPCallbacks::MacroUndefined
virtual void MacroUndefined(const Token &MacroNameTok, const MacroDefinition &MD, const MacroDirective *Undef)
Hook called whenever a macro #undef is seen.
Definition: PPCallbacks.h:294
clang::PPCallbacks::PragmaComment
virtual void PragmaComment(SourceLocation Loc, const IdentifierInfo *Kind, StringRef Str)
Callback invoked when a #pragma comment directive is read.
Definition: PPCallbacks.h:173
clang::MacroArgs
MacroArgs - An instance of this class captures information about the formal arguments specified to a ...
Definition: MacroArgs.h:29
clang::PPChainedCallbacks::PragmaDiagnosticPop
void PragmaDiagnosticPop(SourceLocation Loc, StringRef Namespace) override
Callback invoked when a #pragma gcc diagnostic pop directive is read.
Definition: PPCallbacks.h:510
clang::PPCallbacks::PragmaDetectMismatch
virtual void PragmaDetectMismatch(SourceLocation Loc, StringRef Name, StringRef Value)
Callback invoked when a #pragma detect_mismatch directive is read.
Definition: PPCallbacks.h:183
clang::PPCallbacks::EnterFile
@ EnterFile
Definition: PPCallbacks.h:40
llvm::Optional< FileEntryRef >
clang::ComparisonCategoryType::First
@ First
clang::PPCallbacks::PragmaDiagnosticPush
virtual void PragmaDiagnosticPush(SourceLocation Loc, StringRef Namespace)
Callback invoked when a #pragma gcc diagnostic push directive is read.
Definition: PPCallbacks.h:216
clang::PPChainedCallbacks::Elifndef
void Elifndef(SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD) override
Hook called whenever an #elifndef is taken.
Definition: PPCallbacks.h:639
SourceManager.h
clang::PPChainedCallbacks::PragmaMark
void PragmaMark(SourceLocation Loc, StringRef Trivia) override
Callback invoked when a #pragma mark comment is read.
Definition: PPCallbacks.h:483
clang::SrcMgr::CharacteristicKind
CharacteristicKind
Indicates whether a file or directory holds normal user code, system code, or system code which is im...
Definition: SourceManager.h:79
clang::PPChainedCallbacks::PPChainedCallbacks
PPChainedCallbacks(std::unique_ptr< PPCallbacks > _First, std::unique_ptr< PPCallbacks > _Second)
Definition: PPCallbacks.h:410
clang::PPCallbacks::PWS_Suppress
@ PWS_Suppress
Definition: PPCallbacks.h:243
DiagnosticIDs.h
clang::PPCallbacks::Ifndef
virtual void Ifndef(SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD)
Hook called whenever an #ifndef is seen.
Definition: PPCallbacks.h:372
clang::PPChainedCallbacks::PragmaAssumeNonNullBegin
void PragmaAssumeNonNullBegin(SourceLocation Loc) override
Callback invoked when a #pragma clang assume_nonnull begin directive is read.
Definition: PPCallbacks.h:557
clang::Token
Token - This structure provides full information about a lexed token.
Definition: Token.h:34
clang::PPChainedCallbacks::EndOfMainFile
void EndOfMainFile() override
Callback invoked when the end of the main file is reached.
Definition: PPCallbacks.h:461
clang::PPChainedCallbacks::FileSkipped
void FileSkipped(const FileEntryRef &SkippedFile, const Token &FilenameTok, SrcMgr::CharacteristicKind FileType) override
Callback invoked whenever a source file is skipped as the result of header guard optimization.
Definition: PPCallbacks.h:423
clang::PPCallbacks::CVK_False
@ CVK_False
Definition: PPCallbacks.h:321
clang::PPCallbacks::MacroExpands
virtual void MacroExpands(const Token &MacroNameTok, const MacroDefinition &MD, SourceRange Range, const MacroArgs *Args)
Called by Preprocessor::HandleMacroExpandedIdentifier when a macro invocation is found.
Definition: PPCallbacks.h:279
clang::Module
Describes a module or submodule.
Definition: Module.h:96
clang::PPChainedCallbacks::PragmaWarningPop
void PragmaWarningPop(SourceLocation Loc) override
Callback invoked when a #pragma warning(pop) directive is read.
Definition: PPCallbacks.h:542
clang::PPChainedCallbacks::Endif
void Endif(SourceLocation Loc, SourceLocation IfLoc) override
Hook called whenever an #endif is seen.
Definition: PPCallbacks.h:658
clang::PPCallbacks::PragmaDirective
virtual void PragmaDirective(SourceLocation Loc, PragmaIntroducerKind Introducer)
Callback invoked when start reading any pragma directive.
Definition: PPCallbacks.h:168
clang::PPChainedCallbacks::Ifdef
void Ifdef(SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD) override
Hook called whenever an #ifdef is seen.
Definition: PPCallbacks.h:612
Pragma.h
clang::PPChainedCallbacks::MacroDefined
void MacroDefined(const Token &MacroNameTok, const MacroDirective *MD) override
Hook called whenever a macro definition is seen.
Definition: PPCallbacks.h:573
clang::PPChainedCallbacks::PragmaExecCharsetPush
void PragmaExecCharsetPush(SourceLocation Loc, StringRef Str) override
Callback invoked when a #pragma execution_character_set(push) directive is read.
Definition: PPCallbacks.h:547
clang::PPChainedCallbacks::PragmaOpenCLExtension
void PragmaOpenCLExtension(SourceLocation NameLoc, const IdentifierInfo *Name, SourceLocation StateLoc, unsigned State) override
Called when an OpenCL extension is either disabled or enabled with a pragma.
Definition: PPCallbacks.h:525
clang::PPCallbacks::Elifdef
virtual void Elifdef(SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD)
Hook called whenever an #elifdef branch is taken.
Definition: PPCallbacks.h:356
clang::PPCallbacks::PragmaExecCharsetPush
virtual void PragmaExecCharsetPush(SourceLocation Loc, StringRef Str)
Callback invoked when a #pragma execution_character_set(push) directive is read.
Definition: PPCallbacks.h:263
clang::PPCallbacks::PragmaWarning
virtual void PragmaWarning(SourceLocation Loc, PragmaWarningSpecifier WarningSpec, ArrayRef< int > Ids)
Definition: PPCallbacks.h:249
clang::PPCallbacks::Elif
virtual void Elif(SourceLocation Loc, SourceRange ConditionRange, ConditionValueKind ConditionValue, SourceLocation IfLoc)
Hook called whenever an #elif is seen.
Definition: PPCallbacks.h:340
clang::PPCallbacks::PragmaMessage
virtual void PragmaMessage(SourceLocation Loc, StringRef Namespace, PragmaMessageKind Kind, StringRef Str)
Callback invoked when a #pragma message directive is read.
Definition: PPCallbacks.h:210
clang::PPChainedCallbacks::Else
void Else(SourceLocation Loc, SourceLocation IfLoc) override
Hook called whenever an #else is seen.
Definition: PPCallbacks.h:652
ModuleLoader.h
clang::PPChainedCallbacks::FileChanged
void FileChanged(SourceLocation Loc, FileChangeReason Reason, SrcMgr::CharacteristicKind FileType, FileID PrevFID) override
Callback invoked whenever a source file is entered or exited.
Definition: PPCallbacks.h:416
clang::PPCallbacks::RenameFile
@ RenameFile
Definition: PPCallbacks.h:40
clang::PPChainedCallbacks::PragmaAssumeNonNullEnd
void PragmaAssumeNonNullEnd(SourceLocation Loc) override
Callback invoked when a #pragma clang assume_nonnull end directive is read.
Definition: PPCallbacks.h:562
clang::PPCallbacks::Elifndef
virtual void Elifndef(SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD)
Hook called whenever an #elifndef branch is taken.
Definition: PPCallbacks.h:380
clang::PPChainedCallbacks::PragmaDiagnosticPush
void PragmaDiagnosticPush(SourceLocation Loc, StringRef Namespace) override
Callback invoked when a #pragma gcc diagnostic push directive is read.
Definition: PPCallbacks.h:505
clang::PPCallbacks::ConditionValueKind
ConditionValueKind
Definition: PPCallbacks.h:320
clang::PPChainedCallbacks::PragmaWarning
void PragmaWarning(SourceLocation Loc, PragmaWarningSpecifier WarningSpec, ArrayRef< int > Ids) override
Definition: PPCallbacks.h:531
clang::PPChainedCallbacks::Ifndef
void Ifndef(SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD) override
Hook called whenever an #ifndef is seen.
Definition: PPCallbacks.h:632
clang::PPCallbacks::PMK_Warning
@ PMK_Warning
#pragma GCC warning has been invoked.
Definition: PPCallbacks.h:199
clang::PPChainedCallbacks
Simple wrapper class for chaining callbacks.
Definition: PPCallbacks.h:406
clang::PPChainedCallbacks::LeftSubmodule
void LeftSubmodule(Module *M, SourceLocation ImportLoc, bool ForPragma) override
Callback invoked whenever a submodule was left.
Definition: PPCallbacks.h:449
clang::PPCallbacks::Else
virtual void Else(SourceLocation Loc, SourceLocation IfLoc)
Hook called whenever an #else is seen.
Definition: PPCallbacks.h:395
clang::PPCallbacks::PMK_Message
@ PMK_Message
#pragma message has been invoked.
Definition: PPCallbacks.h:196
clang::PPCallbacks::Elifdef
virtual void Elifdef(SourceLocation Loc, SourceRange ConditionRange, SourceLocation IfLoc)
Hook called whenever an #elifdef is skipped.
Definition: PPCallbacks.h:364
clang::PPChainedCallbacks::PragmaWarningPush
void PragmaWarningPush(SourceLocation Loc, int Level) override
Callback invoked when a #pragma warning(push) directive is read.
Definition: PPCallbacks.h:537
clang::PPChainedCallbacks::MacroExpands
void MacroExpands(const Token &MacroNameTok, const MacroDefinition &MD, SourceRange Range, const MacroArgs *Args) override
Called by Preprocessor::HandleMacroExpandedIdentifier when a macro invocation is found.
Definition: PPCallbacks.h:567
clang::PPCallbacks::PWS_Level1
@ PWS_Level1
Definition: PPCallbacks.h:244
clang::PPCallbacks::Endif
virtual void Endif(SourceLocation Loc, SourceLocation IfLoc)
Hook called whenever an #endif is seen.
Definition: PPCallbacks.h:401
clang::PPCallbacks::ExitFile
@ ExitFile
Definition: PPCallbacks.h:40
SourceLocation.h
clang::PPCallbacks::FileChangeReason
FileChangeReason
Definition: PPCallbacks.h:39
clang::PPChainedCallbacks::MacroUndefined
void MacroUndefined(const Token &MacroNameTok, const MacroDefinition &MD, const MacroDirective *Undef) override
Hook called whenever a macro #undef is seen.
Definition: PPCallbacks.h:579
clang::PPCallbacks::SystemHeaderPragma
@ SystemHeaderPragma
Definition: PPCallbacks.h:40
clang::PPChainedCallbacks::Elifndef
void Elifndef(SourceLocation Loc, SourceRange ConditionRange, SourceLocation IfLoc) override
Hook called whenever an #elifndef is skipped.
Definition: PPCallbacks.h:645
llvm::ArrayRef
Definition: LLVM.h:34
clang::PPCallbacks::PragmaMark
virtual void PragmaMark(SourceLocation Loc, StringRef Trivia)
Callback invoked when a #pragma mark comment is read.
Definition: PPCallbacks.h:178
clang::PPCallbacks::Defined
virtual void Defined(const Token &MacroNameTok, const MacroDefinition &MD, SourceRange Range)
Hook called whenever the 'defined' operator is seen.
Definition: PPCallbacks.h:301
Value
Value
Definition: UninitializedValues.cpp:102
clang::PPChainedCallbacks::Ident
void Ident(SourceLocation Loc, StringRef str) override
Callback invoked when a #ident or #sccs directive is read.
Definition: PPCallbacks.h:466
clang::CharSourceRange
Represents a character-granular source range.
Definition: SourceLocation.h:253
clang::PPCallbacks::InclusionDirective
virtual void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, bool IsAngled, CharSourceRange FilenameRange, Optional< FileEntryRef > File, StringRef SearchPath, StringRef RelativePath, const Module *Imported, SrcMgr::CharacteristicKind FileType)
Callback invoked whenever an inclusion directive of any kind (#include, #import, etc....
Definition: PPCallbacks.h:105
clang::PPCallbacks::EndOfMainFile
virtual void EndOfMainFile()
Callback invoked when the end of the main file is reached.
Definition: PPCallbacks.h:157
State
LineState State
Definition: UnwrappedLineFormatter.cpp:1126
clang::PPChainedCallbacks::PragmaDebug
void PragmaDebug(SourceLocation Loc, StringRef DebugType) override
Callback invoked when a #pragma clang __debug directive is read.
Definition: PPCallbacks.h:494
clang::PPCallbacks::PragmaDiagnosticPop
virtual void PragmaDiagnosticPop(SourceLocation Loc, StringRef Namespace)
Callback invoked when a #pragma gcc diagnostic pop directive is read.
Definition: PPCallbacks.h:222
clang::PPChainedCallbacks::moduleImport
void moduleImport(SourceLocation ImportLoc, ModuleIdPath Path, const Module *Imported) override
Callback invoked whenever there was an explicit module-import syntax.
Definition: PPCallbacks.h:455
clang::PPCallbacks::PragmaWarningSpecifier
PragmaWarningSpecifier
Callback invoked when a #pragma warning directive is read.
Definition: PPCallbacks.h:238
clang::PPChainedCallbacks::PragmaMessage
void PragmaMessage(SourceLocation Loc, StringRef Namespace, PragmaMessageKind Kind, StringRef Str) override
Callback invoked when a #pragma message directive is read.
Definition: PPCallbacks.h:499
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition: IdentifierTable.h:84
clang::PPChainedCallbacks::PragmaExecCharsetPop
void PragmaExecCharsetPop(SourceLocation Loc) override
Callback invoked when a #pragma execution_character_set(pop) directive is read.
Definition: PPCallbacks.h:552
clang::PPCallbacks::HasInclude
virtual void HasInclude(SourceLocation Loc, StringRef FileName, bool IsAngled, Optional< FileEntryRef > File, SrcMgr::CharacteristicKind FileType)
Hook called when a '__has_include' or '__has_include_next' directive is read.
Definition: PPCallbacks.cpp:17
clang::PPChainedCallbacks::SourceRangeSkipped
void SourceRangeSkipped(SourceRange Range, SourceLocation EndifLoc) override
Hook called when a source range is skipped.
Definition: PPCallbacks.h:592
clang::ObjCPropertyAttribute::Kind
Kind
Definition: DeclObjCCommon.h:22
clang::PPChainedCallbacks::~PPChainedCallbacks
~PPChainedCallbacks() override
std
Definition: Format.h:4296
clang::PPCallbacks::PWS_Default
@ PWS_Default
Definition: PPCallbacks.h:239
clang::PPCallbacks::Elifndef
virtual void Elifndef(SourceLocation Loc, SourceRange ConditionRange, SourceLocation IfLoc)
Hook called whenever an #elifndef is skipped.
Definition: PPCallbacks.h:388
clang::PPChainedCallbacks::PragmaDetectMismatch
void PragmaDetectMismatch(SourceLocation Loc, StringRef Name, StringRef Value) override
Callback invoked when a #pragma detect_mismatch directive is read.
Definition: PPCallbacks.h:488
clang
Definition: CalledOnceCheck.h:17
clang::PPCallbacks::PragmaOpenCLExtension
virtual void PragmaOpenCLExtension(SourceLocation NameLoc, const IdentifierInfo *Name, SourceLocation StateLoc, unsigned State)
Called when an OpenCL extension is either disabled or enabled with a pragma.
Definition: PPCallbacks.h:232
clang::PPChainedCallbacks::Defined
void Defined(const Token &MacroNameTok, const MacroDefinition &MD, SourceRange Range) override
Hook called whenever the 'defined' operator is seen.
Definition: PPCallbacks.h:586
clang::MacroDirective
Encapsulates changes to the "macros namespace" (the location where the macro name became active,...
Definition: MacroInfo.h:314
clang::PPCallbacks::PragmaMessageKind
PragmaMessageKind
Determines the kind of #pragma invoking a call to PragmaMessage.
Definition: PPCallbacks.h:194
clang::PPChainedCallbacks::Elifdef
void Elifdef(SourceLocation Loc, SourceRange ConditionRange, SourceLocation IfLoc) override
Hook called whenever an #elifdef is skipped.
Definition: PPCallbacks.h:625
clang::PPCallbacks::Ifdef
virtual void Ifdef(SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD)
Hook called whenever an #ifdef is seen.
Definition: PPCallbacks.h:348
clang::prec::Level
Level
Definition: OperatorPrecedence.h:26
clang::FileID
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Definition: SourceLocation.h:38
clang::PPCallbacks::PWS_Level3
@ PWS_Level3
Definition: PPCallbacks.h:246
clang::PPCallbacks::PWS_Level4
@ PWS_Level4
Definition: PPCallbacks.h:247
clang::PPCallbacks::PragmaExecCharsetPop
virtual void PragmaExecCharsetPop(SourceLocation Loc)
Callback invoked when a #pragma execution_character_set(pop) directive is read.
Definition: PPCallbacks.h:267
clang::PPCallbacks::CVK_NotEvaluated
@ CVK_NotEvaluated
Definition: PPCallbacks.h:321
clang::PPCallbacks::MacroDefined
virtual void MacroDefined(const Token &MacroNameTok, const MacroDirective *MD)
Hook called whenever a macro definition is seen.
Definition: PPCallbacks.h:284
clang::PPChainedCallbacks::PragmaDiagnostic
void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace, diag::Severity mapping, StringRef Str) override
Callback invoked when a #pragma gcc diagnostic directive is read.
Definition: PPCallbacks.h:515
clang::PPCallbacks::FileChanged
virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason, SrcMgr::CharacteristicKind FileType, FileID PrevFID=FileID())
Callback invoked whenever a source file is entered or exited.
Definition: PPCallbacks.h:47
clang::PPChainedCallbacks::Elifdef
void Elifdef(SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD) override
Hook called whenever an #elifdef is taken.
Definition: PPCallbacks.h:619
clang::PPCallbacks::PragmaWarningPush
virtual void PragmaWarningPush(SourceLocation Loc, int Level)
Callback invoked when a #pragma warning(push) directive is read.
Definition: PPCallbacks.h:254
clang::PPCallbacks::PragmaWarningPop
virtual void PragmaWarningPop(SourceLocation Loc)
Callback invoked when a #pragma warning(pop) directive is read.
Definition: PPCallbacks.h:258
clang::PPCallbacks::moduleImport
virtual void moduleImport(SourceLocation ImportLoc, ModuleIdPath Path, const Module *Imported)
Callback invoked whenever there was an explicit module-import syntax.
Definition: PPCallbacks.h:149
clang::PPCallbacks::PragmaDiagnostic
virtual void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace, diag::Severity mapping, StringRef Str)
Callback invoked when a #pragma gcc diagnostic directive is read.
Definition: PPCallbacks.h:227
clang::PPChainedCallbacks::PragmaComment
void PragmaComment(SourceLocation Loc, const IdentifierInfo *Kind, StringRef Str) override
Callback invoked when a #pragma comment directive is read.
Definition: PPCallbacks.h:477
clang::PPCallbacks::PWS_Error
@ PWS_Error
Definition: PPCallbacks.h:241
clang::PPCallbacks::PWS_Level2
@ PWS_Level2
Definition: PPCallbacks.h:245