Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit aa4b44c

Browse files
committedSep 14, 2016
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. llvm-svn: 281536
1 parent 1b9fc8e commit aa4b44c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed
 

‎lldb/source/Expression/DWARFExpression.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3335,10 +3335,9 @@ bool DWARFExpression::MatchesOperand(StackFrame &frame,
33353335
return false;
33363336
}
33373337

3338-
std::function<bool(const Instruction::Operand &)> recurse =
3339-
[&frame, fb_expr](const Instruction::Operand &child) {
3340-
return fb_expr->MatchesOperand(frame, child);
3341-
};
3338+
auto recurse = [&frame, fb_expr](const Instruction::Operand &child) {
3339+
return fb_expr->MatchesOperand(frame, child);
3340+
};
33423341

33433342
if (!offset &&
33443343
MatchUnaryOp(MatchOpType(Instruction::Operand::Type::Dereference),

‎lldb/source/Target/StackFrame.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,10 +1608,9 @@ lldb::ValueObjectSP DoGuessValueAt(StackFrame &frame, ConstString reg,
16081608
}
16091609

16101610
Instruction::Operand *origin_operand = nullptr;
1611-
std::function<bool(const Instruction::Operand &)> clobbered_reg_matcher =
1612-
[reg_info](const Instruction::Operand &op) {
1613-
return MatchRegOp(*reg_info)(op) && op.m_clobbered;
1614-
};
1611+
auto clobbered_reg_matcher = [reg_info](const Instruction::Operand &op) {
1612+
return MatchRegOp(*reg_info)(op) && op.m_clobbered;
1613+
};
16151614

16161615
if (clobbered_reg_matcher(operands[0])) {
16171616
origin_operand = &operands[1];

0 commit comments

Comments
 (0)
Please sign in to comment.