Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

core.stdcpp: Upstream differences between dmd and gdc/ldc druntimes #3552

Merged
merged 1 commit into from
Aug 25, 2021
Merged

core.stdcpp: Upstream differences between dmd and gdc/ldc druntimes #3552

merged 1 commit into from
Aug 25, 2021

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Aug 22, 2021

Upstreamed:

  • Change destructors from extern(D) -> @weak extern(C++)
  • Change CppRuntime_Microsoft exception.what from extern(D) -> @weak extern(C++)
  • Add assert(0) to CppRuntime_Microsoft exception._Doraise
  • Add missing bad_exception.what for GenericBaseException
  • Add @nogc: to core.stdcpp.typeinfo
  • Add nothrow to type_info.before and type_info.name
  • Mark CppRuntime_Gcc type_info as abstract
  • Add definitions to CppRuntime_Gcc and CppRuntime_Clang bad_cast.what and bad_typeid.what

New: Things found to be broken just by adding tests. (Moved to other PRs).

  • Change CppRuntme_Gcc __class_type_info from class -> extern(C++, class) struct
  • Add implementation of typeinfo for CppRuntime_Clang
  • Fix the alignment of _Unwind_Exception to fix catching exceptions using dwarfeh on x86
  • Add separate implemention of exception for CppRuntime_DigitalMars

@ibuclaw ibuclaw requested review from TurkeyMan, kinke and Geod24 August 22, 2021 15:47
@ibuclaw ibuclaw requested a review from WalterBright as a code owner August 22, 2021 15:47
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + druntime#3552"

@ibuclaw
Copy link
Member Author

ibuclaw commented Aug 22, 2021

Added tests that pass with GDC.

@ibuclaw
Copy link
Member Author

ibuclaw commented Aug 22, 2021

Commented out typeinfo tests because of missing CppRuntime_Clang bindings.

Edit: Added version block for CppRuntime_Clang.

@ibuclaw
Copy link
Member Author

ibuclaw commented Aug 22, 2021

DMD's _Unwind_Exception is not aligned correctly on x86. It's a shame there isn't an __aligned__ keyword to mean the biggest alignment that any data type can require.

@Geod24
Copy link
Member

Geod24 commented Aug 25, 2021

Nice! With those, will things still be tied to the CppRuntime_ druntime was compiled with ?

@ibuclaw
Copy link
Member Author

ibuclaw commented Aug 25, 2021

Nice! With those, will things still be tied to the CppRuntime_ druntime was compiled with ?

Yes, though IIUC Clang and GCC are compatible? Probably the only two we care about in terms of movability because Microsoft doesn't use the Itanium ABI.

- Change destructors from `extern(D)` -> `@weak extern(C++)`
- Change CppRuntime_Microsoft `exception.what` from `extern(D)` -> `@weak extern(C++)`
- Add `assert(0)` to CppRuntime_Microsoft `exception._Doraise`
- Add missing `bad_exception.what` for GenericBaseException
- Add `@nogc:` to core.stdcpp.typeinfo
- Add `nothrow` to `type_info.before` and `type_info.name`
- Mark CppRuntime_Gcc `type_info` as abstract
- Add definitions to CppRuntime_Gcc and CppRuntime_Clang `bad_cast.what` and `bad_typeid.what`
@dlang-bot dlang-bot merged commit 5186774 into dlang:master Aug 25, 2021
@ibuclaw ibuclaw deleted the upstream-stdcpp-diff branch August 25, 2021 15:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants