-
- Downloads
[Ada] Handle bodies-to-inline just like generic templates
Originally bodies-to-inline created for the frontend inlining were analyzed with expansion disabled. Then, to facilitate inlining in GNATprove mode, the analysis was changed to preanalysis. However, preanalysis in this context works badly for calls in prefix notation, because preanalysis assigns entities and types to nodes but doesn't convert calls from prefix to ordinary notation. When the body-to-inline is actually inlined, the (re)analysis of calls in prefix notation fails. The proper solution is rather to handle bodies-to-inline just like generic templates. From the user point of view, this patch fixes spurious errors both in GNATprove (which uses frontend inlining by default) and in GNAT (where frontend inlining is typically explicitly requested with -gnatN and pragma Inline_Always). gcc/ada/ * inline.adb (Build_Body_To_Inline): Instead of manipulating the Full_Analysis flag, use the Inside_A_Generic flag (which is conveniently manipulated by Start_Generic/End_Generic, together with Expander_Active). * sem_attr.adb (Analyze_Attribute_Old_Result): Adapt comment and assertion to different flag that is set while building body-to-inline.
Loading
Please register or sign in to comment