File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -8767,10 +8767,13 @@ template <typename BaseTy> class CastBranchInstBase : public BaseTy {
8767
8767
8768
8768
TermInst::SuccessorListTy getSuccessors () { return DestBBs; }
8769
8769
8770
- SILBasicBlock *getSuccessBB () { return DestBBs[0 ]; }
8771
- const SILBasicBlock *getSuccessBB () const { return DestBBs[0 ]; }
8772
- SILBasicBlock *getFailureBB () { return DestBBs[1 ]; }
8773
- const SILBasicBlock *getFailureBB () const { return DestBBs[1 ]; }
8770
+ // Enumerate the successor indices
8771
+ enum SuccessorPath { SuccessIdx = 0 , FailIdx = 1 };
8772
+
8773
+ SILBasicBlock *getSuccessBB () { return DestBBs[SuccessIdx]; }
8774
+ const SILBasicBlock *getSuccessBB () const { return DestBBs[SuccessIdx]; }
8775
+ SILBasicBlock *getFailureBB () { return DestBBs[FailIdx]; }
8776
+ const SILBasicBlock *getFailureBB () const { return DestBBs[FailIdx]; }
8774
8777
8775
8778
// / The number of times the True branch was executed
8776
8779
ProfileCounter getTrueBBCount () const { return DestBBs[0 ].getCount (); }
You can’t perform that action at this time.
0 commit comments