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/Lex/PPExpressions.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/Lex/PPExpressions.cpp')
-rw-r--r-- | lib/Lex/PPExpressions.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp index 7ebf3e0072..49f4cbf71a 100644 --- a/lib/Lex/PPExpressions.cpp +++ b/lib/Lex/PPExpressions.cpp @@ -111,20 +111,20 @@ static bool EvaluateDefined(PPValue &Result, Token &PeekTok, DefinedTracker &DT, Result.Val = II->hasMacroDefinition(); Result.Val.setIsUnsigned(false); // Result is signed intmax_t. - MacroInfo *Macro = 0; + MacroDirective *Macro = 0; // If there is a macro, mark it used. if (Result.Val != 0 && ValueLive) { - Macro = PP.getMacroInfo(II); - PP.markMacroAsUsed(Macro); + Macro = PP.getMacroDirective(II); + PP.markMacroAsUsed(Macro->getInfo()); } // Invoke the 'defined' callback. if (PPCallbacks *Callbacks = PP.getPPCallbacks()) { - MacroInfo *MI = Macro; + MacroDirective *MD = Macro; // Pass the MacroInfo for the macro name even if the value is dead. - if (!MI && Result.Val != 0) - MI = PP.getMacroInfo(II); - Callbacks->Defined(PeekTok, MI); + if (!MD && Result.Val != 0) + MD = PP.getMacroDirective(II); + Callbacks->Defined(PeekTok, MD); } // If we are in parens, ensure we have a trailing ). |