aboutsummaryrefslogtreecommitdiff
path: root/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Linker/LinkModules.cpp')
-rw-r--r--lib/Linker/LinkModules.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index ccab2de7eb..3aec864c2d 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -395,6 +395,14 @@ 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<InlineAsm>(In)) {
Result = const_cast<Value*>(In);
}