Refactor Macro Context Lookup Into a Request

This commit is contained in:
Robert Widmann
2022-10-27 00:02:41 -07:00
committed by Doug Gregor
parent 394d0645d9
commit 0fc80dc498
7 changed files with 81 additions and 90 deletions

View File

@@ -2474,7 +2474,8 @@ ConstraintSystem::getTypeOfMemberReference(
#if SWIFT_SWIFT_PARSER
Type ConstraintSystem::getTypeOfMacroReference(StringRef macroName,
Expr *anchor) {
auto macroCtx = swift::macro_context::lookup(macroName, DC);
auto req = MacroContextRequest{macroName.str(), DC->getParentModule()};
auto *macroCtx = evaluateOrDefault(getASTContext().evaluator, req, nullptr);
if (!macroCtx)
return Type();