mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 03:30:28 +00:00
Avoid extra calls to MD->getNumOperands()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94618 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bbba00c8fa
commit
0c81e34a54
@ -35,7 +35,7 @@ Value *llvm::MapValue(const Value *V, ValueMapTy &VM) {
|
||||
|
||||
if (const MDNode *MD = dyn_cast<MDNode>(V)) {
|
||||
SmallVector<Value*, 4> Elts;
|
||||
for (unsigned i = 0; i != MD->getNumOperands(); i++)
|
||||
for (unsigned i = 0, e = MD->getNumOperands(); i != e; ++i)
|
||||
Elts.push_back(MD->getOperand(i) ? MapValue(MD->getOperand(i), VM) : 0);
|
||||
return VM[V] = MDNode::get(V->getContext(), Elts.data(), Elts.size());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user