Skip to content

Commit 0b57ca6

Browse files
committed
[CS] Use dumpAnchor in SolverTrail::Change::dump
Resolve a couple of FIXMEs by using `dumpAnchor` to dump a couple of ASTNodes. This uses the same compact representation as used in ConstraintLocator dumping.
1 parent 9c04fd8 commit 0b57ca6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

lib/Sema/CSTrail.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,8 @@ void SolverTrail::Change::dump(llvm::raw_ostream &out,
570570

571571
out.indent(indent);
572572

573+
auto &ctx = cs.getASTContext();
574+
auto &SM = ctx.SourceMgr;
573575
switch (Kind) {
574576

575577
#define LOCATOR_CHANGE(Name, _) \
@@ -695,10 +697,9 @@ void SolverTrail::Change::dump(llvm::raw_ostream &out,
695697
break;
696698

697699
case ChangeKind::RecordedPackElementExpansion:
698-
// FIXME: Print short form of PackExpansionExpr
699700
out << "(RecordedPackElementExpansion ";
700-
simple_display(out, TheElement);
701-
out << "\n";
701+
dumpAnchor(TheElement, &SM, out);
702+
out << ")\n";
702703
break;
703704

704705
case ChangeKind::RecordedNodeType:
@@ -730,8 +731,9 @@ void SolverTrail::Change::dump(llvm::raw_ostream &out,
730731
break;
731732

732733
case ChangeKind::RecordedContextualInfo:
733-
// FIXME: Print short form of ASTNode
734-
out << "(RecordedContextualInfo)\n";
734+
out << "(RecordedContextualInfo ";
735+
dumpAnchor(Node.Node, &SM, out);
736+
out << ")\n";
735737
break;
736738

737739
case ChangeKind::RecordedTarget:
@@ -741,8 +743,9 @@ void SolverTrail::Change::dump(llvm::raw_ostream &out,
741743
break;
742744

743745
case ChangeKind::RecordedCaseLabelItemInfo:
744-
// FIXME: Print something here
745-
out << "(RecordedCaseLabelItemInfo)\n";
746+
out << "(RecordedCaseLabelItemInfo ";
747+
dumpAnchor(TheItem, &SM, out);
748+
out << ")\n";
746749
break;
747750

748751
case ChangeKind::RecordedPotentialThrowSite:

0 commit comments

Comments
 (0)