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

Handle operand temps for function calls #32738

Merged
merged 3 commits into from
Apr 8, 2016

Conversation

Aatch
Copy link
Contributor

@Aatch Aatch commented Apr 5, 2016

Previously, all non-void function returns required an on-stack location for the value to be stored to. This code improves translation of function calls so this is no longer necessary.

This allows temporary destinations for function calls to have their
allocas omitted.
@rust-highfive
Copy link
Collaborator

r? @arielb1

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

@@ -45,8 +45,9 @@ impl fmt::Debug for CodeExtent {

ty::tls::with_opt(|opt_tcx| {
if let Some(tcx) = opt_tcx {
let data = tcx.region_maps.code_extents.borrow()[self.0 as usize];
write!(f, "/{:?}", data)?;
if let Some(data) = tcx.region_maps.code_extents.borrow().get(self.0 as usize) {
Copy link
Contributor

Choose a reason for hiding this comment

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

who is creating invalid regions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure, I think it might be a cross-crate thing as the out-of-bounds index was much larger the size of the map and appeared while compiling a function from another crate.

It's quite a large amount of code, and moving it into a method allowed
for some refactoring to make the logic a little easier to understand
@arielb1
Copy link
Contributor

arielb1 commented Apr 6, 2016

@bors r+

@bors
Copy link
Contributor

bors commented Apr 6, 2016

📌 Commit 73790f0 has been approved by arielb1

@arielb1
Copy link
Contributor

arielb1 commented Apr 6, 2016

It would be nice if you were to refactor the early-intrinsic logic to its own method too.

@Aatch
Copy link
Contributor Author

Aatch commented Apr 7, 2016

@arielb1 I plan on tackling intrinsics soon anyway, so that logic will probably be disappearing.

Manishearth added a commit to Manishearth/rust that referenced this pull request Apr 7, 2016
Handle operand temps for function calls

Previously, all non-void function returns required an on-stack location for the value to be stored to. This code improves translation of function calls so this is no longer necessary.
bors added a commit that referenced this pull request Apr 7, 2016
Rollup of 11 pull requests

- Successful merges: #32016, #32583, #32699, #32729, #32731, #32738, #32741, #32745, #32748, #32757, #32786
- Failed merges: #32773
@Aatch
Copy link
Contributor Author

Aatch commented Apr 7, 2016

@bors r-

This has a some bugs I need to fix up.

Some types weren't being properly monomorphised, and didn't have their
regions properly erased. This is now fixed.

Also fixes an issue where a temp was initialized in two separate
branches, but wasn't given an alloca.
@Aatch
Copy link
Contributor Author

Aatch commented Apr 8, 2016

@bors r=arielb1

@bors
Copy link
Contributor

bors commented Apr 8, 2016

📌 Commit cb1bec9 has been approved by arielb1

Manishearth added a commit to Manishearth/rust that referenced this pull request Apr 8, 2016
 Previously, all non-void function returns required an on-stack location for the value to be stored to. This code improves translation of function calls so this is no longer necessary.
@bors
Copy link
Contributor

bors commented Apr 8, 2016

⌛ Testing commit cb1bec9 with merge 7e99694...

bors added a commit that referenced this pull request Apr 8, 2016
Handle operand temps for function calls

Previously, all non-void function returns required an on-stack location for the value to be stored to. This code improves translation of function calls so this is no longer necessary.
@bors bors merged commit cb1bec9 into rust-lang:master Apr 8, 2016
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