Skip to content

Commit 66e34b7

Browse files
author
Amritpan Kaur
committed
[CSBindings] Print the specific atomic ExprKind in place of LiteralBindingKind::Atom.
1 parent 0b9312d commit 66e34b7

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,9 +1648,17 @@ void BindingSet::dump(llvm::raw_ostream &out, unsigned indent) const {
16481648
attributes.push_back("subtype_of_existential");
16491649
auto literalKind = getLiteralKind();
16501650
if (literalKind != LiteralBindingKind::None) {
1651-
auto literalAttrStr = ("[literal: " + getLiteralBindingKind(literalKind)
1652-
+ "]").str();
1653-
attributes.push_back(literalAttrStr);
1651+
std::string literalAttrStr;
1652+
literalAttrStr.append("[literal: ");
1653+
if (literalKind == LiteralBindingKind::Atom) {
1654+
if (auto atomKind = TypeVar->getImpl().getAtomicLiteralKind()) {
1655+
literalAttrStr.append(getAtomLiteralAsString(*atomKind));
1656+
}
1657+
} else {
1658+
literalAttrStr.append(getLiteralBindingKind(literalKind).str());
1659+
}
1660+
literalAttrStr.append("]");
1661+
attributes.push_back(std::move(literalAttrStr));
16541662
}
16551663
if (!attributes.empty()) {
16561664
out << "[attributes: ";

0 commit comments

Comments
 (0)