Skip to content

Commit 813e0a5

Browse files
committed
[NFC] SILGenCleanup: Added logging.
1 parent bd19e3e commit 813e0a5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/SILOptimizer/Mandatory/SILGenCleanup.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ bool SILGenCleanup::completeOSSALifetimes(SILFunction *function) {
110110
if (!getModule()->getOptions().OSSACompleteLifetimes)
111111
return false;
112112

113+
LLVM_DEBUG(llvm::dbgs() << "Completing lifetimes in " << function->getName()
114+
<< "\n");
115+
113116
bool changed = false;
114117

115118
// Lifetimes must be completed inside out (bottom-up in the CFG).
@@ -118,20 +121,26 @@ bool SILGenCleanup::completeOSSALifetimes(SILFunction *function) {
118121
DeadEndBlocks *deb = getAnalysis<DeadEndBlocksAnalysis>()->get(function);
119122
OSSALifetimeCompletion completion(function, /*DomInfo*/ nullptr, *deb);
120123
for (auto *block : postOrder->getPostOrder()) {
124+
LLVM_DEBUG(llvm::dbgs()
125+
<< "Completing lifetimes in bb" << block->getDebugID() << "\n");
121126
for (SILInstruction &inst : reverse(*block)) {
122127
for (auto result : inst.getResults()) {
128+
LLVM_DEBUG(llvm::dbgs() << "completing " << result << "\n");
123129
if (completion.completeOSSALifetime(
124130
result, OSSALifetimeCompletion::Boundary::Availability) ==
125131
LifetimeCompletion::WasCompleted) {
132+
LLVM_DEBUG(llvm::dbgs() << "\tcompleted!\n");
126133
changed = true;
127134
}
128135
}
129136
}
130137
for (SILArgument *arg : block->getArguments()) {
138+
LLVM_DEBUG(llvm::dbgs() << "completing " << *arg << "\n");
131139
assert(!arg->isReborrow() && "reborrows not legal at this SIL stage");
132140
if (completion.completeOSSALifetime(
133141
arg, OSSALifetimeCompletion::Boundary::Availability) ==
134142
LifetimeCompletion::WasCompleted) {
143+
LLVM_DEBUG(llvm::dbgs() << "\tcompleted!\n");
135144
changed = true;
136145
}
137146
}

0 commit comments

Comments
 (0)