aboutsummaryrefslogtreecommitdiff
path: root/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-19 23:15:58 +0000
committerChris Lattner <sabre@nondot.org>2006-01-19 23:15:58 +0000
commita88eb9287eb14ba62ca6324b2b249e0ae9fe3309 (patch)
treec48b9884478736da851eb82b7b39b8a13724d0a2 /lib/Linker/LinkModules.cpp
parent485a350bedfaed5db3db16b18971a2f951e5db42 (diff)
add support for ConstantPacked to the linker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker/LinkModules.cpp')
-rw-r--r--lib/Linker/LinkModules.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index 732fdf919e..8295418cd7 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -290,6 +290,11 @@ static Value *RemapOperand(const Value *In,
Result = const_cast<Constant*>(CPV);
} else if (isa<GlobalValue>(CPV)) {
Result = cast<Constant>(RemapOperand(CPV, ValueMap));
+ } else if (const ConstantPacked *CP = dyn_cast<ConstantPacked>(CPV)) {
+ std::vector<Constant*> Operands(CP->getNumOperands());
+ for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
+ Operands[i] = cast<Constant>(RemapOperand(CP->getOperand(i), ValueMap));
+ Result = ConstantPacked::get(Operands);
} else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CPV)) {
if (CE->getOpcode() == Instruction::GetElementPtr) {
Value *Ptr = RemapOperand(CE->getOperand(0), ValueMap);