@@ -2019,22 +2019,6 @@ GenericValue Interpreter::getConstantExprValue (ConstantExpr *CE,
2019
2019
switch (CE->getOpcode ()) {
2020
2020
case Instruction::Trunc:
2021
2021
return executeTruncInst (CE->getOperand (0 ), CE->getType (), SF);
2022
- case Instruction::ZExt:
2023
- return executeZExtInst (CE->getOperand (0 ), CE->getType (), SF);
2024
- case Instruction::SExt:
2025
- return executeSExtInst (CE->getOperand (0 ), CE->getType (), SF);
2026
- case Instruction::FPTrunc:
2027
- return executeFPTruncInst (CE->getOperand (0 ), CE->getType (), SF);
2028
- case Instruction::FPExt:
2029
- return executeFPExtInst (CE->getOperand (0 ), CE->getType (), SF);
2030
- case Instruction::UIToFP:
2031
- return executeUIToFPInst (CE->getOperand (0 ), CE->getType (), SF);
2032
- case Instruction::SIToFP:
2033
- return executeSIToFPInst (CE->getOperand (0 ), CE->getType (), SF);
2034
- case Instruction::FPToUI:
2035
- return executeFPToUIInst (CE->getOperand (0 ), CE->getType (), SF);
2036
- case Instruction::FPToSI:
2037
- return executeFPToSIInst (CE->getOperand (0 ), CE->getType (), SF);
2038
2022
case Instruction::PtrToInt:
2039
2023
return executePtrToIntInst (CE->getOperand (0 ), CE->getType (), SF);
2040
2024
case Instruction::IntToPtr:
@@ -2050,12 +2034,7 @@ GenericValue Interpreter::getConstantExprValue (ConstantExpr *CE,
2050
2034
getOperandValue (CE->getOperand (0 ), SF),
2051
2035
getOperandValue (CE->getOperand (1 ), SF),
2052
2036
CE->getOperand (0 )->getType ());
2053
- case Instruction::Select:
2054
- return executeSelectInst (getOperandValue (CE->getOperand (0 ), SF),
2055
- getOperandValue (CE->getOperand (1 ), SF),
2056
- getOperandValue (CE->getOperand (2 ), SF),
2057
- CE->getOperand (0 )->getType ());
2058
- default :
2037
+ default :
2059
2038
break ;
2060
2039
}
2061
2040
@@ -2064,32 +2043,14 @@ GenericValue Interpreter::getConstantExprValue (ConstantExpr *CE,
2064
2043
GenericValue Op0 = getOperandValue (CE->getOperand (0 ), SF);
2065
2044
GenericValue Op1 = getOperandValue (CE->getOperand (1 ), SF);
2066
2045
GenericValue Dest;
2067
- Type * Ty = CE->getOperand (0 )->getType ();
2068
2046
switch (CE->getOpcode ()) {
2069
2047
case Instruction::Add: Dest.IntVal = Op0.IntVal + Op1.IntVal ; break ;
2070
2048
case Instruction::Sub: Dest.IntVal = Op0.IntVal - Op1.IntVal ; break ;
2071
2049
case Instruction::Mul: Dest.IntVal = Op0.IntVal * Op1.IntVal ; break ;
2072
- case Instruction::FAdd: executeFAddInst (Dest, Op0, Op1, Ty); break ;
2073
- case Instruction::FSub: executeFSubInst (Dest, Op0, Op1, Ty); break ;
2074
- case Instruction::FMul: executeFMulInst (Dest, Op0, Op1, Ty); break ;
2075
- case Instruction::FDiv: executeFDivInst (Dest, Op0, Op1, Ty); break ;
2076
- case Instruction::FRem: executeFRemInst (Dest, Op0, Op1, Ty); break ;
2077
- case Instruction::SDiv: Dest.IntVal = Op0.IntVal .sdiv (Op1.IntVal ); break ;
2078
- case Instruction::UDiv: Dest.IntVal = Op0.IntVal .udiv (Op1.IntVal ); break ;
2079
- case Instruction::URem: Dest.IntVal = Op0.IntVal .urem (Op1.IntVal ); break ;
2080
- case Instruction::SRem: Dest.IntVal = Op0.IntVal .srem (Op1.IntVal ); break ;
2081
- case Instruction::And: Dest.IntVal = Op0.IntVal & Op1.IntVal ; break ;
2082
- case Instruction::Or: Dest.IntVal = Op0.IntVal | Op1.IntVal ; break ;
2083
2050
case Instruction::Xor: Dest.IntVal = Op0.IntVal ^ Op1.IntVal ; break ;
2084
2051
case Instruction::Shl:
2085
2052
Dest.IntVal = Op0.IntVal .shl (Op1.IntVal .getZExtValue ());
2086
2053
break ;
2087
- case Instruction::LShr:
2088
- Dest.IntVal = Op0.IntVal .lshr (Op1.IntVal .getZExtValue ());
2089
- break ;
2090
- case Instruction::AShr:
2091
- Dest.IntVal = Op0.IntVal .ashr (Op1.IntVal .getZExtValue ());
2092
- break ;
2093
2054
default :
2094
2055
dbgs () << " Unhandled ConstantExpr: " << *CE << " \n " ;
2095
2056
llvm_unreachable (" Unhandled ConstantExpr" );
0 commit comments