Example #1
0
 /// <summary>
 /// Creates a load instruction.
 /// </summary>
 /// <param name="pointeeType">The type of value to load.</param>
 /// <param name="pointer">A pointer to the value to load.</param>
 /// <param name="isVolatile">
 /// Tells if the load is a volatile operation.
 /// Volatile operations may not be reordered with regard to each other.
 /// </param>
 /// <param name="alignment">
 /// The pointer alignment of <paramref name="pointer"/>.
 /// </param>
 /// <returns>A load instruction.</returns>
 public static Instruction CreateLoad(
     IType pointeeType,
     ValueTag pointer,
     bool isVolatile     = false,
     Alignment alignment = default(Alignment))
 {
     return(LoadPrototype.Create(pointeeType, isVolatile, alignment).Instantiate(pointer));
 }
 private static LoadPrototype DecodeLoad(IReadOnlyList <LNode> data, DecoderState state)
 {
     if (data.Count >= 3)
     {
         return(LoadPrototype.Create(
                    state.DecodeType(data[0]),
                    state.DecodeBoolean(data[1]),
                    state.DecodeAlignment(data[2])));
     }
     else if (data.Count >= 2)
     {
         return(LoadPrototype.Create(
                    state.DecodeType(data[0]),
                    state.DecodeBoolean(data[1])));
     }
     else
     {
         return(LoadPrototype.Create(state.DecodeType(data[0])));
     }
 }
 private static LoadPrototype DecodeLoad(IReadOnlyList <LNode> data, DecoderState state)
 {
     return(LoadPrototype.Create(state.DecodeType(data[0])));
 }
 /// <summary>
 /// Creates a load instruction.
 /// </summary>
 /// <param name="pointeeType">The type of value to load.</param>
 /// <param name="pointer">A pointer to the value to load.</param>
 /// <returns>A load instruction.</returns>
 public static Instruction CreateLoad(
     IType pointeeType, ValueTag pointer)
 {
     return(LoadPrototype.Create(pointeeType).Instantiate(pointer));
 }