There is not any need to copy metadata while merging modules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80941 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2009-09-03 20:35:57 +00:00
parent 8d44b28bc6
commit faf8fa5664
3 changed files with 57 additions and 8 deletions

View File

@ -395,14 +395,8 @@ static Value *RemapOperand(const Value *In,
assert(!isa<GlobalValue>(CPV) && "Unmapped global?");
llvm_unreachable("Unknown type of derived type constant value!");
}
} else if (const MDNode *N = dyn_cast<MDNode>(In)) {
std::vector<Value*> Elems;
for (unsigned i = 0, e = N->getNumElements(); i !=e; ++i)
Elems.push_back(RemapOperand(N->getElement(i), ValueMap, Context));
if (!Elems.empty())
Result = MDNode::get(Context, &Elems[0], Elems.size());
} else if (const MDString *MDS = dyn_cast<MDString>(In)) {
Result = MDString::get(Context, MDS->getString());
} else if (isa<MetadataBase>(In)) {
Result = const_cast<Value*>(In);
} else if (isa<InlineAsm>(In)) {
Result = const_cast<Value*>(In);
}