================
@@ -300,16 +303,43 @@ bool Disassembler::ElideMixedSourceAndDisassemblyLine(
 // disassembled instruction stream, similar to how debug information
 // enhances source-level debugging.
 std::vector<std::string> VariableAnnotator::Annotate(Instruction &inst) {
+  std::vector<VariableAnnotation> structured_annotations =
+      AnnotateStructured(inst);
+
   std::vector<std::string> events;
+  events.reserve(structured_annotations.size());
+
+  for (const auto &annotation : structured_annotations) {
+    const llvm::StringRef location =
+        (annotation.location_description == kUndefLocation
+             ? llvm::StringRef(kUndefLocationFormatted)
+             : llvm::StringRef(annotation.location_description));
+
+    const auto display_string =
+        llvm::formatv("{0} = {1}", annotation.variable_name, location).str();
+
+    events.push_back(std::move(display_string));
----------------
JDevlieghere wrote:

Why not just inline it and avoid another `auto`?
```suggestion
    events.push_back(llvm::formatv("{0} = {1}", annotation.variable_name, 
location).str());
```

https://github.com/llvm/llvm-project/pull/169408
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to