summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker
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
commit5c349b8b7d9f27343768274db47b6bb6a8c6d146 (patch)
tree734ac190cfef47ded09b8ebc1f567fadda1cc550 /llvm/lib/Linker
parentd8e1a01be6f901c17df52aef16b3505ad972b916 (diff)
downloadbcm5719-llvm-5c349b8b7d9f27343768274db47b6bb6a8c6d146.tar.gz
bcm5719-llvm-5c349b8b7d9f27343768274db47b6bb6a8c6d146.zip
Add code to RemapOperand() to handle Instruction::ExtractElement and
Instruction::InsertElement. llvm-svn: 27477
Diffstat (limited to 'llvm/lib/Linker')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index aeef9e65e02..c8ea03898e3 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud