[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

@@ -42,42 +42,42 @@ TEST(SourceLoc, AssignExpr) {
SourceLoc start = C.Ctx.SourceMgr.getLocForBufferStart(bufferID);
auto destBase = new (C.Ctx) UnresolvedDeclRefExpr(
C.Ctx.getIdentifier("aa"),
DeclNameRef_(C.Ctx.getIdentifier("aa")),
DeclRefKind::Ordinary,
DeclNameLoc(start));
auto dest = new (C.Ctx) UnresolvedDotExpr(
destBase,
start.getAdvancedLoc(2),
C.Ctx.getIdentifier("bb"),
DeclNameRef_(C.Ctx.getIdentifier("bb")),
DeclNameLoc(start.getAdvancedLoc(3)),
/*implicit*/false);
auto destImplicit = new (C.Ctx) UnresolvedDotExpr(
destBase,
start.getAdvancedLoc(2),
C.Ctx.getIdentifier("bb"),
DeclNameRef_(C.Ctx.getIdentifier("bb")),
DeclNameLoc(start.getAdvancedLoc(3)),
/*implicit*/true);
auto sourceBase = new (C.Ctx) UnresolvedDeclRefExpr(
C.Ctx.getIdentifier("cc"),
DeclNameRef_(C.Ctx.getIdentifier("cc")),
DeclRefKind::Ordinary,
DeclNameLoc(start.getAdvancedLoc(8)));
auto source = new (C.Ctx) UnresolvedDotExpr(
sourceBase,
start.getAdvancedLoc(10),
C.Ctx.getIdentifier("dd"),
DeclNameRef_(C.Ctx.getIdentifier("dd")),
DeclNameLoc(start.getAdvancedLoc(11)),
/*implicit*/false);
auto sourceImplicit = new (C.Ctx) UnresolvedDotExpr(
sourceBase,
start.getAdvancedLoc(10),
C.Ctx.getIdentifier("dd"),
DeclNameRef_(C.Ctx.getIdentifier("dd")),
DeclNameLoc(start.getAdvancedLoc(11)),
/*implicit*/true);
auto invalid = new (C.Ctx) UnresolvedDeclRefExpr(
C.Ctx.getIdentifier("invalid"),
DeclNameRef_(C.Ctx.getIdentifier("invalid")),
DeclRefKind::Ordinary,
DeclNameLoc());
@@ -223,22 +223,22 @@ TEST(SourceLoc, TupleExpr) {
SourceLoc start = C.Ctx.SourceMgr.getLocForBufferStart(bufferID);
auto one = new (C.Ctx) UnresolvedDeclRefExpr(
C.Ctx.getIdentifier("one"),
DeclNameRef_(C.Ctx.getIdentifier("one")),
DeclRefKind::Ordinary,
DeclNameLoc(start));
auto two = new (C.Ctx) UnresolvedDeclRefExpr(
C.Ctx.getIdentifier("two"),
DeclNameRef_(C.Ctx.getIdentifier("two")),
DeclRefKind::Ordinary,
DeclNameLoc());
auto three = new (C.Ctx) UnresolvedDeclRefExpr(
C.Ctx.getIdentifier("three"),
DeclNameRef_(C.Ctx.getIdentifier("three")),
DeclRefKind::Ordinary,
DeclNameLoc());
auto four = new (C.Ctx) UnresolvedDeclRefExpr(
C.Ctx.getIdentifier("four"),
DeclNameRef_(C.Ctx.getIdentifier("four")),
DeclRefKind::Ordinary,
DeclNameLoc(start.getAdvancedLoc(4)));