[Lldb-commits] [lldb] r281536 - Replaced two instances of std::function with auto.

Sean Callanan via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 14 13:58:32 PDT 2016


Author: spyffe
Date: Wed Sep 14 15:58:31 2016
New Revision: 281536

URL: http://llvm.org/viewvc/llvm-project?rev=281536&view=rev
Log:
Replaced two instances of std::function with auto.

Thanks to Zachary Turner for the suggestion.  It's distasteful that the actual
type of the lambda can't be spelled out, but it should be evident from the
definition of the lambda body.

Modified:
    lldb/trunk/source/Expression/DWARFExpression.cpp
    lldb/trunk/source/Target/StackFrame.cpp

Modified: lldb/trunk/source/Expression/DWARFExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=281536&r1=281535&r2=281536&view=diff
==============================================================================
--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)
+++ lldb/trunk/source/Expression/DWARFExpression.cpp Wed Sep 14 15:58:31 2016
@@ -3335,10 +3335,9 @@ bool DWARFExpression::MatchesOperand(Sta
       return false;
     }
 
-    std::function<bool(const Instruction::Operand &)> recurse =
-        [&frame, fb_expr](const Instruction::Operand &child) {
-          return fb_expr->MatchesOperand(frame, child);
-        };
+    auto recurse = [&frame, fb_expr](const Instruction::Operand &child) {
+      return fb_expr->MatchesOperand(frame, child);
+    };
 
     if (!offset &&
         MatchUnaryOp(MatchOpType(Instruction::Operand::Type::Dereference),

Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=281536&r1=281535&r2=281536&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Wed Sep 14 15:58:31 2016
@@ -1608,10 +1608,9 @@ lldb::ValueObjectSP DoGuessValueAt(Stack
     }
 
     Instruction::Operand *origin_operand = nullptr;
-    std::function<bool(const Instruction::Operand &)> clobbered_reg_matcher =
-        [reg_info](const Instruction::Operand &op) {
-          return MatchRegOp(*reg_info)(op) && op.m_clobbered;
-        };
+    auto clobbered_reg_matcher = [reg_info](const Instruction::Operand &op) {
+      return MatchRegOp(*reg_info)(op) && op.m_clobbered;
+    };
 
     if (clobbered_reg_matcher(operands[0])) {
       origin_operand = &operands[1];




More information about the lldb-commits mailing list