Skip to content

Commit 0f09485

Browse files
committed
[region-isolation] Clean up some code now that SILBasicBlock::{dump,print}ID are in front of NDEBUG.
(cherry picked from commit 226e97a)
1 parent cfaa12b commit 0f09485

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

lib/SILOptimizer/Analysis/RegionAnalysis.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,7 +2351,7 @@ class PartitionOpTranslator {
23512351
REGIONBASEDISOLATION_LOG(
23522352
llvm::dbgs() << SEP_STR << "Compiling basic block for function "
23532353
<< basicBlock->getFunction()->getName() << ": ";
2354-
basicBlock->dumpID(); llvm::dbgs() << SEP_STR;
2354+
basicBlock->printID(llvm::dbgs()); llvm::dbgs() << SEP_STR;
23552355
basicBlock->print(llvm::dbgs());
23562356
llvm::dbgs() << SEP_STR << "Results:\n";);
23572357
// Translate each SIL instruction to the PartitionOps that it represents if
@@ -3342,12 +3342,7 @@ bool BlockPartitionState::recomputeExitFromEntry(
33423342
void BlockPartitionState::print(llvm::raw_ostream &os) const {
33433343
os << SEP_STR << "BlockPartitionState[needsUpdate=" << needsUpdate
33443344
<< "]\nid: ";
3345-
#ifndef NDEBUG
3346-
auto printID = [&](SILBasicBlock *block) { block->printID(os); };
3347-
#else
3348-
auto printID = [&](SILBasicBlock *) { os << "NOASSERTS. "; };
3349-
#endif
3350-
printID(basicBlock);
3345+
basicBlock->printID(os);
33513346
os << "entry partition: ";
33523347
entryPartition.print(os);
33533348
os << "exit partition: ";
@@ -3360,12 +3355,12 @@ void BlockPartitionState::print(llvm::raw_ostream &os) const {
33603355
os << "└──────────╼\nSuccs:\n";
33613356
for (auto succ : basicBlock->getSuccessorBlocks()) {
33623357
os << "";
3363-
printID(succ);
3358+
succ->printID(os);
33643359
}
33653360
os << "Preds:\n";
33663361
for (auto pred : basicBlock->getPredecessorBlocks()) {
33673362
os << "";
3368-
printID(pred);
3363+
pred->printID(os);
33693364
}
33703365
os << SEP_STR;
33713366
}

0 commit comments

Comments
 (0)