summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-07 08:55:05 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-07 08:55:05 +0000
commitb10c88f175a9aca5a56f6b258466c1b8efe643bf (patch)
tree67df7b45a4bb405248672aa846348522ed699c79 /include
parentf93c55a3920846ce1fdc7fe939e6dad1ae80989b (diff)
downloadllvm-b10c88f175a9aca5a56f6b258466c1b8efe643bf.tar.gz
llvm-b10c88f175a9aca5a56f6b258466c1b8efe643bf.tar.bz2
llvm-b10c88f175a9aca5a56f6b258466c1b8efe643bf.tar.xz
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
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Attributes.h39
1 files changed, 13 insertions, 26 deletions
diff --git a/include/llvm/Attributes.h b/include/llvm/Attributes.h
index a3d6849879..6f250285bb 100644
--- a/include/llvm/Attributes.h
+++ b/include/llvm/Attributes.h
@@ -196,10 +196,7 @@ public:
bool hasAttributes() const {
return Bits != 0;
}
- bool hasAttributes(const Attributes &A) const {
- return Bits & A.Bits;
- }
-
+ bool hasAttributes(const Attributes &A) const;
bool hasAddressSafetyAttr() const;
bool hasAlignmentAttr() const;
bool hasAlwaysInlineAttr() const;
@@ -236,9 +233,10 @@ public:
/// value.
unsigned getStackAlignment() const;
+ bool isEmptyOrSingleton() const;
+
// This is a "safe bool() operator".
operator const void *() const { return Bits ? this : 0; }
- bool isEmptyOrSingleton() const { return (Bits & (Bits - 1)) == 0; }
bool operator == (const Attributes &Attrs) const {
return Bits == Attrs.Bits;
}
@@ -246,24 +244,13 @@ public:
return Bits != Attrs.Bits;
}
- Attributes operator | (const Attributes &Attrs) const {
- return Attributes(Bits | Attrs.Bits);
- }
- Attributes operator & (const Attributes &Attrs) const {
- return Attributes(Bits & Attrs.Bits);
- }
- Attributes operator ^ (const Attributes &Attrs) const {
- return Attributes(Bits ^ Attrs.Bits);
- }
- Attributes &operator |= (const Attributes &Attrs) {
- Bits |= Attrs.Bits;
- return *this;
- }
- Attributes &operator &= (const Attributes &Attrs) {
- Bits &= Attrs.Bits;
- return *this;
- }
- Attributes operator ~ () const { return Attributes(~Bits); }
+ Attributes operator | (const Attributes &Attrs) const;
+ Attributes operator & (const Attributes &Attrs) const;
+ Attributes operator ^ (const Attributes &Attrs) const;
+ Attributes &operator |= (const Attributes &Attrs);
+ Attributes &operator &= (const Attributes &Attrs);
+ Attributes operator ~ () const;
+
uint64_t Raw() const { return Bits; }
/// constructAlignmentFromInt - This turns an int alignment (a power of 2,
@@ -307,11 +294,11 @@ public:
// 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.Bits & 0xffff;
+ uint64_t EncodedAttrs = Attrs.Raw() & 0xffff;
if (Attrs.hasAlignmentAttr())
EncodedAttrs |= (1ULL << 16) <<
- (((Attrs.Bits & Attribute::Alignment_i) - 1) >> 16);
- EncodedAttrs |= (Attrs.Bits & (0xfffULL << 21)) << 11;
+ (((Attrs.Raw() & Attribute::Alignment_i) - 1) >> 16);
+ EncodedAttrs |= (Attrs.Raw() & (0xfffULL << 21)) << 11;
return EncodedAttrs;
}