@@ -2055,8 +2055,7 @@ static bool shouldLowercaseValueName(StringRef name) {
20552055}
20562056
20572057// / Returns true if it is expected that the macro is ignored.
2058- static bool shouldIgnoreMacro (const clang::IdentifierInfo *identifier,
2059- const clang::MacroInfo *macro) {
2058+ static bool shouldIgnoreMacro (StringRef name, const clang::MacroInfo *macro) {
20602059 // Ignore include guards.
20612060 if (macro->isUsedForHeaderGuard ())
20622061 return true ;
@@ -2071,7 +2070,7 @@ static bool shouldIgnoreMacro(const clang::IdentifierInfo *identifier,
20712070
20722071 // Consult the blacklist of macros to suppress.
20732072 auto suppressMacro =
2074- llvm::StringSwitch<bool >(identifier-> getName () )
2073+ llvm::StringSwitch<bool >(name )
20752074#define SUPPRESS_MACRO (NAME ) .Case(#NAME, true )
20762075#include " MacroTable.def"
20772076 .Default (false );
@@ -2082,11 +2081,17 @@ static bool shouldIgnoreMacro(const clang::IdentifierInfo *identifier,
20822081 return false ;
20832082}
20842083
2084+ bool ClangImporter::shouldIgnoreMacro (StringRef Name,
2085+ const clang::MacroInfo *Macro) {
2086+ return ::shouldIgnoreMacro (Name, Macro);
2087+ }
2088+
20852089Identifier ClangImporter::Implementation::importMacroName (
20862090 const clang::IdentifierInfo *clangIdentifier,
20872091 const clang::MacroInfo *macro) {
20882092 // If we're supposed to ignore this macro, return an empty identifier.
2089- if (shouldIgnoreMacro (clangIdentifier, macro)) return Identifier ();
2093+ if (::shouldIgnoreMacro (clangIdentifier->getName (), macro))
2094+ return Identifier ();
20902095
20912096 // Import the identifier.
20922097 return importIdentifier (clangIdentifier);
0 commit comments