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

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 14 13:40:38 PDT 2016


On Wed, Sep 14, 2016 at 1:38 PM Sean Callanan via lldb-commits <
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/03877f65/attachment.html>


More information about the lldb-commits mailing list