<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Okay, one sec.</div><div class=""><br class=""></div><div class="">Sean</div><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 14, 2016, at 1:40 PM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Wed, Sep 14, 2016 at 1:38 PM Sean Callanan via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" class="">lldb-commits@lists.llvm.org</a>> wrote:<br class=""></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 class="">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>
</div></blockquote></div><br class=""></body></html>