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

Initial implementation of debuginfo in MIR trans. #32803

Merged
merged 7 commits into from
Apr 13, 2016

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Apr 7, 2016

Progress is made towards #31005, but several issues remain, such as #32790.

@rust-highfive
Copy link
Collaborator

r? @nrc

(rust_highfive has picked a reviewer for you, use r? to override)

@nikomatsakis
Copy link
Contributor

r? @nikomatsakis

@rust-highfive rust-highfive assigned nikomatsakis and unassigned nrc Apr 7, 2016
@eddyb
Copy link
Member Author

eddyb commented Apr 7, 2016

See my comment on #31005 for some explanations related to the debuginfo tests which are still not passing.

let debug_loc = DebugLoc::ScopeAt(self.scopes[terminator.scope.index()],
terminator.span);
debug_loc.apply_bcx(&bcx);
debug_loc.apply(bcx.fcx());
Copy link
Member

Choose a reason for hiding this comment

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

nit: self.fcx()

@alexcrichton
Copy link
Member

🔑

landingpad.at_start(|bcx| for op in args {
self.set_operand_dropped(bcx, op);
landingpad.at_start(|bcx| {
debug_loc.apply_bcx(bcx);
Copy link
Member

Choose a reason for hiding this comment

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

This method seriously needs a better name. debug_loc.apply_to(bcx) or debug_loc.apply_to_bcx(bcx).

let debug_loc = DebugLoc::ScopeAt(self.scopes[terminator.scope.index()],
terminator.span);
debug_loc.apply_to_bcx(&bcx);
debug_loc.apply(bcx.fcx());
Copy link
Member

Choose a reason for hiding this comment

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

This seems unnecessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sadly, old trans still exists and every with_block call makes it show up.

@brson
Copy link
Contributor

brson commented Apr 7, 2016

Solid.

}
};

unsafe {
llvm::LLVMSetCurrentDebugLocation(cx.raw_builder(), metadata_node);
if builder.is_none() {
Copy link
Member

Choose a reason for hiding this comment

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

Why is it necessary to make this conditional? It seems to me that if this condition is removed, then in MIR we can avoid doing both apply_to_bcx and apply in certain cases (only apply_to_bcx would be enough)

Copy link
Member Author

Choose a reason for hiding this comment

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

They work on different builders (global, i.e. "old", vs MIR). Without this condition, what would happen is that it would not bother setting the location in different MIR builders because it matched the last location (but the last location was set on a different builder).

@bors
Copy link
Contributor

bors commented Apr 8, 2016

☔ The latest upstream changes (presumably #32738) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis
Copy link
Contributor

cc @michaelwoerister

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 12, 2016

📌 Commit 373b6ec has been approved by nikomatsakis

@michaelwoerister
Copy link
Member

LGTM!
Some very nice cleanup of ancient code in there.

@bors
Copy link
Contributor

bors commented Apr 13, 2016

⌛ Testing commit 373b6ec with merge 7c27cce...

bors added a commit that referenced this pull request Apr 13, 2016
Initial implementation of debuginfo in MIR trans.

Progress is made towards #31005, but several issues remain, such as #32790.
@bors bors mentioned this pull request Apr 13, 2016
@bors bors merged commit 373b6ec into rust-lang:master Apr 13, 2016
@eddyb eddyb deleted the mir-debuginfo branch April 13, 2016 06:01
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.

9 participants