@@ -3801,12 +3801,7 @@ void ASTMangler::appendMacroExpansionContext(
38013801 outerExpansionDC = decl->getDeclContext ();
38023802 discriminator = decl->getAttachedMacroDiscriminator (role, attr);
38033803
3804- auto *macroDecl = evaluateOrDefault (
3805- ctx.evaluator ,
3806- ResolveMacroRequest{const_cast <CustomAttr *>(attr),
3807- outerExpansionDC},
3808- nullptr );
3809- if (macroDecl)
3804+ if (auto *macroDecl = decl->getResolvedMacro (attr))
38103805 baseName = macroDecl->getBaseName ();
38113806 else
38123807 baseName = ctx.getIdentifier (" __unknown_macro__" );
@@ -3885,22 +3880,18 @@ std::string ASTMangler::mangleAttachedMacroExpansion(
38853880 const Decl *decl, CustomAttr *attr, MacroRole role) {
38863881 beginMangling ();
38873882
3888- DeclContext *macroDeclContext = decl-> getDeclContext () ;
3883+ const Decl *attachedTo = decl;
38893884 if (role == MacroRole::MemberAttribute) {
38903885 appendContextOf (cast<ValueDecl>(decl));
3891- macroDeclContext = decl->getDeclContext ()->getParent ();
3886+ attachedTo = decl->getDeclContext ()->getAsDecl ();
38923887 } else if (auto valueDecl = dyn_cast<ValueDecl>(decl)) {
38933888 appendAnyDecl (valueDecl);
38943889 } else {
38953890 appendContext (decl->getDeclContext (), " " );
38963891 }
38973892
38983893 StringRef macroName;
3899- auto *macroDecl = evaluateOrDefault (
3900- decl->getASTContext ().evaluator ,
3901- ResolveMacroRequest{attr, macroDeclContext},
3902- nullptr );
3903- if (macroDecl)
3894+ if (auto *macroDecl = attachedTo->getResolvedMacro (attr))
39043895 macroName = macroDecl->getName ().getBaseName ().userFacingName ();
39053896 else
39063897 macroName = " __unknown_macro__" ;
0 commit comments