Method IsOpaque
IsOpaque(IPointerType)
Gets a value indicating whether ptr
is opaque
public static bool IsOpaque(this IPointerType ptr)
Parameters
ptr
IPointerTypePointer type to test
Returns
Remarks
An opaque pointer is one where the ElementType is null. This is normal for LLVM now. However, it makes for more complicated code generation. Thus, the types in this wrapper try to keep track of the type of data a pointer is pointing to. This isn't always plausible so it might be opaque. This is normally true for anything retrieved from LLVM IR but is not normal for anything that creates or clones the IR. Since the pointer type creation is done as a method of the thing being pointed to this information is "attached" to the pointer so that the ElementType is not null.
note
until C# 14 [.Net 10] is supported this is an extension method. Once C#14 is available then this can become a property. Default methods on the interface have too many restrictions (mostly egregious is the need to "box"/cast to the explicit interface for the lookup to find the method).