diff options
author | Alexandre Oliva <oliva@adacore.com> | 2024-12-10 09:06:57 -0300 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2025-01-06 10:14:49 +0100 |
commit | 2d2b018dcc4f5a822257688fb393fe0094d92d6d (patch) | |
tree | d71bb12c10da1d8c359e9402b69d5d2f8a8b1ba3 /gcc/fortran/trans-expr.cc | |
parent | f49b098e7d19ea60b450b01e4434a00e7e5ca90b (diff) | |
download | gcc-2d2b018dcc4f5a822257688fb393fe0094d92d6d.zip gcc-2d2b018dcc4f5a822257688fb393fe0094d92d6d.tar.gz gcc-2d2b018dcc4f5a822257688fb393fe0094d92d6d.tar.bz2 |
ada: Reduce footprint of C++ exception interoperation support
The initial C++ base-type exception interoperation support change
brought all of GNAT.CPP* along with raise-gcc, because of
[__gnat_]Convert_Caught_Object. Move that private but pragma-exported
function to GNAT.CPP.Std.Type_Info, so that it can rely on the C++
virtual/dispatch calls that justified the introduction of the Ada
wrapper type, to avoid emulating virtual calls in C or bringing in a
dependency on the C++ compiler and runtime.
Drop the CharPtr package instantiation, that brought a huge amount of
unnecessary code, and use string and storage primitives instead, using
the strcmp builtin directly for the C string compares.
Move the conversion to Ada String in Name to the wrapper interface in
GNAT.CPP.Std, adjusting the private internal type to shave off a few
more bytes from the only unit that raise-gcc will still need.
Finally, disable heap finalization for Type_Info_Ptr, to avoid
dragging in all of the finalization code. Thank to Eric Botcazou for
the suggestion.
gcc/ada/ChangeLog:
* libgnat/g-cppexc.adb (Convert_Caught_Object): Move...
* libgnat/g-cstyin.adb (Convert_Caught_Object): ... here.
Use object call notation.
(strcmp): New.
(Char_Arr, CharPtr, Char_Pointer, To_chars_ptr): Drop. Do not
import Interfaces.C.Pointers.
(To_Pointer): Convert from System.Address.
(Name_Starts_With_Asterisk): Rename local variable.
(Name_Past_Asterisk): Rewrite with System.Address and strcmp.
Import System.Storage_Elements.
(Equals): Use strcmp.
(Before): Fix logic error. Use strcmp.
(Name): Move conversion to String...
* libgnat/g-cppstd.adb (Name): ... here. Import
Interfaces.C.Strings.
* libgnat/g-cppstd.ads (Type_Info_Ptr): Disable heap
finalization.
* libgnat/g-cstyin.ads (Name): Change return type.
Diffstat (limited to 'gcc/fortran/trans-expr.cc')
0 files changed, 0 insertions, 0 deletions