Skip to content

Commit 6f931ca

Browse files
committed
Add some debugging dump() support, NFC.
1 parent bed0f2f commit 6f931ca

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lib/Sema/CSDiag.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,11 @@ namespace {
11641164
return funcTy->getResult();
11651165
return Type();
11661166
}
1167+
1168+
void dump() const {
1169+
decl->dumpRef(llvm::errs());
1170+
llvm::errs() << " - uncurry level " << level << "\n";
1171+
}
11671172
};
11681173

11691174

@@ -1217,11 +1222,23 @@ namespace {
12171222
void suggestPotentialOverloads(SourceLoc loc, bool isCallExpr = false,
12181223
bool isResult = false);
12191224

1225+
void dump() const LLVM_ATTRIBUTE_USED;
1226+
12201227
private:
12211228
void collectCalleeCandidates(Expr *fnExpr);
12221229
};
12231230
}
12241231

1232+
void CalleeCandidateInfo::dump() const {
1233+
llvm::errs() << "CalleeCandidateInfo for '" << declName << "': closeness="
1234+
<< unsigned(closeness) << "\n";
1235+
llvm::errs() << candidates.size() << " candidates:\n";
1236+
for (auto c : candidates) {
1237+
llvm::errs() << " ";
1238+
c.dump();
1239+
}
1240+
}
1241+
12251242

12261243
/// Given a candidate list, this computes the narrowest closeness to the match
12271244
/// we're looking for and filters out any worse matches. The predicate

0 commit comments

Comments
 (0)