mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-02 19:24:25 +00:00
Add llvm::all_of which wraps std::all_of.
This version doesn't need begin/end but can instead just take a type which has begin/end methods. Use this to replace an eligible foreach loop in LoopInfo found by David Blaikie in r237224. Reviewed by David Blaikie. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237301 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -65,11 +65,7 @@ bool Loop::isLoopInvariant(const Value *V) const {
|
||||
/// hasLoopInvariantOperands - Return true if all the operands of the
|
||||
/// specified instruction are loop invariant.
|
||||
bool Loop::hasLoopInvariantOperands(const Instruction *I) const {
|
||||
for (auto &Op : I->operands())
|
||||
if (!isLoopInvariant(Op))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return all_of(I->operands(), [this](Value *V) { return isLoopInvariant(V); });
|
||||
}
|
||||
|
||||
/// makeLoopInvariant - If the given value is an instruciton inside of the
|
||||
|
Reference in New Issue
Block a user