Deleted Added
full compact
CanonicalType.h (198893) CanonicalType.h (199482)
1//===-- CanonicalType.h - C Language Family Type Representation -*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 57 unchanged lines hidden (view full) ---

66
67 /// \brief Retrieve the underlying type pointer, which refers to a
68 /// canonical type.
69 T *getTypePtr() const { return cast_or_null<T>(Stored.getTypePtr()); }
70
71 /// \brief Implicit conversion to a qualified type.
72 operator QualType() const { return Stored; }
73
1//===-- CanonicalType.h - C Language Family Type Representation -*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 57 unchanged lines hidden (view full) ---

66
67 /// \brief Retrieve the underlying type pointer, which refers to a
68 /// canonical type.
69 T *getTypePtr() const { return cast_or_null<T>(Stored.getTypePtr()); }
70
71 /// \brief Implicit conversion to a qualified type.
72 operator QualType() const { return Stored; }
73
74 /// \brief Implicit conversion to bool.
75 operator bool() const { return !isNull(); }
76
74 bool isNull() const {
75 return Stored.isNull();
76 }
77
78 /// \brief Retrieve a canonical type pointer with a different static type,
79 /// upcasting or downcasting as needed.
80 ///
81 /// The getAs() function is typically used to try to downcast to a

--- 12 unchanged lines hidden (view full) ---

94 /// or a derived class thereof, a NULL canonical type.
95 template<typename U> CanProxy<U> getAs() const;
96
97 /// \brief Overloaded arrow operator that produces a canonical type
98 /// proxy.
99 CanProxy<T> operator->() const;
100
101 /// \brief Retrieve all qualifiers.
77 bool isNull() const {
78 return Stored.isNull();
79 }
80
81 /// \brief Retrieve a canonical type pointer with a different static type,
82 /// upcasting or downcasting as needed.
83 ///
84 /// The getAs() function is typically used to try to downcast to a

--- 12 unchanged lines hidden (view full) ---

97 /// or a derived class thereof, a NULL canonical type.
98 template<typename U> CanProxy<U> getAs() const;
99
100 /// \brief Overloaded arrow operator that produces a canonical type
101 /// proxy.
102 CanProxy<T> operator->() const;
103
104 /// \brief Retrieve all qualifiers.
102 Qualifiers getQualifiers() const { return Stored.getQualifiers(); }
105 Qualifiers getQualifiers() const { return Stored.getLocalQualifiers(); }
103
104 /// \brief Retrieve the const/volatile/restrict qualifiers.
106
107 /// \brief Retrieve the const/volatile/restrict qualifiers.
105 unsigned getCVRQualifiers() const { return Stored.getCVRQualifiers(); }
108 unsigned getCVRQualifiers() const { return Stored.getLocalCVRQualifiers(); }
106
107 /// \brief Determines whether this type has any qualifiers
109
110 /// \brief Determines whether this type has any qualifiers
108 bool hasQualifiers() const { return Stored.hasQualifiers(); }
111 bool hasQualifiers() const { return Stored.hasLocalQualifiers(); }
109
110 bool isConstQualified() const {
112
113 bool isConstQualified() const {
111 return Stored.isConstQualified();
114 return Stored.isLocalConstQualified();
112 }
113 bool isVolatileQualified() const {
115 }
116 bool isVolatileQualified() const {
114 return Stored.isVolatileQualified();
117 return Stored.isLocalVolatileQualified();
115 }
116 bool isRestrictQualified() const {
118 }
119 bool isRestrictQualified() const {
117 return Stored.isRestrictQualified();
120 return Stored.isLocalRestrictQualified();
118 }
119
120 /// \brief Retrieve the unqualified form of this type.
121 CanQual<T> getUnqualifiedType() const;
122
123 /// \brief Retrieves a version of this type with const applied.
124 /// Note that this does not always yield a canonical type.
125 QualType withConst() const {

--- 504 unchanged lines hidden (view full) ---

630 LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getNumProtocols)
631};
632
633//----------------------------------------------------------------------------//
634// Method and function definitions
635//----------------------------------------------------------------------------//
636template<typename T>
637inline CanQual<T> CanQual<T>::getUnqualifiedType() const {
121 }
122
123 /// \brief Retrieve the unqualified form of this type.
124 CanQual<T> getUnqualifiedType() const;
125
126 /// \brief Retrieves a version of this type with const applied.
127 /// Note that this does not always yield a canonical type.
128 QualType withConst() const {

--- 504 unchanged lines hidden (view full) ---

633 LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(unsigned, getNumProtocols)
634};
635
636//----------------------------------------------------------------------------//
637// Method and function definitions
638//----------------------------------------------------------------------------//
639template<typename T>
640inline CanQual<T> CanQual<T>::getUnqualifiedType() const {
638 return CanQual::CreateUnsafe(Stored.getUnqualifiedType());
641 return CanQual<T>::CreateUnsafe(Stored.getLocalUnqualifiedType());
639}
640
641template<typename T>
642inline CanQual<Type> CanQual<T>::getNonReferenceType() const {
643 if (CanQual<ReferenceType> RefType = getAs<ReferenceType>())
644 return RefType->getPointeeType();
645 else
646 return *this;

--- 48 unchanged lines hidden ---
642}
643
644template<typename T>
645inline CanQual<Type> CanQual<T>::getNonReferenceType() const {
646 if (CanQual<ReferenceType> RefType = getAs<ReferenceType>())
647 return RefType->getPointeeType();
648 else
649 return *this;

--- 48 unchanged lines hidden ---