File tree Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 22
22
23
23
namespace swift {
24
24
25
+ void printBitsAsArray (llvm::raw_ostream &OS, const SmallBitVector &bits);
26
+
27
+ inline llvm::raw_ostream &operator <<(llvm::raw_ostream &OS,
28
+ const SmallBitVector &bits) {
29
+ printBitsAsArray (OS, bits);
30
+ return OS;
31
+ }
32
+
33
+ void dumpBits (const SmallBitVector &bits);
34
+
25
35
// / The MemoryLocations utility provides functions to analyze memory locations.
26
36
// /
27
37
// / Memory locations are limited to addresses which are guaranteed to
Original file line number Diff line number Diff line change @@ -28,26 +28,28 @@ llvm::cl::opt<bool> DontAbortOnMemoryLifetimeErrors(
28
28
llvm::cl::desc (" Don't abort compliation if the memory lifetime checker "
29
29
" detects an error." ));
30
30
31
- namespace swift {
32
- namespace {
33
-
34
- // ===----------------------------------------------------------------------===//
35
- // Utility functions
36
- // ===----------------------------------------------------------------------===//
37
-
38
31
// / Debug dump a location bit vector.
39
- llvm::raw_ostream &operator <<(llvm::raw_ostream &OS,
40
- const SmallBitVector &bits) {
32
+ void swift::printBitsAsArray (llvm::raw_ostream &OS, const SmallBitVector &bits) {
41
33
const char *separator = " " ;
42
34
OS << ' [' ;
43
35
for (int idx = bits.find_first (); idx >= 0 ; idx = bits.find_next (idx)) {
44
36
OS << separator << idx;
45
37
separator = " ," ;
46
38
}
47
39
OS << ' ]' ;
48
- return OS;
49
40
}
50
41
42
+ void swift::dumpBits (const SmallBitVector &bits) {
43
+ llvm::dbgs () << bits << ' \n ' ;
44
+ }
45
+
46
+ namespace swift {
47
+ namespace {
48
+
49
+ // ===----------------------------------------------------------------------===//
50
+ // Utility functions
51
+ // ===----------------------------------------------------------------------===//
52
+
51
53
// / Enlarge the bitset if needed to set the bit with \p idx.
52
54
static void setBitAndResize (SmallBitVector &bits, unsigned idx) {
53
55
if (bits.size () <= idx)
@@ -240,10 +242,6 @@ void MemoryLocations::dump() const {
240
242
}
241
243
}
242
244
243
- void MemoryLocations::dumpBits (const Bits &bits) {
244
- llvm::errs () << bits << ' \n ' ;
245
- }
246
-
247
245
void MemoryLocations::clear () {
248
246
locations.clear ();
249
247
addr2LocIdx.clear ();
You can’t perform that action at this time.
0 commit comments