mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
Linker should not remap null operands of metadata
llvm-svn: 95468
This commit is contained in:
parent
e65222a748
commit
157da4b794
@ -395,8 +395,12 @@ 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)
|
||||
for (unsigned i = 0, e = MD->getNumOperands(); i != e; ++i) {
|
||||
if (MD->getOperand(i))
|
||||
Elts.push_back(RemapOperand(MD->getOperand(i), ValueMap));
|
||||
else
|
||||
Elts.push_back(NULL);
|
||||
}
|
||||
Result = MDNode::get(In->getContext(), Elts.data(), MD->getNumOperands());
|
||||
} else {
|
||||
Result = const_cast<Value*>(In);
|
||||
|
Loading…
x
Reference in New Issue
Block a user