@@ -147,15 +147,8 @@ extension TypeProperties {
147147 public var isDynamicSelf : Bool { rawType. bridged. isDynamicSelf ( ) }
148148 public var isBox : Bool { rawType. bridged. isBox ( ) }
149149
150- /// True if this is the type which represents an integer literal used in a type position.
151- /// For example `N` in `struct T<let N: Int> {}`
152- public var isInteger : Bool { rawType. bridged. isInteger ( ) }
153-
154150 public var canBeClass : Type . TraitResult { rawType. bridged. canBeClass ( ) . result }
155151
156- /// True if this the nominal type `Swift.Optional`.
157- public var isOptional : Bool { rawType. bridged. isOptional ( ) }
158-
159152 /// True if this type is a value type (struct/enum) that defines a `deinit`.
160153 public var isValueTypeWithDeinit : Bool {
161154 if let nominal = nominal, nominal. valueTypeDestructor != nil {
@@ -164,6 +157,34 @@ extension TypeProperties {
164157 return false
165158 }
166159
160+ //===--------------------------------------------------------------------===//
161+ // Checks for stdlib types
162+ //===--------------------------------------------------------------------===//
163+
164+ /// True if this is the type which represents an integer literal used in a type position.
165+ /// For example `N` in `struct T<let N: Int> {}`
166+ public var isInteger : Bool { rawType. bridged. isInteger ( ) }
167+
168+ /// True if this the nominal type `Swift.Optional`.
169+ public var isOptional : Bool { rawType. bridged. isOptional ( ) }
170+
171+ /// A non-nil result type implies isUnsafe[Raw][Mutable]Pointer. A raw
172+ /// pointer has a `void` element type.
173+ public var unsafePointerElementType : Type ? {
174+ Type ( bridgedOrNil: rawType. bridged. getAnyPointerElementType ( ) )
175+ }
176+
177+ public var isAnyUnsafePointer : Bool {
178+ unsafePointerElementType != nil
179+ }
180+
181+ public var isAnyUnsafeBufferPointer : Bool {
182+ rawType. bridged. isUnsafeBufferPointerType ( )
183+ || rawType. bridged. isUnsafeMutableBufferPointerType ( )
184+ || rawType. bridged. isUnsafeRawBufferPointerType ( )
185+ || rawType. bridged. isUnsafeMutableRawBufferPointerType ( )
186+ }
187+
167188 //===--------------------------------------------------------------------===//
168189 // Properties of lowered `SILFunctionType`s
169190 //===--------------------------------------------------------------------===//
0 commit comments