Skip to content

Commit 226e97a

Browse files
committed
[region-isolation] Clean up some code now that SILBasicBlock::{dump,print}ID are in front of NDEBUG.
1 parent 2e08d61 commit 226e97a

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
@@ -2352,7 +2352,7 @@ class PartitionOpTranslator {
23522352
REGIONBASEDISOLATION_LOG(
23532353
llvm::dbgs() << SEP_STR << "Compiling basic block for function "
23542354
<< basicBlock->getFunction()->getName() << ": ";
2355-
basicBlock->dumpID(); llvm::dbgs() << SEP_STR;
2355+
basicBlock->printID(llvm::dbgs()); llvm::dbgs() << SEP_STR;
23562356
basicBlock->print(llvm::dbgs());
23572357
llvm::dbgs() << SEP_STR << "Results:\n";);
23582358
// Translate each SIL instruction to the PartitionOps that it represents if
@@ -3345,12 +3345,7 @@ bool BlockPartitionState::recomputeExitFromEntry(
33453345
void BlockPartitionState::print(llvm::raw_ostream &os) const {
33463346
os << SEP_STR << "BlockPartitionState[needsUpdate=" << needsUpdate
33473347
<< "]\nid: ";
3348-
#ifndef NDEBUG
3349-
auto printID = [&](SILBasicBlock *block) { block->printID(os); };
3350-
#else
3351-
auto printID = [&](SILBasicBlock *) { os << "NOASSERTS. "; };
3352-
#endif
3353-
printID(basicBlock);
3348+
basicBlock->printID(os);
33543349
os << "entry partition: ";
33553350
entryPartition.print(os);
33563351
os << "exit partition: ";
@@ -3363,12 +3358,12 @@ void BlockPartitionState::print(llvm::raw_ostream &os) const {
33633358
os << "└──────────╼\nSuccs:\n";
33643359
for (auto succ : basicBlock->getSuccessorBlocks()) {
33653360
os << "";
3366-
printID(succ);
3361+
succ->printID(os);
33673362
}
33683363
os << "Preds:\n";
33693364
for (auto pred : basicBlock->getPredecessorBlocks()) {
33703365
os << "";
3371-
printID(pred);
3366+
pred->printID(os);
33723367
}
33733368
os << SEP_STR;
33743369
}

0 commit comments

Comments
 (0)