From faf8fa566493a3aefb18f784cf706aae6a1e569f Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 3 Sep 2009 20:35:57 +0000 Subject: 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 --- lib/Linker/LinkModules.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib/Linker/LinkModules.cpp') diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 0fa97c5568..00bb55e953 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -395,14 +395,8 @@ static Value *RemapOperand(const Value *In, assert(!isa(CPV) && "Unmapped global?"); llvm_unreachable("Unknown type of derived type constant value!"); } - } else if (const MDNode *N = dyn_cast(In)) { - std::vector 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(In)) { - Result = MDString::get(Context, MDS->getString()); + } else if (isa(In)) { + Result = const_cast(In); } else if (isa(In)) { Result = const_cast(In); } -- cgit v1.2.3-18-g5258