File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -563,7 +563,6 @@ public SwiftObjectHeader {
563
563
564
564
void printAsOperand (raw_ostream &OS, bool PrintType = true );
565
565
566
- #ifndef NDEBUG
567
566
// / Print the ID of the block, bbN.
568
567
void dumpID (bool newline = true ) const ;
569
568
@@ -572,7 +571,6 @@ public SwiftObjectHeader {
572
571
573
572
// / Print the ID of the block with \p Ctx, bbN.
574
573
void printID (SILPrintContext &Ctx, bool newline = true ) const ;
575
- #endif
576
574
577
575
// / getSublistAccess() - returns pointer to member of instruction list
578
576
static InstListType SILBasicBlock::*getSublistAccess () {
Original file line number Diff line number Diff line change @@ -3249,20 +3249,30 @@ void SILBasicBlock::print(SILPrintContext &Ctx) const {
3249
3249
SILPrinter (Ctx).print (this );
3250
3250
}
3251
3251
3252
- #ifndef NDEBUG
3253
3252
void SILBasicBlock::dumpID (bool newline) const {
3253
+ #ifndef NDEBUG
3254
3254
printID (llvm::errs (), newline);
3255
+ #else
3256
+ llvm::errs () << " NOASSERTS" << (newline ? " \n " : " " );
3257
+ #endif
3255
3258
}
3256
3259
3257
3260
void SILBasicBlock::printID (llvm::raw_ostream &OS, bool newline) const {
3261
+ #ifndef NDEBUG
3258
3262
SILPrintContext Ctx (OS);
3259
3263
printID (Ctx, newline);
3264
+ #else
3265
+ llvm::errs () << " NOASSERTS" << (newline ? " \n " : " " );
3266
+ #endif
3260
3267
}
3261
3268
3262
3269
void SILBasicBlock::printID (SILPrintContext &Ctx, bool newline) const {
3270
+ #ifndef NDEBUG
3263
3271
SILPrinter (Ctx).printID (this , newline);
3264
- }
3272
+ #else
3273
+ llvm::errs () << " NOASSERTS" << (newline ? " \n " : " " );
3265
3274
#endif
3275
+ }
3266
3276
3267
3277
// / Pretty-print the SILFunction to errs.
3268
3278
void SILFunction::dump (bool Verbose) const {
Original file line number Diff line number Diff line change @@ -2352,7 +2352,7 @@ class PartitionOpTranslator {
2352
2352
REGIONBASEDISOLATION_LOG (
2353
2353
llvm::dbgs () << SEP_STR << " Compiling basic block for function "
2354
2354
<< basicBlock->getFunction ()->getName () << " : " ;
2355
- basicBlock->dumpID ( ); llvm::dbgs () << SEP_STR;
2355
+ basicBlock->printID ( llvm::dbgs () ); llvm::dbgs () << SEP_STR;
2356
2356
basicBlock->print (llvm::dbgs ());
2357
2357
llvm::dbgs () << SEP_STR << " Results:\n " ;);
2358
2358
// Translate each SIL instruction to the PartitionOps that it represents if
@@ -3345,12 +3345,7 @@ bool BlockPartitionState::recomputeExitFromEntry(
3345
3345
void BlockPartitionState::print (llvm::raw_ostream &os) const {
3346
3346
os << SEP_STR << " BlockPartitionState[needsUpdate=" << needsUpdate
3347
3347
<< " ]\n id: " ;
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);
3354
3349
os << " entry partition: " ;
3355
3350
entryPartition.print (os);
3356
3351
os << " exit partition: " ;
@@ -3363,12 +3358,12 @@ void BlockPartitionState::print(llvm::raw_ostream &os) const {
3363
3358
os << " └──────────╼\n Succs:\n " ;
3364
3359
for (auto succ : basicBlock->getSuccessorBlocks ()) {
3365
3360
os << " →" ;
3366
- printID (succ );
3361
+ succ-> printID (os );
3367
3362
}
3368
3363
os << " Preds:\n " ;
3369
3364
for (auto pred : basicBlock->getPredecessorBlocks ()) {
3370
3365
os << " ←" ;
3371
- printID (pred );
3366
+ pred-> printID (os );
3372
3367
}
3373
3368
os << SEP_STR;
3374
3369
}
You can’t perform that action at this time.
0 commit comments