[Lldb-commits] [PATCH] D46551: Inject only relevant local variables in the expression evaluation context

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon May 7 15:32:42 PDT 2018


clayborg added inline comments.


================
Comment at: source/Expression/ExpressionSourceCode.cpp:174-179
+    if ((from != 0 && clang::isIdentifierBody(body[from-1])) ||
+        (from + var.size() != body.size() &&
+         clang::isIdentifierBody(body[from+var.size()]))) {
+      ++from;
+      continue;
+    }
----------------
Might be clearer as:

```
const int prev = from-1;
if (prev >= 0 && clang::isIdentifierBody(body[prev]))
  continue;
const int next = from + var.size()
if (next == body.size() || clang::isIdentifierBody(body[next]))
  continue;
```


https://reviews.llvm.org/D46551





More information about the lldb-commits mailing list