================
@@ -387,24 +439,24 @@ std::vector<std::string>
VariableAnnotator::Annotate(Instruction &inst) {
auto it = m_live_vars.find(KV.first);
if (it == m_live_vars.end()) {
// Newly live.
- events.emplace_back(
- llvm::formatv("{0} = {1}", KV.second.name,
KV.second.last_loc).str());
- } else if (it->second.last_loc != KV.second.last_loc) {
+ AddVariableAnnotationToVector(annotations, KV.second, true);
+ } else if (it->second.location_description !=
+ KV.second.location_description) {
// Location changed.
- events.emplace_back(
- llvm::formatv("{0} = {1}", KV.second.name,
KV.second.last_loc).str());
+ AddVariableAnnotationToVector(annotations, KV.second, true);
}
}
- // 2) Ends: anything that was live but is not in current_vars becomes
<undef>.
- for (const auto &KV : m_live_vars) {
- if (!current_vars.count(KV.first))
- events.emplace_back(llvm::formatv("{0} = <undef>",
KV.second.name).str());
- }
+ // 2) Ends: anything that was live but is not in current_vars becomes
+ // UndefLocation.
+ for (const auto &KV : m_live_vars)
+ if (!current_vars.count(KV.first)) {
+ AddVariableAnnotationToVector(annotations, KV.second, false);
+ }
----------------
JDevlieghere wrote:
```suggestion
if (!current_vars.count(KV.first))
AddVariableAnnotationToVector(annotations, KV.second, false);
```
https://github.com/llvm/llvm-project/pull/169408
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits