-
Notifications
You must be signed in to change notification settings - Fork 146
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
TODO: need to support opaque pointers #154
Comments
This would be easier to do if we had an intermediate representation within the backend. It would be helpful for other things too (not producing redundant parentheses and other type casts for example). |
We have PointerTypeAnalysis for DirectX backend to help recover the element type from opaque pointer. |
alloca still has types, and otherwise void* is equivalent, so it likely shouldn't be necessary. But someone needs to put in the effort to handle it |
Yes, void * should work for all cases. Off the topic, any plan for update to llvm 15? |
In particular though, C defines cast to/from |
Yeah, to be extra pedantic, we should only ever use |
Of note however, the intermediate types assigned to the pointee are of no relevance to that part of the C standard, only the type used for the load or store itself. |
Yeah I guess it's an existing issue and nothing is really changed by the switch to opaque types in LLVM. |
I was just about to say this. So far, the only place that I can't get to the actual type seems to be for return types and parameters in functions: I'm going to try using a modified version of the DirectX PointerTypeAnalysis to determine the types (the current analysis code loses the number of indirections, so I'll need to fork it to add in tracking for that) - unless folks are ok with all function signatures only using |
I am happy with |
Supporting opaque pointers will be a bit of a major design effort, and require a mini inference step to recover "best" types and tracking where to insert casts.
The text was updated successfully, but these errors were encountered: