diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-10-10 07:36:45 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-10-10 07:36:45 +0000 |
commit | 7d2f2496c1d263eecdc104fd72e847a31d8695b9 (patch) | |
tree | 0856e94cc2c0479da200b426cf81c14abf96e650 /lib/VMCore | |
parent | 8a8cf9617cdc735f0425e828bb7a6f401c0cf0f6 (diff) | |
download | external_llvm-7d2f2496c1d263eecdc104fd72e847a31d8695b9.zip external_llvm-7d2f2496c1d263eecdc104fd72e847a31d8695b9.tar.gz external_llvm-7d2f2496c1d263eecdc104fd72e847a31d8695b9.tar.bz2 |
Remove the final bits of Attributes being declared in the Attribute
namespace. Use the attribute's enum value instead. No functionality change
intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Attributes.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp index 88f20e9..90a7c7e 100644 --- a/lib/VMCore/Attributes.cpp +++ b/lib/VMCore/Attributes.cpp @@ -238,6 +238,10 @@ void Attributes::Builder::removeAttributes(const Attributes &A) { Bits &= ~A.Raw(); } +bool Attributes::Builder::hasAttribute(Attributes::AttrVal A) const { + return Bits & AttributesImpl::getAttrMask(A); +} + bool Attributes::Builder::hasAttributes() const { return Bits != 0; } @@ -255,6 +259,13 @@ uint64_t Attributes::Builder::getAlignment() const { (((Bits & AttributesImpl::getAttrMask(Attributes::Alignment)) >> 16) - 1); } +uint64_t Attributes::Builder::getStackAlignment() const { + if (!hasAlignmentAttr()) + return 0; + return 1U << + (((Bits & AttributesImpl::getAttrMask(Attributes::StackAlignment))>>26)-1); +} + //===----------------------------------------------------------------------===// // AttributeImpl Definition //===----------------------------------------------------------------------===// @@ -468,12 +479,12 @@ Attributes AttrListPtr::getAttributes(unsigned Idx) const { /// hasAttrSomewhere - Return true if the specified attribute is set for at /// least one parameter or for the return value. -bool AttrListPtr::hasAttrSomewhere(Attributes Attr) const { +bool AttrListPtr::hasAttrSomewhere(Attributes::AttrVal Attr) const { if (AttrList == 0) return false; - + const SmallVector<AttributeWithIndex, 4> &Attrs = AttrList->Attrs; for (unsigned i = 0, e = Attrs.size(); i != e; ++i) - if (Attrs[i].Attrs.hasAttributes(Attr)) + if (Attrs[i].Attrs.hasAttribute(Attr)) return true; return false; } |