diff --git a/lib/Analysis/ScopedNoAliasAA.cpp b/lib/Analysis/ScopedNoAliasAA.cpp index ee79f881f6c..bd4451420b6 100644 --- a/lib/Analysis/ScopedNoAliasAA.cpp +++ b/lib/Analysis/ScopedNoAliasAA.cpp @@ -131,8 +131,8 @@ ModRefInfo ScopedNoAliasAAResult::getModRefInfo(ImmutableCallSite CS1, void ScopedNoAliasAAResult::collectMDInDomain( const MDNode *List, const MDNode *Domain, SmallPtrSetImpl &Nodes) const { - for (unsigned i = 0, ie = List->getNumOperands(); i != ie; ++i) - if (const MDNode *MD = dyn_cast(List->getOperand(i))) + for (const MDOperand &MDOp : List->operands()) + if (const MDNode *MD = dyn_cast(MDOp)) if (AliasScopeNode(MD).getDomain() == Domain) Nodes.insert(MD); } @@ -144,8 +144,8 @@ bool ScopedNoAliasAAResult::mayAliasInScopes(const MDNode *Scopes, // Collect the set of scope domains relevant to the noalias scopes. SmallPtrSet Domains; - for (unsigned i = 0, ie = NoAlias->getNumOperands(); i != ie; ++i) - if (const MDNode *NAMD = dyn_cast(NoAlias->getOperand(i))) + for (const MDOperand &MDOp : NoAlias->operands()) + if (const MDNode *NAMD = dyn_cast(MDOp)) if (const MDNode *Domain = AliasScopeNode(NAMD).getDomain()) Domains.insert(Domain);