From e853d2e2508e21b5c3156c7d8b6e6902a7d2604a Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 19 Sep 2012 23:35:21 +0000 Subject: Add predicates for queries on whether an attribute exists. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164264 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/TargetLowering.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index dcaa9ba..56f3a45 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -996,9 +996,9 @@ void llvm::GetReturnInfo(Type* ReturnType, Attributes attr, EVT VT = ValueVTs[j]; ISD::NodeType ExtendKind = ISD::ANY_EXTEND; - if (attr & Attribute::SExt) + if (attr.hasSExtAttr()) ExtendKind = ISD::SIGN_EXTEND; - else if (attr & Attribute::ZExt) + else if (attr.hasZExtAttr()) ExtendKind = ISD::ZERO_EXTEND; // FIXME: C calling convention requires the return type to be promoted to @@ -1016,18 +1016,17 @@ void llvm::GetReturnInfo(Type* ReturnType, Attributes attr, // 'inreg' on function refers to return value ISD::ArgFlagsTy Flags = ISD::ArgFlagsTy(); - if (attr & Attribute::InReg) + if (attr.hasInRegAttr()) Flags.setInReg(); // Propagate extension type if any - if (attr & Attribute::SExt) + if (attr.hasSExtAttr()) Flags.setSExt(); - else if (attr & Attribute::ZExt) + else if (attr.hasZExtAttr()) Flags.setZExt(); - for (unsigned i = 0; i < NumParts; ++i) { + for (unsigned i = 0; i < NumParts; ++i) Outs.push_back(ISD::OutputArg(Flags, PartVT, /*isFixed=*/true)); - } } } -- cgit v1.1