-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Conversation
This allows temporary destinations for function calls to have their allocas omitted.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
@bors r+ |
📌 Commit 73790f0 has been approved by |
It would be nice if you were to refactor the early-intrinsic logic to its own method too. |
@arielb1 I plan on tackling intrinsics soon anyway, so that logic will probably be disappearing. |
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 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.
@bors r=arielb1 |
📌 Commit cb1bec9 has been approved by |
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.
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.
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.