@@ -7,9 +7,7 @@ use rustc_data_structures::graph::dominators::Dominators;
7
7
use rustc_index:: bit_set:: BitSet ;
8
8
use rustc_index:: vec:: { Idx , IndexVec } ;
9
9
use rustc_middle:: mir:: traversal;
10
- use rustc_middle:: mir:: visit:: {
11
- MutatingUseContext , NonMutatingUseContext , NonUseContext , PlaceContext , Visitor ,
12
- } ;
10
+ use rustc_middle:: mir:: visit:: { MutatingUseContext , NonMutatingUseContext , PlaceContext , Visitor } ;
13
11
use rustc_middle:: mir:: { self , Location , TerminatorKind } ;
14
12
use rustc_middle:: ty;
15
13
use rustc_middle:: ty:: layout:: HasTyCtxt ;
@@ -21,7 +19,9 @@ pub fn non_ssa_locals<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
21
19
let mir = fx. mir ;
22
20
let mut analyzer = LocalAnalyzer :: new ( fx) ;
23
21
24
- analyzer. visit_body ( & mir) ;
22
+ for ( bb, data) in mir. basic_blocks ( ) . iter_enumerated ( ) {
23
+ analyzer. visit_basic_block_data ( bb, data) ;
24
+ }
25
25
26
26
for ( local, decl) in mir. local_decls . iter_enumerated ( ) {
27
27
let ty = fx. monomorphize ( decl. ty ) ;
@@ -142,36 +142,7 @@ impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
142
142
143
143
if let mir:: ProjectionElem :: Deref = elem {
144
144
// Deref projections typically only read the pointer.
145
- // (the exception being `VarDebugInfo` contexts, handled below)
146
145
base_context = PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: Copy ) ;
147
-
148
- // Indirect debuginfo requires going through memory, that only
149
- // the debugger accesses, following our emitted DWARF pointer ops.
150
- //
151
- // FIXME(eddyb) Investigate the possibility of relaxing this, but
152
- // note that `llvm.dbg.declare` *must* be used for indirect places,
153
- // even if we start using `llvm.dbg.value` for all other cases,
154
- // as we don't necessarily know when the value changes, but only
155
- // where it lives in memory.
156
- //
157
- // It's possible `llvm.dbg.declare` could support starting from
158
- // a pointer that doesn't point to an `alloca`, but this would
159
- // only be useful if we know the pointer being `Deref`'d comes
160
- // from an immutable place, and if `llvm.dbg.declare` calls
161
- // must be at the very start of the function, then only function
162
- // arguments could contain such pointers.
163
- if context == PlaceContext :: NonUse ( NonUseContext :: VarDebugInfo ) {
164
- // We use `NonUseContext::VarDebugInfo` for the base,
165
- // which might not force the base local to memory,
166
- // so we have to do it manually.
167
- self . visit_local ( & place_ref. local , context, location) ;
168
- }
169
- }
170
-
171
- // `NonUseContext::VarDebugInfo` needs to flow all the
172
- // way down to the base local (see `visit_local`).
173
- if context == PlaceContext :: NonUse ( NonUseContext :: VarDebugInfo ) {
174
- base_context = context;
175
146
}
176
147
177
148
self . process_place ( & place_base, base_context, location) ;
0 commit comments