diff options
Diffstat (limited to 'lib/Target/Alpha')
-rw-r--r-- | lib/Target/Alpha/AlphaISelLowering.cpp | 14 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaISelLowering.h | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/Target/Alpha/AlphaISelLowering.cpp b/lib/Target/Alpha/AlphaISelLowering.cpp index 774dad3e44..028f885103 100644 --- a/lib/Target/Alpha/AlphaISelLowering.cpp +++ b/lib/Target/Alpha/AlphaISelLowering.cpp @@ -319,7 +319,7 @@ static SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG) { std::pair<SDOperand, SDOperand> AlphaTargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, - bool RetTyIsSigned, bool isVarArg, + bool RetSExt, bool RetZExt, bool isVarArg, unsigned CallingConv, bool isTailCall, SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG) { @@ -378,8 +378,16 @@ AlphaTargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, SDOperand RetVal = TheCall; if (RetTyVT != ActualRetTyVT) { - RetVal = DAG.getNode(RetTyIsSigned ? ISD::AssertSext : ISD::AssertZext, - MVT::i64, RetVal, DAG.getValueType(RetTyVT)); + ISD::NodeType AssertKind = ISD::DELETED_NODE; + if (RetSExt) + AssertKind = ISD::AssertSext; + else if (RetZExt) + AssertKind = ISD::AssertZext; + + if (AssertKind != ISD::DELETED_NODE) + RetVal = DAG.getNode(AssertKind, MVT::i64, RetVal, + DAG.getValueType(RetTyVT)); + RetVal = DAG.getNode(ISD::TRUNCATE, RetTyVT, RetVal); } diff --git a/lib/Target/Alpha/AlphaISelLowering.h b/lib/Target/Alpha/AlphaISelLowering.h index e0b4b70b94..a118d99462 100644 --- a/lib/Target/Alpha/AlphaISelLowering.h +++ b/lib/Target/Alpha/AlphaISelLowering.h @@ -77,7 +77,7 @@ namespace llvm { /// LowerCallTo - This hook lowers an abstract call to a function into an /// actual call. virtual std::pair<SDOperand, SDOperand> - LowerCallTo(SDOperand Chain, const Type *RetTy, bool RetTyIsSigned, + LowerCallTo(SDOperand Chain, const Type *RetTy, bool RetSExt, bool RetZExt, bool isVarArg, unsigned CC, bool isTailCall, SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG); |