Skip to content

Commit b8ea5e7

Browse files
committed
[ResultBuilders] Print type-checked function body in debug mode
1 parent 65126b7 commit b8ea5e7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/Sema/BuilderTransform.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,16 @@ Optional<BraceStmt *> TypeChecker::applyResultBuilderBodyTransform(
17291729
solutions.front(),
17301730
SolutionApplicationTarget(func))) {
17311731
performSyntacticDiagnosticsForTarget(*result, /*isExprStmt*/ false);
1732-
return result->getFunctionBody();
1732+
auto *body = result->getFunctionBody();
1733+
1734+
if (cs.isDebugMode()) {
1735+
auto &log = llvm::errs();
1736+
log << "--- Type-checked function body ---\n";
1737+
body->dump(log);
1738+
log << '\n';
1739+
}
1740+
1741+
return body;
17331742
}
17341743

17351744
return nullptr;

0 commit comments

Comments
 (0)