summaryrefslogtreecommitdiff
path: root/lib/VMCore/Attributes.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-09-20 15:20:36 +0000
committerBill Wendling <isanbard@gmail.com>2012-09-20 15:20:36 +0000
commit342cea9a0a6990b03b82b95174fc5ac0ec6f61e1 (patch)
treeb90e4e6e867110dbb787064518af32b70aa5c1d7 /lib/VMCore/Attributes.cpp
parentc1611d8d103c7c4704ab6e375e08a88d20fe3684 (diff)
downloadllvm-342cea9a0a6990b03b82b95174fc5ac0ec6f61e1.tar.gz
llvm-342cea9a0a6990b03b82b95174fc5ac0ec6f61e1.tar.bz2
llvm-342cea9a0a6990b03b82b95174fc5ac0ec6f61e1.tar.xz
Remove more bare uses of the different Attribute enums.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164307 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Attributes.cpp')
-rw-r--r--lib/VMCore/Attributes.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp
index 6047d4b9f0..3a87da44dd 100644
--- a/lib/VMCore/Attributes.cpp
+++ b/lib/VMCore/Attributes.cpp
@@ -78,12 +78,12 @@ std::string Attributes::getAsString() const {
Result += "nonlazybind ";
if (hasAddressSafetyAttr())
Result += "address_safety ";
- if (*this & Attribute::StackAlignment) { // FIXME
+ if (hasStackAlignmentAttr()) {
Result += "alignstack(";
Result += utostr(Attribute::getStackAlignmentFromAttrs(*this));
Result += ") ";
}
- if (*this & Attribute::Alignment) { // FIXME
+ if (hasAlignmentAttr()) {
Result += "align ";
Result += utostr(Attribute::getAlignmentFromAttrs(*this));
Result += " ";
@@ -263,7 +263,7 @@ bool AttrListPtr::hasAttrSomewhere(Attributes Attr) const {
const SmallVector<AttributeWithIndex, 4> &Attrs = AttrList->Attrs;
for (unsigned i = 0, e = Attrs.size(); i != e; ++i)
- if (Attrs[i].Attrs & Attr)
+ if (Attrs[i].Attrs.hasAttributes(Attr))
return true;
return false;
}
@@ -274,8 +274,8 @@ AttrListPtr AttrListPtr::addAttr(unsigned Idx, Attributes Attrs) const {
#ifndef NDEBUG
// FIXME it is not obvious how this should work for alignment.
// For now, say we can't change a known alignment.
- Attributes OldAlign = OldAttrs & Attribute::Alignment;
- Attributes NewAlign = Attrs & Attribute::Alignment;
+ unsigned OldAlign = Attribute::getAlignmentFromAttrs(OldAttrs);
+ unsigned NewAlign = Attribute::getAlignmentFromAttrs(Attrs);
assert((!OldAlign || !NewAlign || OldAlign == NewAlign) &&
"Attempt to change alignment!");
#endif
@@ -314,7 +314,7 @@ AttrListPtr AttrListPtr::removeAttr(unsigned Idx, Attributes Attrs) const {
#ifndef NDEBUG
// FIXME it is not obvious how this should work for alignment.
// For now, say we can't pass in alignment, which no current use does.
- assert(!(Attrs & Attribute::Alignment) && "Attempt to exclude alignment!");
+ assert(!Attrs.hasAlignmentAttr() && "Attempt to exclude alignment!");
#endif
if (AttrList == 0) return AttrListPtr();