diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-09-05 15:12:42 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-09-12 10:16:52 +0200 |
commit | 9ccd61dfee0f21cf049653cfdaf2c28750ebe3cd (patch) | |
tree | 1a98ef3bdef558861d70cfd04474cf1a0825f279 | |
parent | f244e994b5ff5b6499a30171b4716f1a6983d6d8 (diff) | |
download | gcc-9ccd61dfee0f21cf049653cfdaf2c28750ebe3cd.zip gcc-9ccd61dfee0f21cf049653cfdaf2c28750ebe3cd.tar.gz gcc-9ccd61dfee0f21cf049653cfdaf2c28750ebe3cd.tar.bz2 |
[Ada] Special-case printing of SPARK_Mode in error messages
For error messages with inserted names that include acronyms like SPARK
or CPP, we want to preserve the casing. The list of special-cased named
is currently the same as in gnatpp.
gcc/ada/
* erroutc.adb (Set_Msg_Insertion_Name): Special-case printing with
acronyms.
-rw-r--r-- | gcc/ada/erroutc.adb | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb index cab7fec..d0cbe9f 100644 --- a/gcc/ada/erroutc.adb +++ b/gcc/ada/erroutc.adb @@ -1317,8 +1317,8 @@ package body Erroutc is Name_Len := Name_Len - 1; end if; - -- If operator name or character literal name, just print it as is - -- Also print as is if it ends in a right paren (case of x'val(nnn)) + -- If operator name or character literal name, just print it as is. + -- Also print as is if it ends in a right paren (case of x'val(nnn)). if Name_Buffer (1) = '"' or else Name_Buffer (1) = ''' @@ -1534,6 +1534,32 @@ package body Erroutc is elsif Text = "_TYPE_INVARIANT" then Set_Msg_Str ("TYPE_INVARIANT'CLASS"); + -- Preserve casing for names that include acronyms + + elsif Text = "Cpp_Class" then + Set_Msg_Str ("CPP_Class"); + + elsif Text = "Cpp_Constructor" then + Set_Msg_Str ("CPP_Constructor"); + + elsif Text = "Cpp_Virtual" then + Set_Msg_Str ("CPP_Virtual"); + + elsif Text = "Cpp_Vtable" then + Set_Msg_Str ("CPP_Vtable"); + + elsif Text = "Persistent_Bss" then + Set_Msg_Str ("Persistent_BSS"); + + elsif Text = "Spark_Mode" then + Set_Msg_Str ("SPARK_Mode"); + + elsif Text = "Use_Vads_Size" then + Set_Msg_Str ("Use_VADS_Size"); + + elsif Text = "Vads_Size" then + Set_Msg_Str ("VADS_size"); + -- Normal case with no replacement else |