Skip to content

Commit

Permalink
[BOLT] Fix SCTC again again.
Browse files Browse the repository at this point in the history
Summary: I put the const_cast<BinaryFunction *>(this) on the wrong version of getBasicBlockAfter().  It's on the right one now.

(cherry picked from FBD5159127)
  • Loading branch information
Bill Nell authored and maksfb committed May 31, 2017
1 parent 6c32079 commit 9b190cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bolt/BinaryFunction.h
Expand Up @@ -967,6 +967,12 @@ class BinaryFunction {
/// nullptr the last basic block is given.
const BinaryBasicBlock *getBasicBlockAfter(const BinaryBasicBlock *BB,
bool IgnoreSplits = true) const {
return
const_cast<BinaryFunction *>(this)->getBasicBlockAfter(BB, IgnoreSplits);
}

BinaryBasicBlock *getBasicBlockAfter(const BinaryBasicBlock *BB,
bool IgnoreSplits = true) {
for (auto I = layout_begin(), E = layout_end(); I != E; ++I) {
auto Next = std::next(I);
if (*I == BB && Next != E) {
Expand All @@ -977,12 +983,6 @@ class BinaryFunction {
return nullptr;
}

BinaryBasicBlock *getBasicBlockAfter(const BinaryBasicBlock *BB,
bool IgnoreSplits = true) {
return
const_cast<BinaryFunction *>(this)->getBasicBlockAfter(BB, IgnoreSplits);
}

/// Retrieve the landing pad BB associated with invoke instruction \p Invoke
/// that is in \p BB. Return nullptr if none exists
BinaryBasicBlock *getLandingPadBBFor(const BinaryBasicBlock &BB,
Expand Down

0 comments on commit 9b190cc

Please sign in to comment.