Skip to content

Remove WrapNonBlittableTypesWhereNecessaryTransformation and make NativeBoolean/NativeChar an output implementation detail #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PathogenDavid opened this issue Jul 5, 2021 · 0 comments
Labels
Area-OutputGeneration Issues concerning the process of generating output from Biohazrd Area-Transformation Issues concerning Biohazrd transformations Concept-OutputFriendliness Issues concerning the friendliness of using the Biohazrd output Workaround

Comments

@PathogenDavid
Copy link
Member

PathogenDavid commented Jul 5, 2021

Edit: Decided this was extra double-plus annoying and decided to quickly fix it using the first option described below.

However this has revealed that NativeBoolean/NativeChar are a bit of an annoying edge case to be handled. We should consider the second option below to make it so that we don't generally have to worry about them.


An unfortunate side-effect of #147 is that we can't use NativeBoolean on the vtable pointer type and bool on the corresponding TranslatedFunction.

Ideally we'd use NativeBoolean for the vtable pointer but bool for the trampoline. However doing that is somewhat more complex now.

There's multiple ways to handle this and I'm not sure which I want to go with so I'm deferring this for the time being since it's not a huge deal. As a workaround I'm going to modify WrapNonBlittableTypesWhereNecessaryTransformation to always wrap bool/char on virtual methods.

  • Transform virtual methods to use wrappers and modify the trampoline emit to use bool/char when emitting types for the trampoline.
  • Remove WrapNonBlittableTypesWhereNecessaryTransformation and have the output stage responsible for wrapping bool/char instead. (If we do this, the output stage needs to know to add the wrappers or we need to move them to a support library of some kind.
@PathogenDavid PathogenDavid added Area-Transformation Issues concerning Biohazrd transformations Area-OutputGeneration Issues concerning the process of generating output from Biohazrd Concept-OutputFriendliness Issues concerning the friendliness of using the Biohazrd output Workaround labels Jul 5, 2021
@PathogenDavid PathogenDavid changed the title Don't leak NativeBooolean and NativeChar outside of virtual method trampolines Remove WrapNonBlittableTypesWhereNecessaryTransformation and make NativeBoolean/NativeChar an output implementation detail Jul 5, 2021
PathogenDavid added a commit that referenced this issue Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-OutputGeneration Issues concerning the process of generating output from Biohazrd Area-Transformation Issues concerning Biohazrd transformations Concept-OutputFriendliness Issues concerning the friendliness of using the Biohazrd output Workaround
Projects
None yet
Development

No branches or pull requests

1 participant