mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user