File tree Expand file tree Collapse file tree 3 files changed +367
-322
lines changed Expand file tree Collapse file tree 3 files changed +367
-322
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,11 @@ class ConstraintLocator : public llvm::FoldingSetNode {
191191 bool isClosureResult () const {
192192 return getKind () == PathElementKind::ClosureResult;
193193 }
194+
195+ void dump (raw_ostream &out) const LLVM_ATTRIBUTE_USED;
196+ SWIFT_DEBUG_DUMP {
197+ dump (llvm::errs ());
198+ }
194199 };
195200
196201 // / Return the summary flags for an entire path.
@@ -1256,6 +1261,12 @@ class ConstraintLocatorBuilder {
12561261
12571262 return None;
12581263 }
1264+
1265+ // / Produce a debugging dump of this locator.
1266+ SWIFT_DEBUG_DUMPER (dump(SourceManager *SM));
1267+ SWIFT_DEBUG_DUMPER (dump(ConstraintSystem *CS));
1268+
1269+ void dump (SourceManager *SM, raw_ostream &OS) const LLVM_ATTRIBUTE_USED;
12591270};
12601271
12611272} // end namespace constraints
Original file line number Diff line number Diff line change @@ -109,7 +109,9 @@ void ASTNode::walk(ASTWalker &Walker) {
109109}
110110
111111void ASTNode::dump (raw_ostream &OS, unsigned Indent) const {
112- if (auto S = dyn_cast<Stmt*>())
112+ if (isNull ())
113+ OS << " (null)" ;
114+ else if (auto S = dyn_cast<Stmt*>())
113115 S->dump (OS, /* context=*/ nullptr , Indent);
114116 else if (auto E = dyn_cast<Expr*>())
115117 E->dump (OS, Indent);
You can’t perform that action at this time.
0 commit comments