Skip to content

Commit 01c4f7d

Browse files
committed
[ConstraintSystem] ConstraintLocator: Implement printing of decl anchors
(cherry picked from commit 38a6d88)
1 parent 38b5a8b commit 01c4f7d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7985,6 +7985,16 @@ void constraints::dumpAnchor(ASTNode anchor, SourceManager *SM,
79857985
out << '@';
79867986
pattern->getLoc().print(out, *SM);
79877987
}
7988+
} else if (auto *decl = anchor.dyn_cast<Decl *>()) {
7989+
if (auto *VD = dyn_cast<ValueDecl>(decl)) {
7990+
VD->dumpRef(out);
7991+
} else {
7992+
out << "<<" << Decl::getKindName(decl->getKind()) << ">>";
7993+
if (SM) {
7994+
out << "@";
7995+
decl->getLoc().print(out, *SM);
7996+
}
7997+
}
79887998
}
79897999
// TODO(diagnostics): Implement the rest of the cases.
79908000
}

0 commit comments

Comments
 (0)