Skip to content
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

Merged
merged 5 commits into from
Jul 14, 2017

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Jul 13, 2017

See each commit message.

Fixes #811.

r? @emilio

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| {
Copy link
Contributor

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++?

Copy link
Member Author

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].

Copy link
Contributor

@emilio emilio left a 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

@fitzgen
Copy link
Member Author

fitzgen commented Jul 14, 2017

@bors-servo r=emilio

@bors-servo
Copy link

📌 Commit 618dafe has been approved by emilio

@bors-servo
Copy link

⌛ Testing commit 618dafe with merge 767ac02...

bors-servo pushed a commit that referenced this pull request Jul 14, 2017
Dump preprocessed input headers

See each commit message.

Fixes #811.

r? @emilio
@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: emilio
Pushing 767ac02 to master...

@bors-servo bors-servo merged commit 618dafe into rust-lang:master Jul 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants