diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-03-31 02:58:28 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-03-31 02:58:28 +0000 |
| commit | 709f03e2dd830b1d94fa2e3280b0b757eb4c4915 (patch) | |
| tree | 74838822119d3171423916ade9835fd1507d3329 /llvm | |
| parent | 467cb2bc5d9b0d4ed8e5013b6314d6da2dab54ec (diff) | |
| download | bcm5719-llvm-709f03e2dd830b1d94fa2e3280b0b757eb4c4915.tar.gz bcm5719-llvm-709f03e2dd830b1d94fa2e3280b0b757eb4c4915.zip | |
Fix linking of constant expr casts due to type resolution changes. With
this and the other patches 253.perlbmk links again.
llvm-svn: 12565
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Transforms/Utils/Linker.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp index 529fb771489..c113ca1a0ff 100644 --- a/llvm/lib/Transforms/Utils/Linker.cpp +++ b/llvm/lib/Transforms/Utils/Linker.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); |

