diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-02-24 00:05:14 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-02-24 00:05:14 +0000 |
commit | c515978bd3a703aa733f846a0094ffa84d149074 (patch) | |
tree | 575f1660e68d74b4268c6a1460f2fbb4245da518 /lib/Frontend/PrintPreprocessedOutput.cpp | |
parent | 82a29af8cbc4b117af83c5c5dfa875b5699c97c4 (diff) |
[preprocessor] Use MacroDirective in the preprocessor callbacks to make available the
full information about the macro (e.g if it was imported and where).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PrintPreprocessedOutput.cpp')
-rw-r--r-- | lib/Frontend/PrintPreprocessedOutput.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Frontend/PrintPreprocessedOutput.cpp b/lib/Frontend/PrintPreprocessedOutput.cpp index 3d55adceff..58bbfd3f8a 100644 --- a/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/lib/Frontend/PrintPreprocessedOutput.cpp @@ -160,10 +160,10 @@ public: void HandleNewlinesInToken(const char *TokStr, unsigned Len); /// MacroDefined - This hook is called whenever a macro definition is seen. - void MacroDefined(const Token &MacroNameTok, const MacroInfo *MI); + void MacroDefined(const Token &MacroNameTok, const MacroDirective *MD); /// MacroUndefined - This hook is called whenever a macro #undef is seen. - void MacroUndefined(const Token &MacroNameTok, const MacroInfo *MI); + void MacroUndefined(const Token &MacroNameTok, const MacroDirective *MD); }; } // end anonymous namespace @@ -317,7 +317,8 @@ void PrintPPOutputPPCallbacks::Ident(SourceLocation Loc, const std::string &S) { /// MacroDefined - This hook is called whenever a macro definition is seen. void PrintPPOutputPPCallbacks::MacroDefined(const Token &MacroNameTok, - const MacroInfo *MI) { + const MacroDirective *MD) { + const MacroInfo *MI = MD->getInfo(); // Only print out macro definitions in -dD mode. if (!DumpDefines || // Ignore __FILE__ etc. @@ -329,7 +330,7 @@ void PrintPPOutputPPCallbacks::MacroDefined(const Token &MacroNameTok, } void PrintPPOutputPPCallbacks::MacroUndefined(const Token &MacroNameTok, - const MacroInfo *MI) { + const MacroDirective *MD) { // Only print out macro definitions in -dD mode. if (!DumpDefines) return; |