private static TypeNode ComputeType( IRContext context, TypeNode pointerType) { var type = pointerType as PointerType; return(context.CreateViewType( type.ElementType, type.AddressSpace)); }
private static AddressSpaceType ComputeType( IRContext context, TypeNode sourceType, TypeNode targetElementType) { var viewType = sourceType as ViewType; Debug.Assert(viewType != null, "Invalid view type"); return(context.CreateViewType( targetElementType, viewType.AddressSpace)); }
private static AddressSpaceType ComputeType( IRContext context, TypeNode sourceType, MemoryAddressSpace targetAddressSpace) { if (sourceType is ViewType viewType) { return(context.CreateViewType( viewType.ElementType, targetAddressSpace)); } else { var pointerType = sourceType as PointerType; return(context.CreatePointerType( pointerType.ElementType, targetAddressSpace)); } }