Exemplo n.º 1
0
 private static SizeOfPrototype DecodeSizeOf(IReadOnlyList <LNode> data, DecoderState state)
 {
     return(SizeOfPrototype.Create(state.DecodeType(data[0]), state.DecodeType(data[1])));
 }
Exemplo n.º 2
0
 private static IReadOnlyList <LNode> EncodeSizeOf(SizeOfPrototype value, EncoderState state)
 {
     return(new LNode[] { state.Encode(value.MeasuredType), state.Encode(value.ResultType) });
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates an instruction that measures the size of a type.
 /// </summary>
 /// <param name="measuredType">
 /// The type to measure.
 /// </param>
 /// <param name="resultType">
 /// The type of value to produce.
 /// </param>
 /// <returns>
 /// A sizeof instruction.
 /// </returns>
 public static Instruction CreateSizeOf(IType measuredType, IType resultType)
 {
     return(SizeOfPrototype.Create(measuredType, resultType).Instantiate());
 }