[Lldb-commits] [PATCH] D122293: [wip][intelpt] Refactoring instruction decoding for flexibility

Jakob Johnson via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 23 12:56:15 PDT 2022


jj10306 added inline comments.


================
Comment at: lldb/source/Plugins/Trace/intel-pt/DecodedThread.h:152
+  ///   The errors of the trace.
+  std::unordered_map<uint64_t, llvm::Error> GetErrors() const;
+
----------------
Return a reference here to avoid potential expensive copy when returning.

Something else to consider is if we need/want an API exposing all the entire error map or if something like:
`llvm::Error GetErrorByInstructionIndex(uint64_t insn_index) const` that allows the caller to specify the key into the map would make more sense? 
This also has the advantage that it hides the implementation detail of what data type is being used under the hood to represent the error map!
@wallace @zrthxn wdyt?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122293/new/

https://reviews.llvm.org/D122293



More information about the lldb-commits mailing list