Mikael Morin wrote:
Add a static function producing a reference to the data field of array
descriptors, like those existing for the other fields.
OK, let's add this as cleanup/for completeness. → LGTM.
gcc/fortran/ChangeLog:
* trans-descriptor.cc (conv_descriptor_data): New function.
(gfc_conv_descriptor_data_get, gfc_conv_descriptor_data_set): Use
it.
...
@@ -99,7 +108,7 @@ gfc_conv_descriptor_data_get (tree desc)
- tree field = gfc_get_descriptor_field (desc, DATA_FIELD);
+ tree field = conv_descriptor_data (desc);
return fold_convert (GFC_TYPE_ARRAY_DATAPTR_TYPE (type), field);
}
@@ -108,7 +117,7 @@ gfc_conv_descriptor_data_get (tree desc)
gfc_conv_descriptor_data_set (stmtblock_t *block, tree desc, tree value)
{
- tree field = gfc_get_descriptor_field (desc, DATA_FIELD);
+ tree field = conv_descriptor_data (desc);
gfc_add_modify (block, field, fold_convert (TREE_TYPE (field), value));
I think it would look cleaner with 'tree data' than with 'tree field' –
but that's just a minor observation.
Tobias