mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-24 22:40:36 +00:00
Use empty() instead of begin() == end().
llvm-svn: 54780
This commit is contained in:
parent
3bbc2deb9c
commit
027326ba3e
@ -648,6 +648,7 @@ public:
|
|||||||
typedef typename std::vector<LoopBase<BlockT>*>::const_iterator iterator;
|
typedef typename std::vector<LoopBase<BlockT>*>::const_iterator iterator;
|
||||||
iterator begin() const { return TopLevelLoops.begin(); }
|
iterator begin() const { return TopLevelLoops.begin(); }
|
||||||
iterator end() const { return TopLevelLoops.end(); }
|
iterator end() const { return TopLevelLoops.end(); }
|
||||||
|
bool empty() const { return TopLevelLoops.empty(); }
|
||||||
|
|
||||||
/// getLoopFor - Return the inner most loop that BB lives in. If a basic
|
/// getLoopFor - Return the inner most loop that BB lives in. If a basic
|
||||||
/// block is in no loop (for example the entry node), null is returned.
|
/// block is in no loop (for example the entry node), null is returned.
|
||||||
@ -947,6 +948,7 @@ public:
|
|||||||
typedef std::vector<Loop*>::const_iterator iterator;
|
typedef std::vector<Loop*>::const_iterator iterator;
|
||||||
inline iterator begin() const { return LI->begin(); }
|
inline iterator begin() const { return LI->begin(); }
|
||||||
inline iterator end() const { return LI->end(); }
|
inline iterator end() const { return LI->end(); }
|
||||||
|
bool empty() const { return LI->empty(); }
|
||||||
|
|
||||||
/// getLoopFor - Return the inner most loop that BB lives in. If a basic
|
/// getLoopFor - Return the inner most loop that BB lives in. If a basic
|
||||||
/// block is in no loop (for example the entry node), null is returned.
|
/// block is in no loop (for example the entry node), null is returned.
|
||||||
|
@ -92,6 +92,7 @@ public:
|
|||||||
typedef std::vector<MachineLoop*>::const_iterator iterator;
|
typedef std::vector<MachineLoop*>::const_iterator iterator;
|
||||||
inline iterator begin() const { return LI->begin(); }
|
inline iterator begin() const { return LI->begin(); }
|
||||||
inline iterator end() const { return LI->end(); }
|
inline iterator end() const { return LI->end(); }
|
||||||
|
bool empty() const { return LI->empty(); }
|
||||||
|
|
||||||
/// getLoopFor - Return the inner most loop that BB lives in. If a basic
|
/// getLoopFor - Return the inner most loop that BB lives in. If a basic
|
||||||
/// block is in no loop (for example the entry node), null is returned.
|
/// block is in no loop (for example the entry node), null is returned.
|
||||||
|
@ -547,7 +547,7 @@ void LiveInterval::MergeValueInAsValue(const LiveInterval &RHS,
|
|||||||
/// used with an unknown definition value.
|
/// used with an unknown definition value.
|
||||||
void LiveInterval::MergeInClobberRanges(const LiveInterval &Clobbers,
|
void LiveInterval::MergeInClobberRanges(const LiveInterval &Clobbers,
|
||||||
BumpPtrAllocator &VNInfoAllocator) {
|
BumpPtrAllocator &VNInfoAllocator) {
|
||||||
if (Clobbers.begin() == Clobbers.end()) return;
|
if (Clobbers.empty()) return;
|
||||||
|
|
||||||
// Find a value # to use for the clobber ranges. If there is already a value#
|
// Find a value # to use for the clobber ranges. If there is already a value#
|
||||||
// for unknown values, use it.
|
// for unknown values, use it.
|
||||||
|
@ -46,7 +46,7 @@ FunctionPass *llvm::createLoopAlignerPass() { return new LoopAligner(); }
|
|||||||
bool LoopAligner::runOnMachineFunction(MachineFunction &MF) {
|
bool LoopAligner::runOnMachineFunction(MachineFunction &MF) {
|
||||||
const MachineLoopInfo *MLI = &getAnalysis<MachineLoopInfo>();
|
const MachineLoopInfo *MLI = &getAnalysis<MachineLoopInfo>();
|
||||||
|
|
||||||
if (MLI->begin() == MLI->end())
|
if (MLI->empty())
|
||||||
return false; // No loops.
|
return false; // No loops.
|
||||||
|
|
||||||
const TargetLowering *TLI = MF.getTarget().getTargetLowering();
|
const TargetLowering *TLI = MF.getTarget().getTargetLowering();
|
||||||
|
@ -1852,7 +1852,7 @@ void SimpleRegisterCoalescing::joinIntervals() {
|
|||||||
JoinQueue = new JoinPriorityQueue<CopyRecSort>(this);
|
JoinQueue = new JoinPriorityQueue<CopyRecSort>(this);
|
||||||
|
|
||||||
std::vector<CopyRec> TryAgainList;
|
std::vector<CopyRec> TryAgainList;
|
||||||
if (loopInfo->begin() == loopInfo->end()) {
|
if (loopInfo->empty()) {
|
||||||
// If there are no loops in the function, join intervals in function order.
|
// If there are no loops in the function, join intervals in function order.
|
||||||
for (MachineFunction::iterator I = mf_->begin(), E = mf_->end();
|
for (MachineFunction::iterator I = mf_->begin(), E = mf_->end();
|
||||||
I != E; ++I)
|
I != E; ++I)
|
||||||
@ -2049,7 +2049,7 @@ SimpleRegisterCoalescing::TurnCopyIntoImpDef(MachineBasicBlock::iterator &I,
|
|||||||
CopyMI->setDesc(tii_->get(TargetInstrInfo::IMPLICIT_DEF));
|
CopyMI->setDesc(tii_->get(TargetInstrInfo::IMPLICIT_DEF));
|
||||||
for (int i = CopyMI->getNumOperands() - 1, e = 0; i > e; --i)
|
for (int i = CopyMI->getNumOperands() - 1, e = 0; i > e; --i)
|
||||||
CopyMI->RemoveOperand(i);
|
CopyMI->RemoveOperand(i);
|
||||||
bool NoUse = mri_->use_begin(SrcReg) == mri_->use_end();
|
bool NoUse = mri_->use_empty(SrcReg);
|
||||||
if (NoUse) {
|
if (NoUse) {
|
||||||
for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(SrcReg),
|
for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(SrcReg),
|
||||||
E = mri_->reg_end(); I != E; ) {
|
E = mri_->reg_end(); I != E; ) {
|
||||||
|
@ -848,7 +848,7 @@ void StrongPHIElimination::mergeLiveIntervals(unsigned primary,
|
|||||||
RHS.removeValNo(*VI);
|
RHS.removeValNo(*VI);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RHS.begin() == RHS.end())
|
if (RHS.empty())
|
||||||
LI.removeInterval(RHS.reg);
|
LI.removeInterval(RHS.reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ bool LoopExtractor::runOnFunction(Function &F) {
|
|||||||
LoopInfo &LI = getAnalysis<LoopInfo>();
|
LoopInfo &LI = getAnalysis<LoopInfo>();
|
||||||
|
|
||||||
// If this function has no loops, there is nothing to do.
|
// If this function has no loops, there is nothing to do.
|
||||||
if (LI.begin() == LI.end())
|
if (LI.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
DominatorTree &DT = getAnalysis<DominatorTree>();
|
DominatorTree &DT = getAnalysis<DominatorTree>();
|
||||||
|
@ -1006,9 +1006,9 @@ bool LoopIndexSplit::updateLoopIterationSpace(SplitInfo &SD) {
|
|||||||
|
|
||||||
// Remove split condition.
|
// Remove split condition.
|
||||||
SD.SplitCondition->eraseFromParent();
|
SD.SplitCondition->eraseFromParent();
|
||||||
if (Op0->use_begin() == Op0->use_end())
|
if (Op0->use_empty())
|
||||||
Op0->eraseFromParent();
|
Op0->eraseFromParent();
|
||||||
if (Op1->use_begin() == Op1->use_end())
|
if (Op1->use_empty())
|
||||||
Op1->eraseFromParent();
|
Op1->eraseFromParent();
|
||||||
|
|
||||||
BranchInst *ExitInsn =
|
BranchInst *ExitInsn =
|
||||||
|
@ -107,7 +107,7 @@ static bool CanPropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
|
|||||||
CommonPreds.insert(*PI);
|
CommonPreds.insert(*PI);
|
||||||
|
|
||||||
// Shortcut, if there are no common predecessors, merging is always safe
|
// Shortcut, if there are no common predecessors, merging is always safe
|
||||||
if (CommonPreds.begin() == CommonPreds.end())
|
if (CommonPreds.empty())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Look at all the phi nodes in Succ, to see if they present a conflict when
|
// Look at all the phi nodes in Succ, to see if they present a conflict when
|
||||||
|
Loading…
x
Reference in New Issue
Block a user