[Lldb-commits] [PATCH] D122293: [wip][intelpt] Refactoring instruction decoding for flexibility
Alisamar Husain via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 23 23:07:22 PDT 2022
zrthxn marked 8 inline comments as done.
zrthxn 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;
----------------
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
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