mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Update to use the predicate methods to query if an attribute exists.
llvm-svn: 165163
This commit is contained in:
parent
3ffafc2d33
commit
f6d9d90ee2
@ -1227,9 +1227,9 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
||||
ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
|
||||
|
||||
const Function *F = I.getParent()->getParent();
|
||||
if (F->paramHasAttr(0, Attribute::SExt))
|
||||
if (F->getRetAttributes().hasSExtAttr())
|
||||
ExtendKind = ISD::SIGN_EXTEND;
|
||||
else if (F->paramHasAttr(0, Attribute::ZExt))
|
||||
else if (F->getRetAttributes().hasZExtAttr())
|
||||
ExtendKind = ISD::ZERO_EXTEND;
|
||||
|
||||
if (ExtendKind != ISD::ANY_EXTEND && VT.isInteger())
|
||||
@ -1244,7 +1244,7 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
||||
|
||||
// 'inreg' on function refers to return value
|
||||
ISD::ArgFlagsTy Flags = ISD::ArgFlagsTy();
|
||||
if (F->paramHasAttr(0, Attribute::InReg))
|
||||
if (F->getRetAttributes().hasInRegAttr())
|
||||
Flags.setInReg();
|
||||
|
||||
// Propagate extension type if any
|
||||
@ -5342,12 +5342,12 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
|
||||
Entry.Node = ArgNode; Entry.Ty = V->getType();
|
||||
|
||||
unsigned attrInd = i - CS.arg_begin() + 1;
|
||||
Entry.isSExt = CS.paramHasAttr(attrInd, Attribute::SExt);
|
||||
Entry.isZExt = CS.paramHasAttr(attrInd, Attribute::ZExt);
|
||||
Entry.isInReg = CS.paramHasAttr(attrInd, Attribute::InReg);
|
||||
Entry.isSRet = CS.paramHasAttr(attrInd, Attribute::StructRet);
|
||||
Entry.isNest = CS.paramHasAttr(attrInd, Attribute::Nest);
|
||||
Entry.isByVal = CS.paramHasAttr(attrInd, Attribute::ByVal);
|
||||
Entry.isSExt = CS.paramHasSExtAttr(attrInd);
|
||||
Entry.isZExt = CS.paramHasZExtAttr(attrInd);
|
||||
Entry.isInReg = CS.paramHasInRegAttr(attrInd);
|
||||
Entry.isSRet = CS.paramHasStructRetAttr(attrInd);
|
||||
Entry.isNest = CS.paramHasNestAttr(attrInd);
|
||||
Entry.isByVal = CS.paramHasByValAttr(attrInd);
|
||||
Entry.Alignment = CS.getParamAlignment(attrInd);
|
||||
Args.push_back(Entry);
|
||||
}
|
||||
@ -6700,15 +6700,15 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
|
||||
unsigned OriginalAlignment =
|
||||
TD->getABITypeAlignment(ArgTy);
|
||||
|
||||
if (F.paramHasAttr(Idx, Attribute::ZExt))
|
||||
if (F.getParamAttributes(Idx).hasZExtAttr())
|
||||
Flags.setZExt();
|
||||
if (F.paramHasAttr(Idx, Attribute::SExt))
|
||||
if (F.getParamAttributes(Idx).hasSExtAttr())
|
||||
Flags.setSExt();
|
||||
if (F.paramHasAttr(Idx, Attribute::InReg))
|
||||
if (F.getParamAttributes(Idx).hasInRegAttr())
|
||||
Flags.setInReg();
|
||||
if (F.paramHasAttr(Idx, Attribute::StructRet))
|
||||
if (F.getParamAttributes(Idx).hasStructRetAttr())
|
||||
Flags.setSRet();
|
||||
if (F.paramHasAttr(Idx, Attribute::ByVal)) {
|
||||
if (F.getParamAttributes(Idx).hasByValAttr()) {
|
||||
Flags.setByVal();
|
||||
PointerType *Ty = cast<PointerType>(I->getType());
|
||||
Type *ElementTy = Ty->getElementType();
|
||||
@ -6722,7 +6722,7 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
|
||||
FrameAlign = TLI.getByValTypeAlignment(ElementTy);
|
||||
Flags.setByValAlign(FrameAlign);
|
||||
}
|
||||
if (F.paramHasAttr(Idx, Attribute::Nest))
|
||||
if (F.getParamAttributes(Idx).hasNestAttr())
|
||||
Flags.setNest();
|
||||
Flags.setOrigAlign(OriginalAlignment);
|
||||
|
||||
@ -6809,9 +6809,9 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
|
||||
|
||||
if (!I->use_empty()) {
|
||||
ISD::NodeType AssertOp = ISD::DELETED_NODE;
|
||||
if (F.paramHasAttr(Idx, Attribute::SExt))
|
||||
if (F.getParamAttributes(Idx).hasSExtAttr())
|
||||
AssertOp = ISD::AssertSext;
|
||||
else if (F.paramHasAttr(Idx, Attribute::ZExt))
|
||||
else if (F.getParamAttributes(Idx).hasZExtAttr())
|
||||
AssertOp = ISD::AssertZext;
|
||||
|
||||
ArgValues.push_back(getCopyFromParts(DAG, dl, &InVals[i],
|
||||
|
Loading…
Reference in New Issue
Block a user