-
- Downloads
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.
Showing
- gcc/ada/libgnat/g-cppexc.adb 0 additions, 40 deletionsgcc/ada/libgnat/g-cppexc.adb
- gcc/ada/libgnat/g-cppstd.adb 2 additions, 1 deletiongcc/ada/libgnat/g-cppstd.adb
- gcc/ada/libgnat/g-cppstd.ads 3 additions, 1 deletiongcc/ada/libgnat/g-cppstd.ads
- gcc/ada/libgnat/g-cstyin.adb 59 additions, 21 deletionsgcc/ada/libgnat/g-cstyin.adb
- gcc/ada/libgnat/g-cstyin.ads 1 addition, 1 deletiongcc/ada/libgnat/g-cstyin.ads
Loading
Please register or sign in to comment