aboutsummaryrefslogtreecommitdiff
path: root/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-04-07 01:27:42 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-04-07 01:27:42 +0000
commit39c61fd5274509f34766073f10aaa20c99068804 (patch)
treeeef9a5213396a2c83f98e811a07ce0f38f18e8f3 /lib/Linker/LinkModules.cpp
parent85c0965db1859f675158d7230fa9d0962adfc0d0 (diff)
Add code to RemapOperand() to handle Instruction::ExtractElement and
Instruction::InsertElement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27477 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker/LinkModules.cpp')
-rw-r--r--lib/Linker/LinkModules.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index aeef9e65e0..c8ea03898e 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -305,6 +305,18 @@ static Value *RemapOperand(const Value *In,
ValueMap)));
Result = ConstantExpr::getGetElementPtr(cast<Constant>(Ptr), Indices);
+ } else if (CE->getOpcode() == Instruction::ExtractElement) {
+ Value *Ptr = RemapOperand(CE->getOperand(0), ValueMap);
+ Value *Idx = RemapOperand(CE->getOperand(1), ValueMap);
+ Result = ConstantExpr::getExtractElement(cast<Constant>(Ptr),
+ cast<Constant>(Idx));
+ } else if (CE->getOpcode() == Instruction::InsertElement) {
+ Value *Ptr = RemapOperand(CE->getOperand(0), ValueMap);
+ Value *Elt = RemapOperand(CE->getOperand(1), ValueMap);
+ Value *Idx = RemapOperand(CE->getOperand(2), ValueMap);
+ Result = ConstantExpr::getInsertElement(cast<Constant>(Ptr),
+ cast<Constant>(Elt),
+ cast<Constant>(Idx));
} else if (CE->getNumOperands() == 1) {
// Cast instruction
assert(CE->getOpcode() == Instruction::Cast);