Skip to content

Commit 16d192f

Browse files
committed
---
yaml --- r: 349088 b: refs/heads/master c: 33afd0e h: refs/heads/master
1 parent b44ac4d commit 16d192f

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 07c0e2a00f874a29e62dd08d6836a3e2a73733ee
2+
refs/heads/master: 33afd0eb2bb7825623cc3c66f90aed3438154390
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/SIL/MemoryLifetime.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222

2323
namespace swift {
2424

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+
2535
/// The MemoryLocations utility provides functions to analyze memory locations.
2636
///
2737
/// Memory locations are limited to addresses which are guaranteed to

trunk/lib/SIL/MemoryLifetime.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,28 @@ llvm::cl::opt<bool> DontAbortOnMemoryLifetimeErrors(
2828
llvm::cl::desc("Don't abort compliation if the memory lifetime checker "
2929
"detects an error."));
3030

31-
namespace swift {
32-
namespace {
33-
34-
//===----------------------------------------------------------------------===//
35-
// Utility functions
36-
//===----------------------------------------------------------------------===//
37-
3831
/// 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) {
4133
const char *separator = "";
4234
OS << '[';
4335
for (int idx = bits.find_first(); idx >= 0; idx = bits.find_next(idx)) {
4436
OS << separator << idx;
4537
separator = ",";
4638
}
4739
OS << ']';
48-
return OS;
4940
}
5041

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+
5153
/// Enlarge the bitset if needed to set the bit with \p idx.
5254
static void setBitAndResize(SmallBitVector &bits, unsigned idx) {
5355
if (bits.size() <= idx)
@@ -240,10 +242,6 @@ void MemoryLocations::dump() const {
240242
}
241243
}
242244

243-
void MemoryLocations::dumpBits(const Bits &bits) {
244-
llvm::errs() << bits << '\n';
245-
}
246-
247245
void MemoryLocations::clear() {
248246
locations.clear();
249247
addr2LocIdx.clear();

0 commit comments

Comments
 (0)