|
|
|
@ -90,26 +90,19 @@
@@ -90,26 +90,19 @@
|
|
|
|
|
if (ptr == null) |
|
|
|
|
return false; |
|
|
|
|
return ptr.Pointee.IsPrimitiveType(primitive); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static bool IsPointerTo<T>(this Type t, out T type) where T : Type |
|
|
|
|
{ |
|
|
|
|
var ptr = t as PointerType; |
|
|
|
|
|
|
|
|
|
if (ptr == null) |
|
|
|
|
{ |
|
|
|
|
var functionPointer = t as MemberPointerType; |
|
|
|
|
if (functionPointer != null) |
|
|
|
|
{ |
|
|
|
|
type = functionPointer.Pointee as T; |
|
|
|
|
return type != null; |
|
|
|
|
} |
|
|
|
|
type = null; |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
type = ptr.Pointee as T; |
|
|
|
|
return type != null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static bool IsPointerTo<T>(this Type t, out T type) where T : Type |
|
|
|
|
{ |
|
|
|
|
var pointee = t.GetPointee(); |
|
|
|
|
type = pointee as T; |
|
|
|
|
if (type == null) |
|
|
|
|
{ |
|
|
|
|
var attributedType = pointee as AttributedType; |
|
|
|
|
if (attributedType != null) |
|
|
|
|
type = attributedType.Modified.Type as T; |
|
|
|
|
} |
|
|
|
|
return type != null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static bool IsTagDecl<T>(this Type t, out T decl) where T : Declaration |
|
|
|
|