Elide storage markers for internal locals when inlining
This commit is contained in:
parent
162bd16352
commit
625af2cc75
1 changed files with 6 additions and 2 deletions
|
@ -616,7 +616,9 @@ impl<'tcx> Inliner<'tcx> {
|
||||||
// If there are any locals without storage markers, give them storage only for the
|
// If there are any locals without storage markers, give them storage only for the
|
||||||
// duration of the call.
|
// duration of the call.
|
||||||
for local in callee_body.vars_and_temps_iter() {
|
for local in callee_body.vars_and_temps_iter() {
|
||||||
if integrator.always_live_locals.contains(local) {
|
if !callee_body.local_decls[local].internal
|
||||||
|
&& integrator.always_live_locals.contains(local)
|
||||||
|
{
|
||||||
let new_local = integrator.map_local(local);
|
let new_local = integrator.map_local(local);
|
||||||
caller_body[callsite.block].statements.push(Statement {
|
caller_body[callsite.block].statements.push(Statement {
|
||||||
source_info: callsite.source_info,
|
source_info: callsite.source_info,
|
||||||
|
@ -629,7 +631,9 @@ impl<'tcx> Inliner<'tcx> {
|
||||||
// the slice once.
|
// the slice once.
|
||||||
let mut n = 0;
|
let mut n = 0;
|
||||||
for local in callee_body.vars_and_temps_iter().rev() {
|
for local in callee_body.vars_and_temps_iter().rev() {
|
||||||
if integrator.always_live_locals.contains(local) {
|
if !callee_body.local_decls[local].internal
|
||||||
|
&& integrator.always_live_locals.contains(local)
|
||||||
|
{
|
||||||
let new_local = integrator.map_local(local);
|
let new_local = integrator.map_local(local);
|
||||||
caller_body[block].statements.push(Statement {
|
caller_body[block].statements.push(Statement {
|
||||||
source_info: callsite.source_info,
|
source_info: callsite.source_info,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue