Skip to content

Commit 509d2f9

Browse files
committed
Use llvm::ListSeparator
1 parent f6f0ae6 commit 509d2f9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

clang/lib/AST/TextNodeDumper.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -730,14 +730,11 @@ void TextNodeDumper::Visit(const APValue &Value, QualType Ty) {
730730
if (Value.hasLValuePath()) {
731731
OS << ", PathLength=" << Value.getLValuePath().size();
732732
OS << ", Path=(";
733-
bool First = true;
733+
llvm::ListSeparator Sep;
734734
for (const auto &PathEntry : Value.getLValuePath()) {
735735
// We're printing all entries as array indices because don't have the
736736
// type information here to do anything else.
737-
OS << PathEntry.getAsArrayIndex();
738-
if (First && Value.getLValuePath().size() > 1)
739-
OS << ", ";
740-
First = false;
737+
OS << PathEntry.getAsArrayIndex() << Sep;
741738
}
742739
OS << ")";
743740
}

0 commit comments

Comments
 (0)