summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker
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
commit93bde9cbf7bd831f6161c91f6fd6ff454a9dfa50 (patch)
treea60e22d84025ea52742d7f47acbdbd9489443580 /llvm/lib/Linker
parent823a00a8b59b46fc51a9aa39ad25496637dbb0e5 (diff)
downloadbcm5719-llvm-93bde9cbf7bd831f6161c91f6fd6ff454a9dfa50.tar.gz
bcm5719-llvm-93bde9cbf7bd831f6161c91f6fd6ff454a9dfa50.zip
add support for ConstantPacked to the linker
llvm-svn: 25467
Diffstat (limited to 'llvm/lib/Linker')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index 732fdf919e3..8295418cd7f 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud