Home | History | Annotate | Download | only in AST

Lines Matching full:qualifiers

105 /// Qualifiers - The collection of all-type qualifiers we support.
106 /// Clang supports five independent qualifiers:
110 class Qualifiers {
159 Qualifiers() : Mask(0) {}
161 static Qualifiers fromFastMask(unsigned Mask) {
162 Qualifiers Qs;
167 static Qualifiers fromCVRMask(unsigned CVR) {
168 Qualifiers Qs;
173 // Deserialize qualifiers from an opaque representation.
174 static Qualifiers fromOpaqueValue(unsigned opaque) {
175 Qualifiers Qs;
180 // Serialize these qualifiers into an opaque representation.
234 Qualifiers withoutObjCGCAttr() const {
235 Qualifiers qs = *this;
239 Qualifiers withoutObjCGLifetime() const {
240 Qualifiers qs = *this;
283 // Fast qualifiers are those that can be allocated directly
304 /// qualifiers which require an ExtQuals node to be allocated.
306 Qualifiers getNonFastQualifiers() const {
307 Qualifiers Quals = *this;
312 /// hasQualifiers - Return true if the set contains any qualifiers.
316 /// \brief Add the qualifiers from the given set to this set.
317 void addQualifiers(Qualifiers Q) {
318 // If the other set doesn't have any non-boolean qualifiers, just
333 /// \brief Add the qualifiers from the given set to this set, given that
335 void addConsistentQualifiers(Qualifiers qs) {
345 /// \brief Determines if these qualifiers compatibly include another set.
347 /// qualifiers can be safely used as an object with these qualifiers.
348 bool compatiblyIncludes(Qualifiers other) const {
352 // ObjC GC qualifiers can match, be added, or be removed, but can't be
356 // ObjC lifetime qualifiers must match exactly.
358 // CVR qualifiers may subset.
362 /// \brief Determines if these qualifiers compatibly include another set of
363 /// qualifiers from the narrow perspective of Objective-C ARC lifetime.
365 /// One set of Objective-C lifetime qualifiers compatibly includes the other
366 /// if the lifetime qualifiers match, or if both are non-__weak and the
368 bool compatiblyIncludesObjCLifetime(Qualifiers other) const {
378 bool isSupersetOf(Qualifiers Other) const;
380 /// \brief Determine whether this set of qualifiers is a strict superset of
381 /// another set of qualifiers, not considering qualifier compatibility.
382 bool isStrictSupersetOf(Qualifiers Other) const;
384 bool operator==(Qualifiers Other) const { return Mask == Other.Mask; }
385 bool operator!=(Qualifiers Other) const { return Mask != Other.Mask; }
389 Qualifiers &operator+=(Qualifiers R) {
396 friend Qualifiers operator+(Qualifiers L, Qualifiers R) {
401 Qualifiers &operator-=(Qualifiers R) {
407 friend Qualifiers operator-(Qualifiers L, Qualifiers R) {
450 typedef std::pair<const Type*, Qualifiers> SplitQualType;
453 /// their own: instead each reference to a type stores the qualifiers. This
462 /// indicates whether there are extended qualifiers present, in which
467 Qualifiers::FastWidth> Value;
511 /// qualifiers.
541 return (getLocalFastQualifiers() & Qualifiers::Const);
551 return (getLocalFastQualifiers() & Qualifiers::Restrict);
561 return (getLocalFastQualifiers() & Qualifiers::Volatile);
568 /// qualifiers, without looking through any typedefs that might add
569 /// qualifiers at a different level.
574 /// \brief Determine whether this type has any qualifiers.
578 /// "non-fast" qualifiers, e.g., those that are stored in an ExtQualType
584 /// \brief Retrieve the set of qualifiers local to this particular QualType
585 /// instance, not including any qualifiers acquired through typedefs or
587 Qualifiers getLocalQualifiers() const;
589 /// \brief Retrieve the set of qualifiers applied to this type.
590 Qualifiers getQualifiers() const;
592 /// \brief Retrieve the set of CVR (const-volatile-restrict) qualifiers
593 /// local to this particular QualType instance, not including any qualifiers
599 /// \brief Retrieve the set of CVR (const-volatile-restrict) qualifiers
629 addFastQualifiers(Qualifiers::Const);
632 return withFastQualifiers(Qualifiers::Const);
637 addFastQualifiers(Qualifiers::Volatile);
640 return withFastQualifiers(Qualifiers::Volatile);
648 assert(!(TQs & ~Qualifiers::FastMask)
660 assert(!(Mask & ~Qualifiers::FastMask) && "mask has non-fast qualifiers");
664 // Creates a type with the given qualifiers in addition to any
665 // qualifiers already on this type.
672 // Creates a type with exactly the given fast qualifiers, removing
673 // any existing fast qualifiers.
678 // Removes fast qualifiers, but leaves any extended qualifiers in place.
687 /// \brief Return this type with all of the instance-specific qualifiers
688 /// removed, but without removing any qualifiers that may have been applied
705 /// desugar until we hit the type \c Integer, which has no qualifiers on it.
708 /// type. To strip qualifiers even from within an array type, use
716 /// qualifiers that were built up.
719 /// type. To strip qualifiers even from within an array type, use
724 /// given type, requiring exact equality for non-CVR qualifiers.
728 /// given type, requiring exact equality for non-CVR qualifiers.
739 /// expressions of reference type) and deletes top-level cvr-qualifiers
750 /// Qualifiers are left in place.
774 /// operator==/!= - Indicate whether the specified types and qualifiers are
788 static std::string getAsString(const Type *ty, Qualifiers qs);
803 static void getAsStringInternal(const Type *ty, Qualifiers qs,
818 inline Qualifiers::GC getObjCGCAttr() const;
822 return getObjCGCAttr() == Qualifiers::Weak;
827 return getObjCGCAttr() == Qualifiers::Strong;
831 Qualifiers::ObjCLifetime getObjCLifetime() const {
852 /// conceivable that qualifiers (objc_gc(weak)?) could make
910 // Various qualifiers go in low bits.
926 /// \brief The "base" type of an extended qualifiers type (\c ExtQuals) or
942 /// type pointer, but there are many more type qualifiers that we want
945 /// store qualifiers.
947 /// The current design tags the 'const', 'restrict', and 'volatile' qualifiers
949 /// the pointer is an ExtQuals node. The extended qualifiers (address spaces,
952 // NOTE: changing the fast qualifiers should be straightforward as
954 // 1. Qualifiers:
955 // a) Modify the bitmasks (Qualifiers::TQ and DeclSpec::TQ).
956 // Fast qualifiers must occupy the low-order bits.
957 // b) Update Qualifiers::FastWidth and FastMask.
965 /// Quals - the immutable set of qualifiers applied by this
966 /// node; always contains extended qualifiers.
967 Qualifiers Quals;
972 ExtQuals(const Type *baseType, QualType canon, Qualifiers quals)
978 && "ExtQuals created with no fast qualifiers");
980 && "ExtQuals created with fast qualifiers");
983 Qualifiers getQualifiers() const { return Quals; }
986 Qualifiers::GC getObjCGCAttr() const { return Quals.getObjCGCAttr(); }
989 Qualifiers::ObjCLifetime getObjCLifetime() const {
1004 Qualifiers Quals) {
1005 assert(!Quals.hasFastQualifiers() && "fast qualifiers in ExtQuals hash!");
1127 /// IndexTypeQuals - CVR qualifiers from declarations like
1131 /// SizeModifier - storage class qualifiers from declarations like
1160 /// The qualifiers are part of FunctionProtoType because...
1352 /// operate on the canonical type, ignoring typedefs and qualifiers.
1406 // type, ignoring typedefs and qualifiers.
1462 Qualifiers::ObjCLifetime getObjCARCImplicitLifetime() const;
1535 // specified type, ignoring typedefs and qualifiers, and return a pointer to
1568 /// qualifiers from the outermost type.
1580 /// qualifiers from the outermost type.
1584 /// type, potentially discarding type qualifiers. This method
1585 /// should never be used when type qualifiers are meaningful.
1589 /// element type of the array, potentially with type qualifiers missing.
1590 /// This method should never be used when type qualifiers are meaningful.
1599 /// typeofs, etc., as well as any qualifiers.
1887 // FIXME: this might strip inner qualifiers; okay?
2041 Qualifiers getIndexTypeQualifiers() const {
2042 return Qualifiers::fromCVRMask(getIndexTypeCVRQualifiers());
3999 // protocol qualifiers ever become additive, the iterators will need
4119 /// - There are no protocol qualifiers. To reinforce this, code which
4205 /// old qualifiers (for now). But if it didn't, getObjectType()
4207 /// qualifiers more complicated).
4214 /// qualifiers on the interface are ignored.
4253 /// An iterator over the qualifiers on the object type. Provided
4324 /// A qualifier set is used to build a set of qualifiers.
4325 class QualifierCollector : public Qualifiers {
4327 QualifierCollector(Qualifiers Qs = Qualifiers()) : Qualifiers(Qs) {}
4329 /// Collect any qualifiers on the given type and return an
4330 /// unqualified type. The qualifiers are assumed to be consistent
4342 /// Apply the collected qualifiers to the given type.
4345 /// Apply the collected qualifiers to the given type.
4363 Qualifiers::fromFastMask(getLocalFastQualifiers()));
4366 Qualifiers qs = eq->getQualifiers();
4371 inline Qualifiers QualType::getLocalQualifiers() const {
4372 Qualifiers Quals;
4379 inline Qualifiers QualType::getQualifiers() const {
4380 Qualifiers quals = getCommonPtr()->CanonicalType.getLocalQualifiers();
4447 removeLocalFastQualifiers(Qualifiers::Const);
4451 removeLocalFastQualifiers(Qualifiers::Restrict);
4455 removeLocalFastQualifiers(Qualifiers::Volatile);
4459 assert(!(Mask & ~Qualifiers::CVRMask) && "mask has non-CVR bits");
4460 assert((int)Qualifiers::CVRMask == (int)Qualifiers::FastMask);
4462 // Fast path: we don't need to touch the slow qualifiers.
4472 inline Qualifiers::GC QualType::getObjCGCAttr() const {
4496 Qualifiers myQuals = getQualifiers();
4497 Qualifiers otherQuals = other.getQualifiers();