Пример #1
0
 private static TypeNode ComputeType(
     IRContext context,
     TypeNode allocaType,
     MemoryAddressSpace addressSpace)
 {
     return(context.CreatePointerType(
                allocaType,
                addressSpace));
 }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
0
        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));
        }
Пример #5
0
 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));
     }
 }