File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -516,6 +516,17 @@ public SwiftObjectHeader {
516
516
517
517
void printAsOperand (raw_ostream &OS, bool PrintType = true );
518
518
519
+ #ifndef NDEBUG
520
+ // / Print the ID of the block, bbN.
521
+ void dumpID () const ;
522
+
523
+ // / Print the ID of the block with \p OS, bbN.
524
+ void printID (llvm::raw_ostream &OS) const ;
525
+
526
+ // / Print the ID of the block with \p Ctx, bbN.
527
+ void printID (SILPrintContext &Ctx) const ;
528
+ #endif
529
+
519
530
// / getSublistAccess() - returns pointer to member of instruction list
520
531
static InstListType SILBasicBlock::*getSublistAccess () {
521
532
return &SILBasicBlock::InstList;
Original file line number Diff line number Diff line change @@ -854,6 +854,12 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
854
854
*this << ' )' ;
855
855
}
856
856
857
+ #ifndef NDEBUG
858
+ void printID (const SILBasicBlock *BB) {
859
+ *this << Ctx.getID (BB) << " \n " ;
860
+ }
861
+ #endif
862
+
857
863
void print (const SILBasicBlock *BB) {
858
864
// Output uses for BB arguments. These are put into place as comments before
859
865
// the block header.
@@ -3086,6 +3092,21 @@ void SILBasicBlock::print(SILPrintContext &Ctx) const {
3086
3092
SILPrinter (Ctx).print (this );
3087
3093
}
3088
3094
3095
+ #ifndef NDEBUG
3096
+ void SILBasicBlock::dumpID () const {
3097
+ printID (llvm::errs ());
3098
+ }
3099
+
3100
+ void SILBasicBlock::printID (llvm::raw_ostream &OS) const {
3101
+ SILPrintContext Ctx (OS);
3102
+ printID (Ctx);
3103
+ }
3104
+
3105
+ void SILBasicBlock::printID (SILPrintContext &Ctx) const {
3106
+ SILPrinter (Ctx).printID (this );
3107
+ }
3108
+ #endif
3109
+
3089
3110
// / Pretty-print the SILFunction to errs.
3090
3111
void SILFunction::dump (bool Verbose) const {
3091
3112
SILPrintContext Ctx (llvm::errs (), Verbose);
You can’t perform that action at this time.
0 commit comments