From: Bob Duff Date: Fri, 16 May 2025 13:04:48 +0000 (-0400) Subject: ada: Disable -gnatR2 output in case of object renamings X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed0e710f222d9e5893d69e32a84caf363ac8415b;p=thirdparty%2Fgcc.git ada: Disable -gnatR2 output in case of object renamings Such output was unnecessary, and in some cases harmful. In particular, we generate renamings in the expanded code for protected types, with internally-generated names, which could be confusing to the user. In addition, in the JSON output (-gnatR2j), these generated renamings could have duplicate source locatations, which confused SPARK. gcc/ada/ChangeLog: * repinfo.adb (List_Entities): Disable output in case of object renamings. --- diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb index ddbb58e7e0b..1d616db71f3 100644 --- a/gcc/ada/repinfo.adb +++ b/gcc/ada/repinfo.adb @@ -533,11 +533,13 @@ package body Repinfo is List_Type_Info (E); end if; - -- Note that formals are not annotated so we skip them here + -- Formals and renamings are not annotated, so we skip them + -- here. elsif Ekind (E) in E_Constant | E_Loop_Parameter | E_Variable + and then Nkind (Parent (E)) /= N_Object_Renaming_Declaration then if List_Representation_Info >= 2 then List_Object_Info (E);