Skip to content

Add bit field support #3

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 Aug 22, 2020 · 1 comment
Closed

Add bit field support #3

PathogenDavid opened this issue Aug 22, 2020 · 1 comment
Assignees
Labels
Area-OutputGeneration Issues concerning the process of generating output from Biohazrd Area-Translation Issues concerning the translation from libclang into Biohazrd Concept-CppFeatures Issues concerning unsupported C++ features

Comments

@PathogenDavid
Copy link
Member

The libclang Pathogen extensions provide information about bit fields, but we don't really use it beyond marking the fields are unusable.

I think the best approach here is to make an additional TranslatedBitField type to represent them rather than trying to wedge them into TranslatedNormalField. That way the relative edge-case bit field stuff can live separate from the extremely common case of normal fields.

C# does not support bit fields, so we'd need to implement them manually using properties. This should be fine since the only thing this really does is prevent taking a reference to the bit field, which isn't something you can do regardless.

@PathogenDavid PathogenDavid added Area-OutputGeneration Issues concerning the process of generating output from Biohazrd Area-Translation Issues concerning the translation from libclang into Biohazrd Concept-CppFeatures Issues concerning unsupported C++ features labels Sep 21, 2020
@PathogenDavid PathogenDavid added this to the Upon Demonstrated Need milestone Sep 21, 2020
PathogenDavid added a commit that referenced this issue Oct 10, 2020
@PathogenDavid
Copy link
Member Author

Bit field support is complete. It hasn't been rigorously tested yet, but it's assumed that'll come with #32 or something similar.

BitFields.h contains a small suite of bit fields covering typical and edge case scenarios.

#71 was opened to cover an extreme edge case that was not covered by the initial implementation. (The output won't be totally broken in this scenario, but the values you get from a bitfield getter might not be sign-extended when they would've been in C.)

@PathogenDavid PathogenDavid self-assigned this Oct 17, 2020
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-CppFeatures Issues concerning unsupported C++ features
Projects
None yet
Development

No branches or pull requests

1 participant