diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-11-05 20:37:01 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-11-05 20:37:01 +0000 | 
| commit | ba55bd37fea1fb58f846b5cc78fff0ed4d95521c (patch) | |
| tree | d6f9caa14c1621a9aff0c4c97a70b9e71bf86125 /llvm/lib/Transforms/Utils | |
| parent | 7f3327fc2c667df6d36123d8a5746de55a3ee2aa (diff) | |
| download | bcm5719-llvm-ba55bd37fea1fb58f846b5cc78fff0ed4d95521c.tar.gz bcm5719-llvm-ba55bd37fea1fb58f846b5cc78fff0ed4d95521c.zip | |
Further fixes for PR93
llvm-svn: 9738
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/Linker.cpp | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp index 98dbacc3ea7..0be840fb6cd 100644 --- a/llvm/lib/Transforms/Utils/Linker.cpp +++ b/llvm/lib/Transforms/Utils/Linker.cpp @@ -318,13 +318,19 @@ 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->getOpcode() == Instruction::Shl || +                 CE->getOpcode() == Instruction::Shr) {      // Shift +        Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap); +        Value *V2 = RemapOperand(CE->getOperand(1), LocalMap, GlobalMap); +        Result = ConstantExpr::getShift(CE->getOpcode(), cast<Constant>(V1), +                                        cast<Constant>(V2));        } else if (CE->getNumOperands() == 2) {          // Binary operator...          Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);          Value *V2 = RemapOperand(CE->getOperand(1), LocalMap, GlobalMap);          Result = ConstantExpr::get(CE->getOpcode(), cast<Constant>(V1), -                                   cast<Constant>(V2));         +                                   cast<Constant>(V2));        } else {          assert(0 && "Unknown constant expr type!");        } | 

