private static TypeNode ComputeType( IRContext context, TypeNode allocaType, MemoryAddressSpace addressSpace) { return(context.CreatePointerType( allocaType, addressSpace)); }
private static AddressSpaceType ComputeType( IRContext context, TypeNode sourceType, TypeNode targetElementType) { var pointerType = sourceType as PointerType; Debug.Assert(pointerType != null, "Invalid pointer type"); return(context.CreatePointerType( targetElementType, pointerType.AddressSpace)); }
private static TypeNode ComputeType( IRContext context, ValueReference source) { var sourceType = source.Type as AddressSpaceType; if (sourceType is PointerType) { return(sourceType); } return(context.CreatePointerType( sourceType.ElementType, sourceType.AddressSpace)); }
private static TypeNode ComputeType( IRContext context, ValueReference source, int fieldIndex) { var pointerType = source.Type as PointerType; Debug.Assert(pointerType != null, "Invalid pointer type"); var structureType = pointerType.ElementType as StructureType; Debug.Assert(structureType != null, "Invalid structure type"); var fieldType = structureType.Fields[fieldIndex]; return(context.CreatePointerType( fieldType, pointerType.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)); } }