Skip to content

Commit

Permalink
Revert r165547 to fix build.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165548 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
isanbard committed Oct 9, 2012
1 parent f8db977 commit 9ef99c9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/VMCore/Attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,17 @@ bool Attributes::hasAttributes(const Attributes &A) const {

/// This returns the alignment field of an attribute as a byte alignment value.
unsigned Attributes::getAlignment() const {
return Attrs.getAlignment();
if (!hasAttribute(Attributes::Alignment))
return 0;
return 1U << ((Attrs.getAlignment() >> 16) - 1);
}

/// This returns the stack alignment field of an attribute as a byte alignment
/// value.
unsigned Attributes::getStackAlignment() const {
return Attrs.getStackAlignment();
if (!hasAttribute(Attributes::StackAlignment))
return 0;
return 1U << ((Attrs.getStackAlignment() >> 26) - 1);
}

bool Attributes::isEmptyOrSingleton() const {
Expand Down Expand Up @@ -245,6 +249,8 @@ bool Attributes::Builder::hasAlignmentAttr() const {
}

uint64_t Attributes::Builder::getAlignment() const {
if (!hasAlignmentAttr())
return 0;
return 1U <<
(((Bits & AttributesImpl::getAttrMask(Attributes::Alignment)) >> 16) - 1);
}
Expand Down Expand Up @@ -300,11 +306,11 @@ bool AttributesImpl::hasAttributes(const Attributes &A) const {
}

uint64_t AttributesImpl::getAlignment() const {
return 1U << (((Bits & getAttrMask(Attributes::Alignment)) >> 16) - 1);
return Bits & getAttrMask(Attributes::Alignment);
}

uint64_t AttributesImpl::getStackAlignment() const {
return 1U << (((Bits & getAttrMask(Attributes::StackAlignment)) >> 26) - 1);
return Bits & getAttrMask(Attributes::StackAlignment);
}

bool AttributesImpl::isEmptyOrSingleton() const {
Expand Down

0 comments on commit 9ef99c9

Please sign in to comment.