summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-23 23:00:05 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-23 23:00:05 +0000
commit6442a974b71e1533c41d55478ac58fd35d63391b (patch)
tree29f7d95504b2ae992f2b0a1332140c208542b007 /llvm/lib/IR/Attributes.cpp
parent8ec343ccb14d7c61b85104afe93c1a97b23c69e9 (diff)
downloadbcm5719-llvm-6442a974b71e1533c41d55478ac58fd35d63391b.tar.gz
bcm5719-llvm-6442a974b71e1533c41d55478ac58fd35d63391b.zip
Push down the conversion of the alignment from the bit mask to a real number into the attribute implementation class.
llvm-svn: 173304
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 37cd3fbb911..94615da6d05 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -73,7 +73,7 @@ bool Attribute::hasAttributes() const {
unsigned Attribute::getAlignment() const {
if (!hasAttribute(Attribute::Alignment))
return 0;
- return 1U << ((pImpl->getAlignment() >> 16) - 1);
+ return pImpl->getAlignment();
}
/// This returns the stack alignment field of an attribute as a byte alignment
@@ -81,7 +81,7 @@ unsigned Attribute::getAlignment() const {
unsigned Attribute::getStackAlignment() const {
if (!hasAttribute(Attribute::StackAlignment))
return 0;
- return 1U << ((pImpl->getStackAlignment() >> 26) - 1);
+ return pImpl->getStackAlignment();
}
bool Attribute::operator==(AttrKind K) const {
@@ -491,11 +491,13 @@ bool AttributeImpl::hasAttributes() const {
}
uint64_t AttributeImpl::getAlignment() const {
- return Raw() & getAttrMask(Attribute::Alignment);
+ uint64_t Mask = Raw() & getAttrMask(Attribute::Alignment);
+ return 1U << ((Mask >> 16) - 1);
}
uint64_t AttributeImpl::getStackAlignment() const {
- return Raw() & getAttrMask(Attribute::StackAlignment);
+ uint64_t Mask = Raw() & getAttrMask(Attribute::StackAlignment);
+ return 1U << ((Mask >> 26) - 1);
}
void AttributeImpl::Profile(FoldingSetNodeID &ID, Constant *Data,
OpenPOWER on IntegriCloud