[Lldb-commits] [PATCH] D52247: Refactor FindVariable() core functionality into StackFrame out of SBFrame

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 19 15:58:02 PDT 2018


shafik added a comment.

@jingham @clayborg @davide addressed comments w/ the exception of the lambda one which I politely disagree with.



================
Comment at: source/Target/StackFrame.cpp:1733-1738
+    if (sc.block->AppendVariables(
+            can_create, get_parent_variables, stop_if_block_is_inlined_function,
+            [this](Variable *v) { return v->IsInScope(this); },
+            &variable_list)) {
+      var_sp = variable_list.FindVariable(ConstString(name));
+    }
----------------
davide wrote:
> This is fairly unreadable IMHO. If I were you, I would hoist the lambda out.
This is exactly the case lambda were meant to address, moving it out would just add boilerplate code :-(


https://reviews.llvm.org/D52247





More information about the lldb-commits mailing list