Skip to content

Commit 772134e

Browse files
[StackSafety] Use ListSeparator (NFC)
1 parent 5d3f3d3 commit 772134e

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

llvm/include/llvm/Analysis/StackLifetime.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "llvm/ADT/BitVector.h"
1414
#include "llvm/ADT/DenseMap.h"
1515
#include "llvm/ADT/SmallVector.h"
16+
#include "llvm/ADT/StringExtras.h"
1617
#include "llvm/IR/IntrinsicInst.h"
1718
#include "llvm/IR/PassManager.h"
1819
#include "llvm/Support/raw_ostream.h"
@@ -168,16 +169,9 @@ class StackLifetime {
168169

169170
static inline raw_ostream &operator<<(raw_ostream &OS, const BitVector &V) {
170171
OS << "{";
171-
int Idx = V.find_first();
172-
bool First = true;
173-
while (Idx >= 0) {
174-
if (!First) {
175-
OS << ", ";
176-
}
177-
First = false;
178-
OS << Idx;
179-
Idx = V.find_next(Idx);
180-
}
172+
ListSeparator LS;
173+
for (int Idx = V.find_first(); Idx >= 0; Idx = V.find_next(Idx))
174+
OS << LS << Idx;
181175
OS << "}";
182176
return OS;
183177
}

0 commit comments

Comments
 (0)