mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	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:
		@@ -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;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
  
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user