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 | fead64be9b9f5d8700bd4705efcb36194fbbb147 (patch) | |
tree | 85d5319bb5ae43e5f3e4ef1e0d0214f2700490e8 /clang/lib/Frontend/PrintPreprocessedOutput.cpp | |
parent | ecd77a98f0e82a697c81be6d945cc81ebcba7f9b (diff) | |
download | bcm5719-llvm-fead64be9b9f5d8700bd4705efcb36194fbbb147.tar.gz bcm5719-llvm-fead64be9b9f5d8700bd4705efcb36194fbbb147.zip |
[preprocessor] Use MacroDirective in the preprocessor callbacks to make available the
full information about the macro (e.g if it was imported and where).
llvm-svn: 175978
Diffstat (limited to 'clang/lib/Frontend/PrintPreprocessedOutput.cpp')
-rw-r--r-- | clang/lib/Frontend/PrintPreprocessedOutput.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp index 3d55adceff9..58bbfd3f8af 100644 --- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/clang/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; |