ada: Cleanup detection of code within generic instances
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 7 Sep 2022 15:24:40 +0000 (17:24 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 7 Nov 2022 08:36:32 +0000 (09:36 +0100)
commit72ae51d581dc8bcf8dcec9b5e0e1560d9e4099d1
tree535590f474425e791455c4f7e515f9c66c8dcc5d
parentdcc02d3168b4457746f6ab1d8e73cf9d15c6d4e8
ada: Cleanup detection of code within generic instances

To check if a node is located in a generic instance we can either look
at Instantiation_Location or at the Instantiation_Depth, but just
looking at the location is simpler and more efficient.

Cleanup related to improved detection of references to uninitialized
objects; semantics is unaffected.

gcc/ada/

* sem_ch13.adb (Add_Call): Just look at Instantiation_Depth.
* sem_ch3.adb (Derive_Subprograms): Likewise.
* sem_warn.adb (Check_References): Remove redundant filtering with
Instantiation_Depth that follows filtering with
Instantiation_Location.
* sinput.adb (Instantiation_Depth): Reuse Instantiation_Location.
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_warn.adb
gcc/ada/sinput.adb