[Lldb-commits] [lldb] r281534 - Cleaned up a little bit of redundant code in 'frame diagnose.`

Sean Callanan via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 14 14:04:45 PDT 2016


Okay, one sec.

Sean

> On Sep 14, 2016, at 1:40 PM, Zachary Turner <zturner at google.com> wrote:
> 
> 
> 
> On Wed, Sep 14, 2016 at 1:38 PM Sean Callanan via lldb-commits <lldb-commits at lists.llvm.org <mailto:lldb-commits at lists.llvm.org>> wrote:
> 
>      Instruction::Operand *origin_operand = nullptr;
> -    if (operands[0].m_type == Instruction::Operand::Type::Register &&
> -        operands[0].m_clobbered == true && operands[0].m_register == reg) {
> -      // operands[0] is a register operand
> +    std::function<bool(const Instruction::Operand &)> clobbered_reg_matcher =
> +        [reg_info](const Instruction::Operand &op) {
> +          return MatchRegOp(*reg_info)(op) && op.m_clobbered;
> +        };
> You should use `auto` here instead of `std::function`.  Putting it in a std::function is actually less efficient due to the way it's implemented, but if you use `auto` you get the actual lambda type itself.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160914/1d85ef46/attachment.html>


More information about the lldb-commits mailing list