1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Use appropriate method calls to get the alignment value.

llvm-svn: 165541
This commit is contained in:
Bill Wendling 2012-10-09 20:28:54 +00:00
parent be73f6690c
commit fee7179aa9
2 changed files with 6 additions and 6 deletions

View File

@ -334,8 +334,7 @@ public:
// bits.
uint64_t EncodedAttrs = Attrs.Raw() & 0xffff;
if (Attrs.hasAttribute(Attributes::Alignment))
EncodedAttrs |= (1ULL << 16) <<
(((Attrs.Raw() & Attribute::Alignment_i) - 1) >> 16);
EncodedAttrs |= Attrs.getAlignment() << 16;
EncodedAttrs |= (Attrs.Raw() & (0xfffULL << 21)) << 11;
return EncodedAttrs;
}

View File

@ -245,13 +245,14 @@ bool Attributes::Builder::hasAttributes(const Attributes &A) const {
return Bits & A.Raw();
}
bool Attributes::Builder::hasAlignmentAttr() const {
return Bits & Attribute::Alignment_i;
return Bits & AttributesImpl::getAttrMask(Attributes::Alignment);
}
uint64_t Attributes::Builder::getAlignment() const {
if (!hasAlignmentAttr())
return 0;
return 1U << (((Bits & Attribute::Alignment_i) >> 16) - 1);
return 1U <<
(((Bits & AttributesImpl::getAttrMask(Attributes::Alignment)) >> 16) - 1);
}
//===----------------------------------------------------------------------===//
@ -305,11 +306,11 @@ bool AttributesImpl::hasAttributes(const Attributes &A) const {
}
uint64_t AttributesImpl::getAlignment() const {
return Bits & Attribute::Alignment_i;
return Bits & getAttrMask(Attributes::Alignment);
}
uint64_t AttributesImpl::getStackAlignment() const {
return Bits & Attribute::StackAlignment_i;
return Bits & getAttrMask(Attributes::StackAlignment);
}
bool AttributesImpl::isEmptyOrSingleton() const {