/// <summary> /// Constructs a new view variable. /// </summary> /// <param name="viewType">The view type.</param> /// <param name="pointer">The pointer variable.</param> /// <param name="length">The length variable.</param> internal ViewVariable( ViewType viewType, PointerVariable pointer, PrimitiveVariable length) { Type = viewType; Pointer = pointer; Length = length; }
/// <summary> /// Creates a set of operations to realize a generic lea operation. /// </summary> /// <param name="elementIndex">The current element index (the offset).</param> /// <param name="target">The allocated target variable to write to.</param> /// <param name="address">The source address.</param> private void MakeLoadElementAddress( PrimitiveVariable elementIndex, PointerVariable target, PointerVariable address) { using (var statement = BeginStatement(target)) { statement.AppendCommand(CLInstructions.AddressOfOperation); statement.Append(address); statement.AppendIndexer(elementIndex); } }