wallace added inline comments.

================
Comment at: lldb/source/Plugins/Trace/intel-pt/IntelPTDecoder.cpp:149
+        thread.AppendError(insn_index, make_error<IntelPTError>(time_error, 
insn.ip));
+        thread.AppendInstruction(IntelPTInstruction(insn));
         break;
----------------
zrthxn wrote:
> wallace wrote:
> > This will create a copy of the IntelPTInstruction before storing it in the 
> > vector. Instead, you should use the same semantics as 
> > vector::emplace_back(), which uses paratemer packs/variadic templates. You 
> > can even rename Append to Emplace in this case
> Yea I was doing that before, the idea was to send those variadic args to 
> emplace_back but that wasnt working. I introduced this to avoid having 2 
> Appends since we already have 2 constructors which fulfill that requirement, 
> and I can change this to std::move to avoid copies if thats a concern
Yes, use the same pattern than emolace_back uses with a parameter pack


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122293

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to