return pImpl != A.pImpl;
}
- uint64_t Raw() const;
+ uint64_t getBitMask() const;
/// \brief Which attributes cannot be applied to a type.
static Attribute typeIncompatible(Type *Ty);
public:
AttrBuilder() : Bits(0) {}
explicit AttrBuilder(uint64_t B) : Bits(B) {}
- AttrBuilder(const Attribute &A) : Bits(A.Raw()) {}
+ AttrBuilder(const Attribute &A) : Bits(A.getBitMask()) {}
void clear() { Bits = 0; }
.removeAttribute(Attribute::NoDuplicate);
}
- uint64_t Raw() const { return Bits; }
+ uint64_t getBitMask() const { return Bits; }
bool operator==(const AttrBuilder &B) {
return Bits == B.Bits;
uint64_t getAlignment() const;
uint64_t getStackAlignment() const;
- uint64_t Raw() const; // FIXME: Remove.
+ uint64_t getBitMask() const; // FIXME: Remove.
static uint64_t getAttrMask(uint64_t Val);
}
static void Profile(FoldingSetNodeID &ID, ArrayRef<AttributeWithIndex> Attrs){
for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
- ID.AddInteger(Attrs[i].Attrs.Raw());
+ ID.AddInteger(Attrs[i].Attrs.getBitMask());
ID.AddInteger(Attrs[i].Index);
}
}
// Otherwise, build a key to look up the existing attributes.
LLVMContextImpl *pImpl = Context.pImpl;
FoldingSetNodeID ID;
- ID.AddInteger(B.Raw());
+ ID.AddInteger(B.getBitMask());
void *InsertPoint;
AttributeImpl *PA = pImpl->AttrsSet.FindNodeOrInsertPos(ID, InsertPoint);
if (!PA) {
// If we didn't find any existing attributes of the same shape then create a
// new one and insert it.
- PA = new AttributeImpl(Context, B.Raw());
+ PA = new AttributeImpl(Context, B.getBitMask());
pImpl->AttrsSet.InsertNode(PA, InsertPoint);
}
return 1U << ((pImpl->getStackAlignment() >> 26) - 1);
}
-uint64_t Attribute::Raw() const {
- return pImpl ? pImpl->Raw() : 0;
+uint64_t Attribute::getBitMask() const {
+ return pImpl ? pImpl->getBitMask() : 0;
}
Attribute Attribute::typeIncompatible(Type *Ty) {
// Store the alignment in the bitcode as a 16-bit raw value instead of a 5-bit
// log2 encoded value. Shift the bits above the alignment up by 11 bits.
- uint64_t EncodedAttrs = Attrs.Raw() & 0xffff;
+ uint64_t EncodedAttrs = Attrs.getBitMask() & 0xffff;
if (Attrs.hasAttribute(Attribute::Alignment))
EncodedAttrs |= Attrs.getAlignment() << 16;
- EncodedAttrs |= (Attrs.Raw() & (0xffffULL << 21)) << 11;
+ EncodedAttrs |= (Attrs.getBitMask() & (0xffffULL << 21)) << 11;
return EncodedAttrs;
}
}
AttrBuilder &AttrBuilder::addAttributes(const Attribute &A) {
- Bits |= A.Raw();
+ Bits |= A.getBitMask();
return *this;
}
AttrBuilder &AttrBuilder::removeAttributes(const Attribute &A){
- Bits &= ~A.Raw();
+ Bits &= ~A.getBitMask();
return *this;
}
return Bits != 0;
}
bool AttrBuilder::hasAttributes(const Attribute &A) const {
- return Bits & A.Raw();
+ return Bits & A.getBitMask();
}
bool AttrBuilder::hasAlignmentAttr() const {
return Bits & AttributeImpl::getAttrMask(Attribute::Alignment);
Data = ConstantInt::get(Type::getInt64Ty(C), data);
}
-uint64_t AttributeImpl::Raw() const {
+uint64_t AttributeImpl::getBitMask() const {
return cast<ConstantInt>(Data)->getZExtValue();
}
}
bool AttributeImpl::hasAttribute(uint64_t A) const {
- return (Raw() & getAttrMask(A)) != 0;
+ return (getBitMask() & getAttrMask(A)) != 0;
}
bool AttributeImpl::hasAttributes() const {
- return Raw() != 0;
+ return getBitMask() != 0;
}
bool AttributeImpl::hasAttributes(const Attribute &A) const {
- return Raw() & A.Raw(); // FIXME: Raw() won't work here in the future.
+ // FIXME: getBitMask() won't work here in the future.
+ return getBitMask() & A.getBitMask();
}
uint64_t AttributeImpl::getAlignment() const {
- return Raw() & getAttrMask(Attribute::Alignment);
+ return getBitMask() & getAttrMask(Attribute::Alignment);
}
uint64_t AttributeImpl::getStackAlignment() const {
- return Raw() & getAttrMask(Attribute::StackAlignment);
+ return getBitMask() & getAttrMask(Attribute::StackAlignment);
}
void AttributeImpl::Profile(FoldingSetNodeID &ID, Constant *Data) {