[llvm-commits] [llvm] r94618 - /llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
Victor Hernandez
vhernandez at apple.com
Tue Jan 26 15:29:09 PST 2010
Author: hernande
Date: Tue Jan 26 17:29:09 2010
New Revision: 94618
URL: http://llvm.org/viewvc/llvm-project?rev=94618&view=rev
Log:
Avoid extra calls to MD->getNumOperands()
Modified:
llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=94618&r1=94617&r2=94618&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Tue Jan 26 17:29:09 2010
@@ -35,7 +35,7 @@
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());
}
More information about the llvm-commits
mailing list