[Lldb-commits] [clang] [lldb] [clang][Expr] Teach IgnoreUnlessSpelledInSource about implicit calls to std::get free function (PR #122265)

via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 16 08:06:51 PST 2025


================
@@ -3183,10 +3183,24 @@ Expr *Expr::IgnoreUnlessSpelledInSource() {
     }
     return E;
   };
+
+  auto IgnoreImplicitCallSingleStep = [](Expr *E) {
+    if (auto *C = dyn_cast<CallExpr>(E)) {
+      auto NumArgs = C->getNumArgs();
+      if (NumArgs == 1 ||
+          (NumArgs > 1 && isa<CXXDefaultArgExpr>(C->getArg(1)))) {
+        Expr *A = C->getArg(0);
+        if (A->getSourceRange() == E->getSourceRange())
+          return A;
+      }
+    }
+    return E;
+  };
+
----------------
cor3ntin wrote:

Can you add a comment explaining it's used for std::get/structured binding?

https://github.com/llvm/llvm-project/pull/122265


More information about the lldb-commits mailing list