[llvm-commits] CVS: llvm/lib/Transforms/Utils/Linker.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Mar 30 20:59:00 PST 2004
Changes in directory llvm/lib/Transforms/Utils:
Linker.cpp updated: 1.68 -> 1.69
---
Log message:
Fix linking of constant expr casts due to type resolution changes. With
this and the other patches 253.perlbmk links again.
---
Diffs of the changes: (+8 -0)
Index: llvm/lib/Transforms/Utils/Linker.cpp
diff -u llvm/lib/Transforms/Utils/Linker.cpp:1.68 llvm/lib/Transforms/Utils/Linker.cpp:1.69
--- llvm/lib/Transforms/Utils/Linker.cpp:1.68 Tue Feb 17 15:56:04 2004
+++ llvm/lib/Transforms/Utils/Linker.cpp Tue Mar 30 20:58:28 2004
@@ -325,6 +325,14 @@
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);
More information about the llvm-commits
mailing list