-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Improve implicit calling convention parameter handling #53
Labels
Area-OutputGeneration
Issues concerning the process of generating output from Biohazrd
Area-Translation
Issues concerning the translation from libclang into Biohazrd
Concept-Correctness
Issues concerning the correctness of the translation from an ABI perspective
Comments
PathogenDavid
added a commit
that referenced
this issue
Jun 21, 2021
…ge of Clang's code generation module. In short, this change replaces ClangSharpExtensions.[Record]MustBePassedByReference with ClangSharp.Pathogen.PathogenArrangedFunction, which uses Clang's code generation module to determine how a function call should be constructed. This moves Biohazrd's handling of whether a type is returned/passed by reference from TranslatedRecord to TranslatedFunction and TranslatedParameter. This change does not include support for function pointers or vtable entries as those will require extra effort. (VTables need to be reworked to fix #147 first. Function pointers don't support most ABI concerns in general #186.) Fixes #35 (Fixed leaking return buffer semantics on global functions and static methods. Fixed as a side-effect.) Contributes to #53 (Cleaning up ABI handling.) Contributed to #108 (Linux support.) Fixes #187 (Records with constructors not being returned by reference on Microsoft x64.) Fixes #135 (Indirectly since this problematic method was obsoleted.)
PathogenDavid
added a commit
that referenced
this issue
Jun 21, 2021
…ge of Clang's code generation module. In short, this change replaces ClangSharpExtensions.[Record]MustBePassedByReference with ClangSharp.Pathogen.PathogenArrangedFunction, which uses Clang's code generation module to determine how a function call should be constructed. This moves Biohazrd's handling of whether a type is returned/passed by reference from TranslatedRecord to TranslatedFunction and TranslatedParameter. This change does not include support for function pointers or vtable entries as those will require extra effort. (VTables need to be reworked to fix #147 first. Function pointers don't support most ABI concerns in general #186.) Fixes #35 (Fixed leaking return buffer semantics on global functions and static methods. Fixed as a side-effect.) Contributes to #53 (Cleaning up ABI handling.) Contributes to #108 (Linux support.) Fixes #187 (Records with constructors not being returned by reference on Microsoft x64.) Fixes #135 (Indirectly since this problematic method was obsoleted.)
PathogenDavid
added a commit
that referenced
this issue
Jul 4, 2021
…ge of Clang's code generation module. In short, this change replaces ClangSharpExtensions.[Record]MustBePassedByReference with ClangSharp.Pathogen.PathogenArrangedFunction, which uses Clang's code generation module to determine how a function call should be constructed. This moves Biohazrd's handling of whether a type is returned/passed by reference from TranslatedRecord to TranslatedFunction and TranslatedParameter. This change does not include support for function pointers or vtable entries as those will require extra effort. (VTables need to be reworked to fix #147 first. Function pointers don't support most ABI concerns in general #186.) Fixes #35 (Fixed leaking return buffer semantics on global functions and static methods. Fixed as a side-effect.) Contributes to #53 (Cleaning up ABI handling.) Contributes to #108 (Linux support.) Fixes #187 (Records with constructors not being returned by reference on Microsoft x64.) Fixes #135 (Indirectly since this problematic method was obsoleted.)
PathogenDavid
added a commit
that referenced
this issue
Jul 4, 2021
…d reworked things to use the corresponding TranslatedFunction instead. Fixes #147 (Type information redundant between TranslatedFunction and TranslatedVTableEntry.) Contributes to #53 (ABI handling in TranslatedVTableEntry was elimintated.) Fixes #103 (VTable entries using the base type for this in child vtables.)
14 tasks
PathogenDavid
added a commit
that referenced
this issue
Jul 5, 2021
…ge of Clang's code generation module. In short, this change replaces ClangSharpExtensions.[Record]MustBePassedByReference with ClangSharp.Pathogen.PathogenArrangedFunction, which uses Clang's code generation module to determine how a function call should be constructed. This moves Biohazrd's handling of whether a type is returned/passed by reference from TranslatedRecord to TranslatedFunction and TranslatedParameter. This change does not include support for function pointers or vtable entries as those will require extra effort. (VTables need to be reworked to fix #147 first. Function pointers don't support most ABI concerns in general #186.) Fixes #35 (Fixed leaking return buffer semantics on global functions and static methods. Fixed as a side-effect.) Contributes to #53 (Cleaning up ABI handling.) Contributes to #108 (Linux support.) Fixes #187 (Records with constructors not being returned by reference on Microsoft x64.) Fixes #135 (Indirectly since this problematic method was obsoleted.)
PathogenDavid
added a commit
that referenced
this issue
Jul 5, 2021
…d reworked things to use the corresponding TranslatedFunction instead. Fixes #147 (Type information redundant between TranslatedFunction and TranslatedVTableEntry.) Contributes to #53 (ABI handling in TranslatedVTableEntry was elimintated.) Fixes #103 (VTable entries using the base type for this in child vtables.)
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-Translation
Issues concerning the translation from libclang into Biohazrd
Concept-Correctness
Issues concerning the correctness of the translation from an ABI perspective
Right now the handling of implicit parameters is done in multiple different places in two different ways and neither strategy is ideal for resolving future issues. (The current behavior is basically hard-coded for Microsoft x64.)
It's currently handled in:
CSharpLibraryGenerator.EmitFunctionParameterList
-- the implicit parameters/arguments are emitted as appropriate.Removed, essentially handled byTranslatedVTableEntry
-- theFunctionPointerTypeReference
is modified to add the parameters.EmitFunctionParameterList
now.This specific hack was removed in e498d90, but regardless this function was reworked to handle ABI stuff correctly. It is still separate fromCSharpLibraryGenerator.WriteType
-- there's a special case forFunctionPointerTypeReference
to addout
to the retbuf parameter in the context of a vTable entry.EmityFunctionParameterList
for simplicity's sake, but the information all comes from a single source now (PathogenArrangedFunction
.)The text was updated successfully, but these errors were encountered: