private static SizeOfPrototype DecodeSizeOf(IReadOnlyList <LNode> data, DecoderState state)
 {
     return(SizeOfPrototype.Create(state.DecodeType(data[0]), state.DecodeType(data[1])));
 }
 private static IReadOnlyList <LNode> EncodeSizeOf(SizeOfPrototype value, EncoderState state)
 {
     return(new LNode[] { state.Encode(value.MeasuredType), state.Encode(value.ResultType) });
 }
示例#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());
 }