[Ada] Retain Has_Private_View flag for actuals of inlined subprograms
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 12 Aug 2022 09:33:20 +0000 (11:33 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 6 Sep 2022 07:14:22 +0000 (09:14 +0200)
commit8a99a8e6bcfd8c2ce739baaaca0e34d46c3343f2
treea42a4a8154321d68c5cb8a2d84bd3b291e188cf2
parent51abc0cc8691daecd7cec8372e4988e9f3f1913c
[Ada] Retain Has_Private_View flag for actuals of inlined subprograms

When instantiating a body to inline (either because frontend inlining is
enabled with switch -gnatN or because of inlining-for-proof in GNATprove
mode) we rewrite occurrences of formal parameters into the corresponding
actual parameters. Then we switch type views, so that if the formal had
a full view in the body to inline then the corresponding actual will
have a full view in the particular inlined body.

However, when rewriting occurrences of the formal parameter we were
losing information about whether the formal had a private view.

gcc/ada/

* inline.adb (Process_Formals): Preserve Has_Private_View flag while
rewriting formal into actual parameters.
gcc/ada/inline.adb