Skip to content

Commit 138b33f

Browse files
committed
Re-instate awful AST dumping hack
1 parent 2e7e33d commit 138b33f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/AST/ASTDumper.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,6 +1747,11 @@ void swift::printContext(raw_ostream &os, DeclContext *dc) {
17471747
<< "autoclosure discriminator=";
17481748
}
17491749

1750+
// If we aren't printing to standard error or the debugger output stream,
1751+
// this client expects to see the computed discriminator. Compute it now.
1752+
if (&os != &llvm::errs() && &os != &llvm::dbgs())
1753+
(void)ACE->getDiscriminator();
1754+
17501755
PrintWithColorRAII(os, DiscriminatorColor) << ACE->getRawDiscriminator();
17511756
break;
17521757
}
@@ -2777,6 +2782,12 @@ class PrintExpr : public ExprVisitor<PrintExpr, void, StringRef>,
27772782
void printClosure(AbstractClosureExpr *E, char const *name,
27782783
StringRef label) {
27792784
printCommon(E, name, label);
2785+
2786+
// If we aren't printing to standard error or the debugger output stream,
2787+
// this client expects to see the computed discriminator. Compute it now.
2788+
if (hasNonStandardOutput())
2789+
(void)E->getDiscriminator();
2790+
27802791
printField(E->getRawDiscriminator(), "discriminator", DiscriminatorColor);
27812792

27822793
switch (auto isolation = E->getActorIsolation()) {

0 commit comments

Comments
 (0)