-
Notifications
You must be signed in to change notification settings - Fork 715
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
Parse code by source order. #2543
Conversation
56bd04e
to
ffe404a
Compare
☔ The latest upstream changes (presumably bfc5b7f) made this pull request unmergeable. Please resolve the merge conflicts. |
b2281c1
to
3ffbd90
Compare
e72bdf7
to
b8ab27a
Compare
&self, | ||
other: &Self, | ||
ctx: &BindgenContext, | ||
) -> Option<cmp::Ordering> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understood correctly, the only case where this returns None
is if neither the file is included in the other. Given that this is only called inside visit_sorted
wouldn't it be clearer to just return cmp::Ordering::Equal
in that case?
I just did a review and added a few comments, most of them are just about documentation. Could you also please document these changes in the changelog. Mainly the fact that the order of the bindings has changed and that the Also I have a last question: The evaluation of define directives is not affected by this new ordering yet, right? |
f9fe4ed
to
255bf14
Compare
No, this is simply extracting this logic from #2369 for easier review. |
255bf14
to
845829c
Compare
@reitermarkus fyi, this broke Firefox (still working on a more reduced test-case). I'm a bit confused about this change tho. You completely ignore the |
I guess none of the callers cared about the different CXChildVisit but at least the API should be simplified to reflect the fact that the return value is ignored... |
Hmmm... this is unfortunate. I'll try to review all the issues/PRs now. |
Extracted from #2369.
In order to somewhat support
#undef
, code needs to be parsed in the correct order. Previously, all macros were parsed before all variables, making it impossible to reason about whether a variable was declared before or after a macro with the same name.