private static AllocaPrototype DecodeAlloca(IReadOnlyList <LNode> data, DecoderState state) { return(AllocaPrototype.Create(state.DecodeType(data[0]))); }
private static IReadOnlyList <LNode> EncodeAlloca(AllocaPrototype value, EncoderState state) { return(new LNode[] { state.Encode(value.ElementType) }); }
/// <summary> /// Creates an instruction that allocates storage on the stack /// for a single value element of a particular type. /// </summary> /// <param name="elementType"> /// The type of value to allocate storage for. /// </param> /// <returns> /// An alloca instruction. /// </returns> public static Instruction CreateAlloca(IType elementType) { return(AllocaPrototype.Create(elementType).Instantiate()); }