Skip to content
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

Port the class field pointer hell to self-hosted #462

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Akuli
Copy link
Owner

@Akuli Akuli commented Dec 16, 2023

Pointers in classes are always i8* in LLVM IR, so that a class can contain a pointer to itself. This way you can implement a linked list, for example. Previously this wasn't done in self-hosted compiler.

Extracted from #454.

@Akuli
Copy link
Owner Author

Akuli commented Dec 17, 2023

Something weird happens with booleans on Windows if optimizations are enabled when compiling the self-hosted compiler. It ends up getting a boolean foo that behaves so that foo as int evaluates to 255, not 0 or 1 as expected. Also, if ... or foo does not run when this happens.

This will take a while to minimize into something small, so I can make a bug report / question to LLVM. It is difficult, because the self-hosted compiler is creating bool 255, and it is a lot of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant