Remove use of ConstantExpr::getShift

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10792 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2004-01-12 19:10:58 +00:00
parent b16689b647
commit c6646ebdb9
5 changed files with 1 additions and 28 deletions

View File

@ -74,16 +74,13 @@ Constant *llvm::ConstantFoldInstruction(Instruction *I) {
case 0: return 0;
}
if (isa<BinaryOperator>(I))
if (isa<BinaryOperator>(I) || isa<ShiftInst>(I))
return ConstantExpr::get(I->getOpcode(), Op0, Op1);
switch (I->getOpcode()) {
default: return 0;
case Instruction::Cast:
return ConstantExpr::getCast(Op0, I->getType());
case Instruction::Shl:
case Instruction::Shr:
return ConstantExpr::getShift(I->getOpcode(), Op0, Op1);
case Instruction::GetElementPtr:
std::vector<Constant*> IdxList;
IdxList.reserve(I->getNumOperands()-1);