diff options
| author | Victor Hernandez <vhernandez@apple.com> | 2010-01-27 22:03:03 +0000 |
|---|---|---|
| committer | Victor Hernandez <vhernandez@apple.com> | 2010-01-27 22:03:03 +0000 |
| commit | 7fb0c1b88e934867091615e39ac693a52a2e472f (patch) | |
| tree | 53ef68dcab2e36ad271342a55706f925e628d935 /llvm/lib | |
| parent | 7577e948e4f751960179f0e6b2cc5b8c8013cd83 (diff) | |
| download | bcm5719-llvm-7fb0c1b88e934867091615e39ac693a52a2e472f.tar.gz bcm5719-llvm-7fb0c1b88e934867091615e39ac693a52a2e472f.zip | |
Need to recurse for all operands of function-local metadata; and handle Instructions (which map to themselves)
llvm-svn: 94691
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index 86f3b84f1d7..279c4bec357 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -395,16 +395,13 @@ static Value *RemapOperand(const Value *In, } else if (const MDNode *MD = dyn_cast<MDNode>(In)) { if (MD->isFunctionLocal()) { SmallVector<Value*, 4> Elts; - for (unsigned i = 0, e = MD->getNumOperands(); i != e; ++i) { - Value *Op = MD->getOperand(i); - // LinkFunctionBody() already handled non-argument values. - Elts.push_back(isa<Argument>(Op) ? RemapOperand(Op, ValueMap) : Op); - } + for (unsigned i = 0, e = MD->getNumOperands(); i != e; ++i) + Elts.push_back(RemapOperand(MD->getOperand(i), ValueMap)); Result = MDNode::get(In->getContext(), Elts.data(), MD->getNumOperands()); } else { Result = const_cast<Value*>(In); } - } else if (isa<MDString>(In) || isa<InlineAsm>(In)) { + } else if (isa<MDString>(In) || isa<InlineAsm>(In) || isa<Instruction>(In)) { Result = const_cast<Value*>(In); } |

