-
Notifications
You must be signed in to change notification settings - Fork 16
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
clang2il.go: Check for desugared types (support clang-19+) #118
base: master
Are you sure you want to change the base?
Conversation
I'm working on attaching the full diff with a clean cache now. I'll push it up shortly. In hindsight, I probably should've waited to avoid the build failing. Sorry about that. |
e0572bf
to
cd3740f
Compare
Hmm, looking at the diff closer, it seems to remove a few functions. Should those be removed or should we look for re-adding them back in? They're all in qt6:
|
cd3740f
to
451f1b1
Compare
The missing functions do not look very important, we could live without them if it makes clang-19 work. I think it is fixable - Here's my (unconfirmed) theory: Taking qt6 qbrush.h QGradient::Stops as an example, the typedef has changed from "type": {
"desugaredQualType": "QList\u003cstd::pair\u003cdouble, QColor\u003e\u003e",
"qualType": "QList\u003cQGradientStop\u003e"
} With the "type": {
"desugaredQualType": "QVector\u003cQPair\u003cdouble, QColor\u003e\u003e",
"qualType": "QVector\u003cQGradientStop\u003e"
} which is apparently understood better. In that case, one possible solution would be to remove the block on std::pair. If that's not enough by itself, it may also require handling in intermediate.go QPairOf(). Miqt's comment in config-allowlist.go:318 about QGradientStop is definitely outdated 😄 |
451f1b1
to
5a90860
Compare
Good call. We now have support (however infrequent 😅) for |
b350bb3
to
7c32809
Compare
I had another look at this today. The genbindings and std::pair changes all look fine to me 👍 The remaining part of the diff converts many int types (uint64, intptr, ptrdiff) to C types (unsigned long long, etc). This conversion is platform-specific and I think it could fail on Windows where "long" has a different bit size than Linux. The CI tests win64-qt5 already, and that build passed OK. I updated the CI rules on master, so it will test win32-qt5 and win64-qt6.8 as well.
If it then passes on all those Windows platforms, then LGTM to merge. But if it doesn't pass we'll need to think more carefully about how int types are handled. |
7c32809
to
9f172ab
Compare
We could always revert these back in emitcabi.go right? I don't mind doing that or reworking the logic for the desugared types. We could skip certain desugared types or just redo the logic entirely. (This would also allow us to re-add that QHashSeed function that was just removed too right?) |
Technically the c sources become a little bit more portable if they retain |
Maybe it's a hack (just wait until you see what I've done 😆), but what if we exclude those types from the desugaring? I'm thinking a conditional for |
I guess one can grab a list from https://pubs.opengroup.org/onlinepubs/009604599/basedefs/stdint.h.html and it would hopefully cover most of it? always a mess with c, finding the right level of de-macro-and-typedef-ification ;) it's not an unreasonable starting point at least. |
9f172ab
to
53edfa2
Compare
I ended up grabbing the Qt typedefs from https://doc.qt.io/qt-6/qttypes.html too. The diff didn't change much without it. The result change in this pull request is now much smaller. |
53edfa2
to
46e9061
Compare
👍 https://pubs.opengroup.org/onlinepubs/7908799/xsh/stddef.h.html is another source, pre-c99 so probably also good to cover |
46e9061
to
a80a939
Compare
32b2181
to
33960ee
Compare
33960ee
to
24cf11d
Compare
This managed to get both hackier and cleaner at the same time. 😔 |
genbindings
doesn't work withclang-19
#116