[NFC] Thread DeclNameRef through most of the compiler

This huge commit contains as many of the mechanical changes as possible.
This commit is contained in:
Brent Royal-Gordon
2019-12-10 19:46:10 -08:00
parent da88512eda
commit addbe3e5ed
66 changed files with 505 additions and 464 deletions

View File

@@ -80,7 +80,8 @@ private:
typeExpr->setImplicit();
auto memberRef = new (ctx) UnresolvedDotExpr(
typeExpr, loc, fnName, DeclNameLoc(loc), /*implicit=*/true);
typeExpr, loc, DeclNameRef_(fnName), DeclNameLoc(loc),
/*implicit=*/true);
SourceLoc openLoc = args.empty() ? loc : args.front()->getStartLoc();
SourceLoc closeLoc = args.empty() ? loc : args.back()->getEndLoc();
Expr *result = CallExpr::create(ctx, memberRef, openLoc, args,
@@ -450,7 +451,7 @@ public:
auto optionalTypeExpr =
TypeExpr::createImplicitHack(loc, optionalType, ctx);
auto someRef = new (ctx) UnresolvedDotExpr(
optionalTypeExpr, loc, ctx.getIdentifier("some"),
optionalTypeExpr, loc, DeclNameRef_(ctx.getIdentifier("some")),
DeclNameLoc(loc), /*implicit=*/true);
return CallExpr::createImplicit(ctx, someRef, arg, { });
}
@@ -462,7 +463,7 @@ public:
auto optionalTypeExpr =
TypeExpr::createImplicitHack(endLoc, optionalType, ctx);
return new (ctx) UnresolvedDotExpr(
optionalTypeExpr, endLoc, ctx.getIdentifier("none"),
optionalTypeExpr, endLoc, DeclNameRef_(ctx.getIdentifier("none")),
DeclNameLoc(endLoc), /*implicit=*/true);
}