diff options
author | Dan Gohman <djg@cray.com> | 2007-10-03 19:26:29 +0000 |
---|---|---|
committer | Dan Gohman <djg@cray.com> | 2007-10-03 19:26:29 +0000 |
commit | 3f7d94b6cd40a3653c000f4b2e166c82dc3e3715 (patch) | |
tree | 3f689d854d4d36279b3aee7b018f706739fba3b4 /lib/Transforms | |
parent | 87051a79ed9cefa785380630d1fca28f5521ef1a (diff) | |
download | external_llvm-3f7d94b6cd40a3653c000f4b2e166c82dc3e3715.tar.gz external_llvm-3f7d94b6cd40a3653c000f4b2e166c82dc3e3715.tar.bz2 external_llvm-3f7d94b6cd40a3653c000f4b2e166c82dc3e3715.zip |
Use empty() member functions when that's what's being tested for instead
of comparing begin() and end().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42585 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/IPO/Inliner.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/IPO/RaiseAllocations.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Scalar/LICM.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Scalar/SCCP.cpp | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index 85893d706f..13739a5ea2 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -63,7 +63,7 @@ static bool InlineCallIfPossible(CallSite CS, CallGraph &CG, // Remove any call graph edges from the callee to its callees. CallGraphNode *CalleeNode = CG[Callee]; - while (CalleeNode->begin() != CalleeNode->end()) + while (!CalleeNode->empty()) CalleeNode->removeCallEdgeTo((CalleeNode->end()-1)->second); // Removing the node for callee from the call graph and delete it. @@ -188,7 +188,7 @@ bool Inliner::doFinalization(CallGraph &CG) { F->use_empty()) { // Remove any call graph edges from the function to its callees. - while (CGN->begin() != CGN->end()) + while (!CGN->empty()) CGN->removeCallEdgeTo((CGN->end()-1)->second); // Remove any edges from the external node to the function's call graph diff --git a/lib/Transforms/IPO/RaiseAllocations.cpp b/lib/Transforms/IPO/RaiseAllocations.cpp index ed4a3769db..44702bc817 100644 --- a/lib/Transforms/IPO/RaiseAllocations.cpp +++ b/lib/Transforms/IPO/RaiseAllocations.cpp @@ -154,7 +154,7 @@ bool RaiseAllocations::runOnModule(Module &M) { if (Instruction *I = dyn_cast<Instruction>(U)) { CallSite CS = CallSite::get(I); - if (CS.getInstruction() && CS.arg_begin() != CS.arg_end() && + if (CS.getInstruction() && !CS.arg_empty() && (CS.getCalledFunction() == MallocFunc || std::find(EqPointers.begin(), EqPointers.end(), CS.getCalledValue()) != EqPointers.end())) { @@ -205,7 +205,7 @@ bool RaiseAllocations::runOnModule(Module &M) { if (Instruction *I = dyn_cast<Instruction>(U)) { CallSite CS = CallSite::get(I); - if (CS.getInstruction() && CS.arg_begin() != CS.arg_end() && + if (CS.getInstruction() && !CS.arg_empty() && (CS.getCalledFunction() == FreeFunc || std::find(EqPointers.begin(), EqPointers.end(), CS.getCalledValue()) != EqPointers.end())) { diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index e795aa9c0c..8a094aa967 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -786,7 +786,7 @@ void LICM::FindPromotableValuesInLoop( // volatile loads or stores. if (!AS.isForwardingAliasSet() && AS.isMod() && AS.isMustAlias() && !AS.isVolatile() && CurLoop->isLoopInvariant(AS.begin()->first)) { - assert(AS.begin() != AS.end() && + assert(!AS.empty() && "Must alias set should have at least one pointer element in it!"); Value *V = AS.begin()->first; diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index dacaad01a3..d236039332 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -1574,7 +1574,7 @@ bool IPSCCP::runOnModule(Module &M) { for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) { BasicBlock *Succ = TI->getSuccessor(i); - if (Succ->begin() != Succ->end() && isa<PHINode>(Succ->begin())) + if (!Succ->empty() && isa<PHINode>(Succ->begin())) TI->getSuccessor(i)->removePredecessor(BB); } if (!TI->use_empty()) |