When loops are deleted, we don't keep track of variables modified inside the loops, so the DI will contain the wrong value for these.
e.g.
int b() {
int i; for (i = 0; i < 2; i++) ; patatino(); return a;
-> 6 patatino();
7 return a; 8 } 9 int main() { b(); }
(lldb) frame var i
(int) i = 0
We mark instead these values as unavailable inserting a @llvm.dbg.value(undef to make sure we don't end up printing an incorrect value in the debugger. We could consider doing something fancier, for, e.g. constants, in the future.
PR39868.
rdar://problem/46418795
I suppose this could be just a set instead of a map now?