aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Linker
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Linker')
-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 529fb77..c113ca1 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -325,6 +325,14 @@ static Value *RemapOperand(const Value *In,
assert(CE->getOpcode() == Instruction::Cast);
Value *V = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
Result = ConstantExpr::getCast(cast<Constant>(V), CE->getType());
+ } else if (CE->getNumOperands() == 3) {
+ // Select instruction
+ assert(CE->getOpcode() == Instruction::Select);
+ Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
+ Value *V2 = RemapOperand(CE->getOperand(1), LocalMap, GlobalMap);
+ Value *V3 = RemapOperand(CE->getOperand(2), LocalMap, GlobalMap);
+ Result = ConstantExpr::getSelect(cast<Constant>(V1), cast<Constant>(V2),
+ cast<Constant>(V3));
} else if (CE->getNumOperands() == 2) {
// Binary operator...
Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);