1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Avoid extra calls to MD->getNumOperands()

llvm-svn: 94618
This commit is contained in:
Victor Hernandez 2010-01-26 23:29:09 +00:00
parent 0849122522
commit 4e7937f77b

View File

@ -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());
}