[Ada] Make Declaration_Node return nondeclarations in fewer cases
authorBob Duff <duff@adacore.com>
Mon, 6 Sep 2021 17:01:04 +0000 (13:01 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 25 Oct 2021 15:07:21 +0000 (15:07 +0000)
commit93c63f32a2cb49679143f4b893343fcba6f59351
tree400595ed159056d7d9571d8844462873eb871f7b
parenta3a6a0a50af2dd257682289703b721ba1b7863ca
[Ada] Make Declaration_Node return nondeclarations in fewer cases

gcc/ada/

* einfo-utils.adb (Declaration_Node): Avoid returning the
following node kinds: N_Assignment_Statement, N_Integer_Literal,
N_Procedure_Call_Statement, N_Subtype_Indication, and
N_Type_Conversion.  Assert that the result is in N_Is_Decl or
empty.
* gen_il-gen-gen_nodes.adb (N_Is_Decl): Modify to match the
things that Declaration_Node can return.
gcc/ada/einfo-utils.adb
gcc/ada/gen_il-gen-gen_nodes.adb