-
Notifications
You must be signed in to change notification settings - Fork 698
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
Dump preprocessed input headers #812
Conversation
Rather than eagerly expanding multiple input headers into `-include <header>` clang arguments, store them explicitly until we actually go to generate bindings. Same deal for unsaved file contents.
This is useful when debugging bindgen, using C-Reduce on an input to bindgen, or for constructing portable test cases when filing issues against bindgen. Fixes rust-lang#811
It is both more correct and easier than using clang manually.
wrapper_contents.push_str(contents); | ||
} | ||
|
||
is_cpp |= self.options.clang_args.windows(2).any(|w| { |
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.
Won't this miss it if the last argument is -x=c++
?
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.
Nope, that's what the w[1]
check is there for. The windows
iterator returns overlapping windows, so the last argument will always eventually be w[1]
.
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.
r=me, with that one fixed
@bors-servo r=emilio |
📌 Commit 618dafe has been approved by |
☀️ Test successful - status-travis |
See each commit message.
Fixes #811.
r? @emilio