[llvm-commits] [llvm] r165541 - in /llvm/trunk: include/llvm/Attributes.h lib/VMCore/Attributes.cpp
Bill Wendling
isanbard at gmail.com
Tue Oct 9 13:28:54 PDT 2012
Author: void
Date: Tue Oct 9 15:28:54 2012
New Revision: 165541
URL: http://llvm.org/viewvc/llvm-project?rev=165541&view=rev
Log:
Use appropriate method calls to get the alignment value.
Modified:
llvm/trunk/include/llvm/Attributes.h
llvm/trunk/lib/VMCore/Attributes.cpp
Modified: llvm/trunk/include/llvm/Attributes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Attributes.h?rev=165541&r1=165540&r2=165541&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Attributes.h (original)
+++ llvm/trunk/include/llvm/Attributes.h Tue Oct 9 15:28:54 2012
@@ -334,8 +334,7 @@
// 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;
}
Modified: llvm/trunk/lib/VMCore/Attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Attributes.cpp?rev=165541&r1=165540&r2=165541&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Attributes.cpp (original)
+++ llvm/trunk/lib/VMCore/Attributes.cpp Tue Oct 9 15:28:54 2012
@@ -245,13 +245,14 @@
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 @@
}
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 {
More information about the llvm-commits
mailing list