-
Notifications
You must be signed in to change notification settings - Fork 155
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
Abstract naming stuff #520
Comments
The final piece of the puzzle here is to create newtype wrappers for all the following. || Not cxx safe || Cxx safe || then arrange for |
It's a little orthogonal to this issue, but we may also be able to use this callback to track original names, thus unforking bindgen a little. |
This is an internal change which begins to dig us out of the mess of naming we have inside autocxx. We deal with all sorts of different kinds of identifiers - for Rust, for cxx, for C++, from bindgen - and convert between them in a fairly ad-hoc basis. It's all too fragile to be able to tackle changes like #1371. Fortunately, Rust makes it easy to solve these sorts of messes using newtype wrappers. Unfortunately, I've tried that in the past and it's got to be a huge muddle. Here's another attempt at carving off part of the space. This introduces such wrappers for two types of name: * The [bindgen_original_name] identifiers discovered in bindgen attributes; * The final name to be used for C++ function calls. There are various FIXMEs added in locations where we're converting to or from other types of name in questionable ways. A bit of #520.
This is an internal change which begins to dig us out of the mess of naming we have inside autocxx. We deal with all sorts of different kinds of identifiers - for Rust, for cxx, for C++, from bindgen - and convert between them in a fairly ad-hoc basis. It's all too fragile to be able to tackle changes like #1371. Fortunately, Rust makes it easy to solve these sorts of messes using newtype wrappers. Unfortunately, I've tried that in the past and it's got to be a huge muddle. Here's another attempt at carving off part of the space. This introduces such wrappers for two types of name: * The [bindgen_original_name] identifiers discovered in bindgen attributes; * The final name to be used for C++ function calls. There are various FIXMEs added in locations where we're converting to or from other types of name in questionable ways. A bit of #520.
I started to do some newtype wrappers in #1431. There's lots more to do. |
Here's a writeup of the current known status of name handling in autocxx. I consider this probably the worst area of technical debt within autocxx, aside from its reliance on a forked version of bindgen which is being tackled in #124. What's complicated about naming?autocxx has to deal with many different kinds of names.
In addition,
There are myriad opportunities for getting this wrong, and I'm sure there are dozens of bugs hiding in all this. What should the basic strategy be?Overall, with the benefit of hindsight:
What needs doing here
PRs very welcome for any part of this. Some of these steps will be quite easy so tagging this as good-first-issue. |
We should deal with names for functions, types and typedefs in a similar way, so that things like #494 are fixed for all of them. We should see what we can make uniform for the different analysis phases, maybe extracting to a new phase.
The text was updated successfully, but these errors were encountered: