[Ada] Simplify processing of 'Valid_Scalars on array types

Pierre-Marie de Rodat derodat@adacore.com
Fri Jun 19 08:28:33 GMT 2020


When calling routine Build_Array_VS_Func that expands attribute
Valid_Scalars on array objects we tested Scalar_Part_Present on the
array's component type. This was unnecessary, because
Build_Array_VS_Func is only called after checking Scalar_Part_Present on
the array's type, which internally Scalar_Part_Present on the array's
component type.

This patch is a cleanup only; semantics is unaffected.

Tested on x86_64-pc-linux-gnu, committed on trunk

2020-06-19  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* exp_attr.adb (Expand_N_Attribute_Reference): Do not call
	Scalar_Part_Present on the array component's type.
	(Build_Array_VS_Func): Remove Comp_Typ parameter, because it can
	be easily computed from the Array_Top parameter *and redundant
	parameters are confusing and error-prone).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 3166 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200619/11a2dd7c/attachment-0001.bin>


More information about the Gcc-patches mailing list