Fix a bug in globalopt due to the recent cast patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32042 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-11-30 17:26:08 +00:00
parent 96839be87f
commit 9a989f0f97

View File

@ -1713,7 +1713,8 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal,
getVal(Values, SI->getOperand(0)),
getVal(Values, SI->getOperand(1)));
} else if (CastInst *CI = dyn_cast<CastInst>(CurInst)) {
InstResult = ConstantExpr::getCast(getVal(Values, CI->getOperand(0)),
InstResult = ConstantExpr::getCast(CI->getOpcode(),
getVal(Values, CI->getOperand(0)),
CI->getType());
} else if (SelectInst *SI = dyn_cast<SelectInst>(CurInst)) {
InstResult = ConstantExpr::getSelect(getVal(Values, SI->getOperand(0)),