[llvm] 7ecd2a2 - [SelectionDAG] Fix missing lambda capture
Marco Elver via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 2 14:48:30 PST 2023
Author: Marco Elver
Date: 2023-03-02T23:47:36+01:00
New Revision: 7ecd2a23f5f74581cad1a1dc5b65af1d52876ff1
URL: https://github.com/llvm/llvm-project/commit/7ecd2a23f5f74581cad1a1dc5b65af1d52876ff1
DIFF: https://github.com/llvm/llvm-project/commit/7ecd2a23f5f74581cad1a1dc5b65af1d52876ff1.diff
LOG: [SelectionDAG] Fix missing lambda capture
Move MaxDepth into the lambda, since it is not needed outside. This
fixes some compilers that complain about missing capture:
error C3493: 'MaxDepth' cannot be implicitly captured because no
default capture mode has been specified
Fixes: f693932fbea7 ("[SelectionDAG] Transitively copy NodeExtraInfo on RAUW")
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 3b2fd7cd17d8..29c7ddcd8b96 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -12240,8 +12240,8 @@ void SelectionDAG::copyExtraInfo(SDNode *From, SDNode *To) {
// from the old From node. This avoids copying NodeExtraInfo to parts of the
// DAG that is not new and should be left untouched.
DenseSet<const SDNode *> Visited;
- constexpr int MaxDepth = 16;
auto VisitFrom = [&Visited](auto &&Self, SDNode *N, int Depth) {
+ constexpr int MaxDepth = 16;
if (Depth >= MaxDepth)
return;
if (!Visited.insert(N).second)
More information about the llvm-commits
mailing list