Move more methods out-of-line. This is in preparation for changing the internal

contents of the Attributes class over to an AttributesImpl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165373 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2012-10-07 08:55:05 +00:00
parent f93c55a392
commit b10c88f175
2 changed files with 41 additions and 26 deletions

View File

@@ -28,6 +28,9 @@ using namespace llvm;
// Attribute Function Definitions
//===----------------------------------------------------------------------===//
bool Attributes::hasAttributes(const Attributes &A) const {
return Bits & A.Bits;
}
bool Attributes::hasAddressSafetyAttr() const {
return Bits & Attribute::AddressSafety_i;
}
@@ -125,6 +128,31 @@ unsigned Attributes::getStackAlignment() const {
return 1U << (((Bits & Attribute::StackAlignment_i) >> 26) - 1);
}
bool Attributes::isEmptyOrSingleton() const {
return (Bits & (Bits - 1)) == 0;
}
Attributes Attributes::operator | (const Attributes &Attrs) const {
return Attributes(Bits | Attrs.Bits);
}
Attributes Attributes::operator & (const Attributes &Attrs) const {
return Attributes(Bits & Attrs.Bits);
}
Attributes Attributes::operator ^ (const Attributes &Attrs) const {
return Attributes(Bits ^ Attrs.Bits);
}
Attributes &Attributes::operator |= (const Attributes &Attrs) {
Bits |= Attrs.Bits;
return *this;
}
Attributes &Attributes::operator &= (const Attributes &Attrs) {
Bits &= Attrs.Bits;
return *this;
}
Attributes Attributes::operator ~ () const {
return Attributes(~Bits);
}
Attributes Attributes::typeIncompatible(Type *Ty) {
Attributes::Builder Incompatible;