1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Yet more fixes for constant expr shifts

llvm-svn: 9739
This commit is contained in:
Chris Lattner 2003-11-05 20:43:58 +00:00
parent dba798775b
commit a8d3699eb3

View File

@ -82,6 +82,12 @@ Value *MapValue(const Value *V, std::map<const Value*, Value*> &VM) {
for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i)
Idx.push_back(cast<Constant>(MapValue(CE->getOperand(i), VM)));
return VMSlot = ConstantExpr::getGetElementPtr(MV, Idx);
} else if (CE->getOpcode() == Instruction::Shl ||
CE->getOpcode() == Instruction::Shr) {
assert(CE->getNumOperands() == 2 && "Must be a shift!");
Constant *MV1 = cast<Constant>(MapValue(CE->getOperand(0), VM));
Constant *MV2 = cast<Constant>(MapValue(CE->getOperand(1), VM));
return VMSlot = ConstantExpr::getShift(CE->getOpcode(), MV1, MV2);
} else {
assert(CE->getNumOperands() == 2 && "Must be binary operator?");
Constant *MV1 = cast<Constant>(MapValue(CE->getOperand(0), VM));