diff options
author | Arthur Eubanks <aeubanks@google.com> | 2021-08-13 11:59:18 -0700 |
---|---|---|
committer | Arthur Eubanks <aeubanks@google.com> | 2021-08-13 11:59:18 -0700 |
commit | d7593ebaeeec2072abed73db0299a0e71f5c7a2c (patch) | |
tree | fee5ee1a588d738f99d472d3d5874ed937da7400 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | a9831cce1e7a74f507071073fcea29f81c413aac (diff) | |
download | llvm-d7593ebaeeec2072abed73db0299a0e71f5c7a2c.zip llvm-d7593ebaeeec2072abed73db0299a0e71f5c7a2c.tar.gz llvm-d7593ebaeeec2072abed73db0299a0e71f5c7a2c.tar.bz2 |
[NFC] Clean up users of AttributeList::hasAttribute()
AttributeList::hasAttribute() is confusing, use clearer methods like
hasParamAttr()/hasRetAttr().
Add hasRetAttr() since it was missing from AttributeList.
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 0786dc3..9e21a21 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -1953,16 +1953,13 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) { /*IsVarArg*/ false, DL); ISD::NodeType ExtendKind = ISD::ANY_EXTEND; - if (F->getAttributes().hasAttribute(AttributeList::ReturnIndex, - Attribute::SExt)) + if (F->getAttributes().hasRetAttr(Attribute::SExt)) ExtendKind = ISD::SIGN_EXTEND; - else if (F->getAttributes().hasAttribute(AttributeList::ReturnIndex, - Attribute::ZExt)) + else if (F->getAttributes().hasRetAttr(Attribute::ZExt)) ExtendKind = ISD::ZERO_EXTEND; LLVMContext &Context = F->getContext(); - bool RetInReg = F->getAttributes().hasAttribute( - AttributeList::ReturnIndex, Attribute::InReg); + bool RetInReg = F->getAttributes().hasRetAttr(Attribute::InReg); for (unsigned j = 0; j != NumValues; ++j) { EVT VT = ValueVTs[j]; |