mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Restore previous behavior of defaulting to ZEXT. This works around two
things: (1) preventing PR1071 and (2) working around missing parameter attributes for bool type. (2) will be fixed shortly. When PR1071 is fixed, this patch should be undone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32831 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -766,17 +766,12 @@ void SelectionDAGLowering::visitRet(ReturnInst &I) {
|
|||||||
else
|
else
|
||||||
TmpVT = MVT::i32;
|
TmpVT = MVT::i32;
|
||||||
const FunctionType *FTy = I.getParent()->getParent()->getFunctionType();
|
const FunctionType *FTy = I.getParent()->getParent()->getFunctionType();
|
||||||
ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
|
ISD::NodeType ExtendKind = ISD::ZERO_EXTEND; // FIXME: ANY_EXTEND?
|
||||||
if (FTy->paramHasAttr(0, FunctionType::SExtAttribute))
|
if (FTy->paramHasAttr(0, FunctionType::SExtAttribute))
|
||||||
ExtendKind = ISD::SIGN_EXTEND;
|
ExtendKind = ISD::SIGN_EXTEND;
|
||||||
if (FTy->paramHasAttr(0, FunctionType::ZExtAttribute))
|
if (FTy->paramHasAttr(0, FunctionType::ZExtAttribute))
|
||||||
ExtendKind = ISD::ZERO_EXTEND;
|
ExtendKind = ISD::ZERO_EXTEND;
|
||||||
if (ExtendKind == ISD::ANY_EXTEND)
|
RetOp = DAG.getNode(ExtendKind, TmpVT, RetOp);
|
||||||
// There was no specification for extension in the parameter attributes
|
|
||||||
// so we will just let the legalizer do the ANY_EXTEND
|
|
||||||
;
|
|
||||||
else
|
|
||||||
RetOp = DAG.getNode(ExtendKind, TmpVT, RetOp);
|
|
||||||
}
|
}
|
||||||
NewValues.push_back(RetOp);
|
NewValues.push_back(RetOp);
|
||||||
NewValues.push_back(DAG.getConstant(false, MVT::i32));
|
NewValues.push_back(DAG.getConstant(false, MVT::i32));
|
||||||
|
Reference in New Issue
Block a user