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

rustc_trans: apply the debug location for the MIR Assert panic call. #35141

Merged
merged 1 commit into from
Aug 1, 2016

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Jul 31, 2016

Helps libcore build with MIR trans and debuginfo; libcore has the body of panic, which resulted in:

inlinable function call in a function with debug info must have a !dbg location
  call void @_ZN4core9panicking5panic17h585bd70cda921012E({ %str_slice, %str_slice, i32 }* @panic_loc12745)
LLVM ERROR: Broken function found, compilation aborted!

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

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

@@ -284,6 +284,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {

// After this point, bcx is the block for the call to panic.
bcx = panic_block.build();
debug_loc.apply_to_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.

I feel like this is a fairly easy stuff to overlook. I skimmed the context and haven’t found any more obvious instances of such mistake, but I feel like it is considerably easy to make similar mistake at any point in the future.

Perhaps we should consider making a wrapper of some sort for fcx.new_block?

Copy link
Member Author

Choose a reason for hiding this comment

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

When old trans is gone, we can have a simpler and less error-prone interface, i.e. a Block that always knows its debug position.

@nagisa
Copy link
Member

nagisa commented Jul 31, 2016

r=me, but I have a feeling that I will see a similar PR at some time in the future again.

@eddyb
Copy link
Member Author

eddyb commented Jul 31, 2016

@bors r=nagisa rollup

@bors
Copy link
Contributor

bors commented Jul 31, 2016

📌 Commit d1f341d has been approved by nagisa

sanxiyn added a commit to sanxiyn/rust that referenced this pull request Aug 1, 2016
rustc_trans: apply the debug location for the MIR Assert panic call.

Helps `libcore` build with MIR trans and debuginfo; libcore has the body of `panic`, which resulted in:
```
inlinable function call in a function with debug info must have a !dbg location
  call void @_ZN4core9panicking5panic17h585bd70cda921012E({ %str_slice, %str_slice, i32 }* @panic_loc12745)
LLVM ERROR: Broken function found, compilation aborted!
```
bors added a commit that referenced this pull request Aug 1, 2016
Rollup of 8 pull requests

- Successful merges: #34802, #35033, #35085, #35114, #35134, #35140, #35141, #35157
- Failed merges:
@bors bors merged commit d1f341d into rust-lang:master Aug 1, 2016
@eddyb eddyb deleted the assert-mir-debug branch March 9, 2017 13:40
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.

5 participants