Auto merge of #108944 - cjgillot:clear-local-info, r=oli-obk
Wrap the whole LocalInfo in ClearCrossCrate. MIR contains a lot of information about locals. The primary purpose of this information is the quality of borrowck diagnostics. This PR aims to drop this information after MIR analyses are finished, ie. starting from post-cleanup runtime MIR.
This commit is contained in:
commit
511364e787
30 changed files with 188 additions and 214 deletions
|
@ -241,12 +241,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
pub fn debug_introduce_local(&self, bx: &mut Bx, local: mir::Local) {
|
||||
let full_debug_info = bx.sess().opts.debuginfo == DebugInfo::Full;
|
||||
|
||||
// FIXME(eddyb) maybe name the return place as `_0` or `return`?
|
||||
if local == mir::RETURN_PLACE && !self.mir.local_decls[mir::RETURN_PLACE].is_user_variable()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
let vars = match &self.per_local_var_debug_info {
|
||||
Some(per_local) => &per_local[local],
|
||||
None => return,
|
||||
|
@ -303,7 +297,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
|
||||
let local_ref = &self.locals[local];
|
||||
|
||||
let name = if bx.sess().fewer_names() {
|
||||
// FIXME Should the return place be named?
|
||||
let name = if bx.sess().fewer_names() || local == mir::RETURN_PLACE {
|
||||
None
|
||||
} else {
|
||||
Some(match whole_local_var.or(fallback_var.clone()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue