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

Explicit vtable pointer refactor #1084

Merged
merged 6 commits into from
Oct 23, 2017

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Oct 13, 2017

r? @emilio

This should make it easier to move padding into its own pass, rather than inside codegen, which should in turn let us start handling (or at least intelligently determining when we can't handle) #pragma pack(..) and other things that affect layout in exotic ways that we can only indirectly observe.

See each commit for details.

The reason for the first commit is this: when we compare, we rustfmt both expected and actual, so the expectations don't get updated to be formatted nicely until some patch that changes what gets generated. This is annoying, however, when debugging some minor difference, and not being able to see what it is easily. Best to just bite the bullet and format all the expectations the once and make the problem go away.

@highfive
Copy link

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

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, sorry for the lag getting to this :(

}

TypeKind::Comp(ref info) => {
trace!(" comp considers its own methods and bases");
let mut result = HasVtableResult::default();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's clearer and shorter if you use No here directly instead of default.

@fitzgen fitzgen force-pushed the explicit-vtable-pointer-refactor branch from 28ebbc6 to 6f87f0b Compare October 23, 2017 16:44
@fitzgen
Copy link
Member Author

fitzgen commented Oct 23, 2017

Addressed feedback and rebased -- thanks @emilio !

@bors-servo r+

@bors-servo
Copy link

📌 Commit 6f87f0b has been approved by fitzgen

@bors-servo
Copy link

⌛ Testing commit 6f87f0b with merge 17adb13...

bors-servo pushed a commit that referenced this pull request Oct 23, 2017
…zgen

Explicit vtable pointer refactor

r? @emilio

This should make it easier to move padding into its own pass, rather than inside codegen, which should in turn let us start handling (or at least intelligently determining when we *can't* handle) `#pragma pack(..)` and other things that affect layout in exotic ways that we can only indirectly observe.

See each commit for details.

The reason for the first commit is this: when we compare, we rustfmt both expected and actual, so the expectations don't get updated to be formatted nicely until some patch that changes what gets generated. This is annoying, however, when debugging some minor difference, and not being able to see what it is easily. Best to just bite the bullet and format all the expectations the once and make the problem go away.
@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: fitzgen
Pushing 17adb13 to master...

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.

4 participants