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 | 1438102576b94d6dac9bb18e8df291c4d632572d (patch) | |
tree | 14280dc10c5b1e18b2919928111db85dedbef29e /lib/Linker | |
parent | 4b2f08a3a91f3d0fa42f2df96c5a5814af065c39 (diff) | |
download | external_llvm-1438102576b94d6dac9bb18e8df291c4d632572d.zip external_llvm-1438102576b94d6dac9bb18e8df291c4d632572d.tar.gz external_llvm-1438102576b94d6dac9bb18e8df291c4d632572d.tar.bz2 |
Fix linking of constant expr casts due to type resolution changes. With
this and the other patches 253.perlbmk links again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12565 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r-- | lib/Linker/LinkModules.cpp | 8 |
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); |