Home | History | Annotate | Download | only in AST

Lines Matching defs:Qualifiers

112 /// The collection of all-type qualifiers we support.
113 /// Clang supports five independent qualifiers:
118 class Qualifiers {
167 Qualifiers() : Mask(0) {}
169 /// Returns the common set of qualifiers while removing them from
171 static Qualifiers removeCommonQualifiers(Qualifiers &L, Qualifiers &R) {
174 Qualifiers Q;
181 Qualifiers Q;
207 static Qualifiers fromFastMask(unsigned Mask) {
208 Qualifiers Qs;
213 static Qualifiers fromCVRMask(unsigned CVR) {
214 Qualifiers Qs;
219 static Qualifiers fromCVRUMask(unsigned CVRU) {
220 Qualifiers Qs;
225 // Deserialize qualifiers from an opaque representation.
226 static Qualifiers fromOpaqueValue(unsigned opaque) {
227 Qualifiers Qs;
232 // Serialize these qualifiers into an opaque representation.
297 Qualifiers withoutObjCGCAttr() const {
298 Qualifiers qs = *this;
302 Qualifiers withoutObjCLifetime() const {
303 Qualifiers qs = *this;
361 // Fast qualifiers are those that can be allocated directly
381 /// Return true if the set contains any qualifiers which require an ExtQuals
384 Qualifiers getNonFastQualifiers() const {
385 Qualifiers Quals = *this;
390 /// Return true if the set contains any qualifiers.
394 /// Add the qualifiers from the given set to this set.
395 void addQualifiers(Qualifiers Q) {
396 // If the other set doesn't have any non-boolean qualifiers, just
411 /// \brief Remove the qualifiers from the given set from this set.
412 void removeQualifiers(Qualifiers Q) {
413 // If the other set doesn't have any non-boolean qualifiers, just
428 /// Add the qualifiers from the given set to this set, given that
430 void addConsistentQualifiers(Qualifiers qs) {
447 bool isAddressSpaceSupersetOf(Qualifiers other) const {
457 /// Determines if these qualifiers compatibly include another set.
459 /// qualifiers can be safely used as an object with these qualifiers.
460 bool compatiblyIncludes(Qualifiers other) const {
462 // ObjC GC qualifiers can match, be added, or be removed, but can't
466 // ObjC lifetime qualifiers must match exactly.
468 // CVR qualifiers may subset.
474 /// \brief Determines if these qualifiers compatibly include another set of
475 /// qualifiers from the narrow perspective of Objective-C ARC lifetime.
477 /// One set of Objective-C lifetime qualifiers compatibly includes the other
478 /// if the lifetime qualifiers match, or if both are non-__weak and the
481 bool compatiblyIncludesObjCLifetime(Qualifiers other) const {
494 /// \brief Determine whether this set of qualifiers is a strict superset of
495 /// another set of qualifiers, not considering qualifier compatibility.
496 bool isStrictSupersetOf(Qualifiers Other) const;
498 bool operator==(Qualifiers Other) const { return Mask == Other.Mask; }
499 Qualifiers Other) const { return Mask != Other.Mask; }
503 Qualifiers &operator+=(Qualifiers R) {
510 friend Qualifiers operator+(Qualifiers L, Qualifiers R) {
515 Qualifiers &operator-=(Qualifiers R) {
521 friend Qualifiers operator-(Qualifiers L, Qualifiers R) {
555 /// into its local qualifiers and its locally-unqualified type.
560 /// The local qualifiers.
561 Qualifiers Quals;
564 SplitQualType(const Type *ty, Qualifiers qs) : Ty(ty), Quals(qs) {}
569 std::pair<const Type *,Qualifiers> asPair() const {
570 return std::pair<const Type *, Qualifiers>(Ty, Quals);
602 /// own: instead each reference to a type stores the qualifiers. This
611 /// indicates whether there are extended qualifiers present, in which
616 Qualifiers::FastWidth> Value;
658 /// qualifiers.
688 return (getLocalFastQualifiers() & Qualifiers::Const);
698 return (getLocalFastQualifiers() & Qualifiers::Restrict);
708 return (getLocalFastQualifiers() & Qualifiers::Volatile);
715 /// qualifiers, without looking through any typedefs that might add
716 /// qualifiers at a different level.
721 /// \brief Determine whether this type has any qualifiers.
725 /// "non-fast" qualifiers, e.g., those that are stored in an ExtQualType
731 /// \brief Retrieve the set of qualifiers local to this particular QualType
732 /// instance, not including any qualifiers acquired through typedefs or
734 Qualifiers getLocalQualifiers() const;
736 /// \brief Retrieve the set of qualifiers applied to this type.
737 Qualifiers getQualifiers() const;
739 /// \brief Retrieve the set of CVR (const-volatile-restrict) qualifiers
740 /// local to this particular QualType instance, not including any qualifiers
746 /// \brief Retrieve the set of CVR (const-volatile-restrict) qualifiers
777 addFastQualifiers(Qualifiers::Const);
780 return withFastQualifiers(Qualifiers::Const);
785 addFastQualifiers(Qualifiers::Volatile);
788 return withFastQualifiers(Qualifiers::Volatile);
793 addFastQualifiers(Qualifiers::Restrict);
796 return withFastQualifiers(Qualifiers::Restrict);
804 assert(!(TQs & ~Qualifiers::FastMask)
816 assert(!(Mask & ~Qualifiers::FastMask) && "mask has non-fast qualifiers");
820 // Creates a type with the given qualifiers in addition to any
821 // qualifiers already on this type.
828 // Creates a type with exactly the given fast qualifiers, removing
829 // any existing fast qualifiers.
834 // Removes fast qualifiers, but leaves any extended qualifiers in place.
843 /// \brief Return this type with all of the instance-specific qualifiers
844 /// removed, but without removing any qualifiers that may have been applied
861 /// desugar until we hit the type \c Integer, which has no qualifiers on it.
864 /// type. To strip qualifiers even from within a sugared array type, use
872 /// qualifiers that were built up.
875 /// type. To strip qualifiers even from within a sugared array type, use
880 /// given type, requiring exact equality for non-CVR qualifiers.
884 /// given type, requiring exact equality for non-CVR qualifiers.
895 /// expressions of reference type) and deletes top-level cvr-qualifiers
906 /// Qualifiers are left in place.
932 /// Indicate whether the specified types and qualifiers are identical.
945 static std::string getAsString(const Type *ty, Qualifiers qs);
959 static void print(const Type *ty, Qualifiers qs,
972 static void getAsStringInternal(const Type *ty, Qualifiers qs,
1012 inline Qualifiers::GC getObjCGCAttr() const;
1016 return getObjCGCAttr() == Qualifiers::Weak;
1021 return getObjCGCAttr() == Qualifiers::Strong;
1025 Qualifiers::ObjCLifetime getObjCLifetime() const {
1049 /// conceivable that qualifiers (objc_gc(weak)?) could make
1112 /// Remove all qualifiers including _Atomic.
1151 // Various qualifiers go in low bits.
1167 /// \brief The "base" type of an extended qualifiers type (\c ExtQuals) or
1183 /// type pointer, but there are many more type qualifiers that we want
1186 /// store qualifiers.
1188 /// The current design tags the 'const', 'restrict', and 'volatile' qualifiers
1190 /// the pointer is an ExtQuals node. The extended qualifiers (address spaces,
1193 // NOTE: changing the fast qualifiers should be straightforward as
1195 // 1. Qualifiers:
1196 // a) Modify the bitmasks (Qualifiers::TQ and DeclSpec::TQ).
1197 // Fast qualifiers must occupy the low-order bits.
1198 // b) Update Qualifiers::FastWidth and FastMask.
1206 /// The immutable set of qualifiers applied by this node. Always contains
1207 /// extended qualifiers.
1208 Qualifiers Quals;
1213 ExtQuals(const Type *baseType, QualType canon, Qualifiers quals)
1219 && "ExtQuals created with no fast qualifiers");
1221 && "ExtQuals created with fast qualifiers");
1224 Qualifiers getQualifiers() const { return Quals; }
1227 Qualifiers::GC getObjCGCAttr() const { return Quals.getObjCGCAttr(); }
1230 Qualifiers::ObjCLifetime getObjCLifetime() const {
1245 Qualifiers Quals) {
1246 assert(!Quals.hasFastQualifiers() && "fast qualifiers in ExtQuals hash!");
1372 /// CVR qualifiers from declarations like
1376 /// Storage class qualifiers from declarations like
1403 /// The qualifiers are part of FunctionProtoType because...
1623 /// operate on the canonical type, ignoring typedefs and qualifiers.
1678 // type, ignoring typedefs and qualifiers.
1775 Qualifiers::ObjCLifetime getObjCARCImplicitLifetime() const;
1851 // specified type, ignoring typedefs and qualifiers, and return a pointer to
1915 /// qualifiers from the outermost type.
1927 /// qualifiers from the outermost type.
1931 /// qualifiers. This should never be used when type qualifiers
1936 /// potentially with type qualifiers missing.
1937 /// This should never be used when type qualifiers are meaningful.
1942 /// This should never be used when type qualifiers are meaningful.
1950 /// removing any typedefs, typeofs, etc., as well as any qualifiers.
2244 Qualifiers thisQuals = PointeeType.getQualifiers();
2245 Qualifiers otherQuals = other.getPointeeType().getQualifiers();
2377 // FIXME: this might strip inner qualifiers; okay?
2530 Qualifiers getIndexTypeQualifiers() const {
2531 return Qualifiers::fromCVRMask(getIndexTypeCVRQualifiers());
3058 bool isConst() const { return getTypeQuals() & Qualifiers::Const; }
3059 bool isVolatile() const { return getTypeQuals() & Qualifiers::Volatile; }
3060 bool isRestrict() const { return getTypeQuals() & Qualifiers::Restrict; }
3901 /// a specific object, like the standard const and volatile qualifiers.
3909 /// and vector attributes are not simple type qualifiers.
3911 /// Type qualifiers are often, but not always, reflected in the canonical
4827 /// This class wraps the list of protocol qualifiers. For types that can
4874 /// Retrieve all of the protocol qualifiers.
4960 // protocol qualifiers ever become additive, the iterators will need
5084 /// protocol qualifiers.
5142 /// - There are no protocol qualifiers. To reinforce this, code which
5239 /// old qualifiers (for now). But if it didn't, getObjectType()
5241 /// qualifiers more complicated).
5248 /// qualifiers on the interface are ignored.
5318 /// An iterator over the qualifiers on the object type. Provided
5355 /// protocol qualifiers.
5436 /// A qualifier set is used to build a set of qualifiers.
5437 class QualifierCollector : public Qualifiers {
5439 QualifierCollector(Qualifiers Qs = Qualifiers()) : Qualifiers(Qs) {}
5441 /// Collect any qualifiers on the given type and return an
5442 /// unqualified type. The qualifiers are assumed to be consistent
5454 /// Apply the collected qualifiers to the given type.
5457 /// Apply the collected qualifiers to the given type.
5482 Qualifiers::fromFastMask(getLocalFastQualifiers()));
5485 Qualifiers qs = eq->getQualifiers();
5490 inline Qualifiers QualType::getLocalQualifiers() const {
5491 Qualifiers Quals;
5498 inline Qualifiers QualType::getQualifiers() const {
5499 Qualifiers quals = getCommonPtr()->CanonicalType.getLocalQualifiers();
5566 removeLocalFastQualifiers(Qualifiers::Const);
5570 removeLocalFastQualifiers(Qualifiers::Restrict);
5574 removeLocalFastQualifiers(Qualifiers::Volatile);
5578 assert(!(Mask & ~Qualifiers::CVRMask) && "mask has non-CVR bits");
5579 static_assert((int)Qualifiers::CVRMask == (int)Qualifiers::FastMask,
5582 // Fast path: we don't need to touch the slow qualifiers.
5592 inline Qualifiers::GC QualType::getObjCGCAttr() const {
5616 Qualifiers MyQuals = getQualifiers();
5617 Qualifiers OtherQuals = other.getQualifiers();
5626 Qualifiers OtherQuals = other.getQualifiers();