Skip to content

Commit ab80919

Browse files
committed
[NFC] add SinkAddressProjections::dump()
1 parent ca4b0a1 commit ab80919

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

include/swift/SILOptimizer/Utils/BasicBlockOptUtils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ class SinkAddressProjections {
164164
///
165165
/// getInBlockProjectionOperandValues() can be called before or after cloning.
166166
bool cloneProjections();
167+
168+
SWIFT_DEBUG_DUMP;
167169
};
168170

169171
/// Clone a single basic block and any required successor edges within the same

lib/SILOptimizer/Utils/BasicBlockOptUtils.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,16 @@ bool SinkAddressProjections::cloneProjections() {
285285
}
286286
return true;
287287
}
288+
289+
void SinkAddressProjections::dump() const {
290+
llvm::dbgs() << "Old projections: ";
291+
for (auto *proj : oldProjections) {
292+
proj->dump();
293+
}
294+
if (auto *np = newProjections) {
295+
llvm::dbgs() << "New projections: ";
296+
for (auto *proj : *np) {
297+
proj->dump();
298+
}
299+
}
300+
}

0 commit comments

Comments
 (0)