<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 14, 2016 at 1:38 PM Sean Callanan via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
     Instruction::Operand *origin_operand = nullptr;<br class="gmail_msg">
-    if (operands[0].m_type == Instruction::Operand::Type::Register &&<br class="gmail_msg">
-        operands[0].m_clobbered == true && operands[0].m_register == reg) {<br class="gmail_msg">
-      // operands[0] is a register operand<br class="gmail_msg">
+    std::function<bool(const Instruction::Operand &)> clobbered_reg_matcher =<br class="gmail_msg">
+        [reg_info](const Instruction::Operand &op) {<br class="gmail_msg">
+          return MatchRegOp(*reg_info)(op) && op.m_clobbered;<br class="gmail_msg">
+        };<br class="gmail_msg"></blockquote><div>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.</div></div></div>