Esempio n. 1
0
 private static ConstantPrototype DecodeConstant(IReadOnlyList <LNode> data, DecoderState state)
 {
     return(ConstantPrototype.Create(state.DecodeConstant(data[0]), state.DecodeType(data[1])));
 }
Esempio n. 2
0
 private static IReadOnlyList <LNode> EncodeConstant(ConstantPrototype value, EncoderState state)
 {
     return(new LNode[] { state.Encode(value.Value), state.Encode(value.ResultType) });
 }
 /// <summary>
 /// Creates an instruction that creates a constant value of a
 /// particular type.
 /// </summary>
 /// <param name="value">
 /// The constant value to produce.
 /// </param>
 /// <param name="type">
 /// The type of value created by the instruction.
 /// </param>
 /// <returns>
 /// A constant instruction.
 /// </returns>
 public static Instruction CreateConstant(Constant value, IType type)
 {
     return(ConstantPrototype.Create(value, type).Instantiate());
 }