next up previous contents
Next: FieldAccessExpression Up: Data Structure Access Functions Previous: ArrayReferenceExpression   Contents


MultiDimArrayExpression

An MultiDimArrayExpression represents the calculation of an array element address from an array address and a set of integer index expressions.

    concrete MultiDimArrayExpression : Expression
      {
        Expression * owner base_array_address in source_ops;
        Expression * owner offset in source_ops;
        vector<Expression * owner> index in source_ops;
        vector<Expression * owner> elements in source_ops;
      };

base_array_address a pointer to an array (having the correct array type) and the result_type must be a pointer to the element type of that array_type.
offset offset from the base.
elements vector of number of elements in each dimension, with index[0] varying most rapidly, like Fortran.
index vector of indices; they are required to be within the range from the lower bound to the upper bound of the array inclusive. The address is  base_array_address + offset
 + elem_size * ( index[0] + elements[0] *
                 (index[1] + elements[1] * (...)))
where element_size is calculated from the element type of the MultiDimArrayType stored in the base_array_address result type. The result_type of each index expression must be an IntegerType.


next up previous contents
Next: FieldAccessExpression Up: Data Structure Access Functions Previous: ArrayReferenceExpression   Contents
SUIF Nightly Build
2000-08-14