Improve detection of global vs local variables.
Currently when a global variable is optimized out or otherwise has an unknown
location (DW_AT_location is empty) it gets reported as local.
I added two new heuristics:
- if a mangled name is present, the variable is global (or static)
- if DW_AT_location is present but invalid, the variable is global (or static)
Why not put the checks in the same line. Something like...
bool is_static_lifetime = has_explicit_mangled || (has_explicit_location && !location.IsValid());
You probably need logical operator and not the bitwise.