From fead64be9b9f5d8700bd4705efcb36194fbbb147 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Sun, 24 Feb 2013 00:05:14 +0000 Subject: [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 --- clang/lib/Lex/Preprocessor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/Lex/Preprocessor.cpp') diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 8209c3c1365..af000ec1d14 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -642,10 +642,11 @@ void Preprocessor::HandleIdentifier(Token &Identifier) { } // If this is a macro to be expanded, do it. - if (MacroInfo *MI = getMacroInfo(&II)) { + if (MacroDirective *MD = getMacroDirective(&II)) { + MacroInfo *MI = MD->getInfo(); if (!DisableMacroExpansion) { if (!Identifier.isExpandDisabled() && MI->isEnabled()) { - if (!HandleMacroExpandedIdentifier(Identifier, MI)) + if (!HandleMacroExpandedIdentifier(Identifier, MD)) return; } else { // C99 6.10.3.4p2 says that a disabled macro may never again be -- cgit v1.2.3