diff options
Diffstat (limited to 'include/clang/Lex/PPCallbacks.h')
-rw-r--r-- | include/clang/Lex/PPCallbacks.h | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/include/clang/Lex/PPCallbacks.h b/include/clang/Lex/PPCallbacks.h index 96359a2..db2ecd2 100644 --- a/include/clang/Lex/PPCallbacks.h +++ b/include/clang/Lex/PPCallbacks.h @@ -27,6 +27,7 @@ namespace clang { class Token; class IdentifierInfo; class MacroDirective; + class MacroArgs; /// \brief This interface provides a way to observe the actions of the /// preprocessor as it does its thing. @@ -159,10 +160,31 @@ public: const std::string &Str) { } + /// \brief Callback invoked when a \#pragma clang __debug directive is read. + /// \param Loc The location of the debug directive. + /// \param DebugType The identifier following __debug. + virtual void PragmaDebug(SourceLocation Loc, StringRef DebugType) { + } + + /// \brief Determines the kind of \#pragma invoking a call to PragmaMessage. + enum PragmaMessageKind { + /// \brief \#pragma message has been invoked. + PMK_Message, + + /// \brief \#pragma GCC warning has been invoked. + PMK_Warning, + + /// \brief \#pragma GCC error has been invoked. + PMK_Error + }; + /// \brief Callback invoked when a \#pragma message directive is read. /// \param Loc The location of the message directive. + /// \param Namespace The namespace of the message directive. + /// \param Kind The type of the message directive. /// \param Str The text of the message directive. - virtual void PragmaMessage(SourceLocation Loc, StringRef Str) { + virtual void PragmaMessage(SourceLocation Loc, StringRef Namespace, + PragmaMessageKind Kind, StringRef Str) { } /// \brief Callback invoked when a \#pragma gcc dianostic push directive @@ -185,7 +207,7 @@ public: /// \brief Called by Preprocessor::HandleMacroExpandedIdentifier when a /// macro invocation is found. virtual void MacroExpands(const Token &MacroNameTok, const MacroDirective *MD, - SourceRange Range) { + SourceRange Range, const MacroArgs *Args) { } /// \brief Hook called whenever a macro definition is seen. @@ -330,9 +352,10 @@ public: Second->PragmaComment(Loc, Kind, Str); } - virtual void PragmaMessage(SourceLocation Loc, StringRef Str) { - First->PragmaMessage(Loc, Str); - Second->PragmaMessage(Loc, Str); + virtual void PragmaMessage(SourceLocation Loc, StringRef Namespace, + PragmaMessageKind Kind, StringRef Str) { + First->PragmaMessage(Loc, Namespace, Kind, Str); + Second->PragmaMessage(Loc, Namespace, Kind, Str); } virtual void PragmaDiagnosticPush(SourceLocation Loc, @@ -354,9 +377,9 @@ public: } virtual void MacroExpands(const Token &MacroNameTok, const MacroDirective *MD, - SourceRange Range) { - First->MacroExpands(MacroNameTok, MD, Range); - Second->MacroExpands(MacroNameTok, MD, Range); + SourceRange Range, const MacroArgs *Args) { + First->MacroExpands(MacroNameTok, MD, Range, Args); + Second->MacroExpands(MacroNameTok, MD, Range, Args); } virtual void MacroDefined(const Token &MacroNameTok, const MacroDirective *MD) { |