STATISTIC(NumDupBBs, "Number of duplicated blocks");
namespace {
- class IfConverter : public MachineFunctionPass {
+ class VISIBILITY_HIDDEN IfConverter : public MachineFunctionPass {
enum IfcvtKind {
ICNotClassfied, // BB data valid, but not classified.
ICSimpleFalse, // Same as ICSimple, but on the false path.
// Look for root nodes, i.e. blocks without successors.
for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
- if (I->succ_size() == 0)
+ if (I->succ_empty())
Roots.push_back(I);
std::vector<IfcvtToken*> Tokens;
: BBI.TrueBB->getNumber()) << ") ";
RetVal = IfConvertSimple(BBI, Kind);
DOUT << (RetVal ? "succeeded!" : "failed!") << "\n";
- if (RetVal)
+ if (RetVal) {
if (isFalse) NumSimpleFalse++;
else NumSimple++;
+ }
break;
}
case ICTriangle:
unsigned Size = TrueBBI.NonPredSize;
if (TrueBBI.IsBrAnalyzable) {
- if (TrueBBI.TrueBB && TrueBBI.BrCond.size() == 0)
+ if (TrueBBI.TrueBB && TrueBBI.BrCond.empty())
// End with an unconditional branch. It will be removed.
--Size;
else {
ScanInstructions(BBI);
// Unanalyable or ends with fallthrough or unconditional branch.
- if (!BBI.IsBrAnalyzable || BBI.BrCond.size() == 0) {
+ if (!BBI.IsBrAnalyzable || BBI.BrCond.empty()) {
BBI.IsBeingAnalyzed = false;
BBI.IsAnalyzed = true;
return BBI;