diff options
Diffstat (limited to 'clang/lib/AST/StmtProfile.cpp')
| -rw-r--r-- | clang/lib/AST/StmtProfile.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index 8ade242d56d..4a3448c1e5f 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -822,9 +822,17 @@ StmtProfiler::VisitLambdaExpr(const LambdaExpr *S) { CEnd = S->explicit_capture_end(); C != CEnd; ++C) { ID.AddInteger(C->getCaptureKind()); - if (C->capturesVariable()) { + switch (C->getCaptureKind()) { + case LCK_This: + break; + case LCK_ByRef: + case LCK_ByCopy: VisitDecl(C->getCapturedVar()); ID.AddBoolean(C->isPackExpansion()); + break; + case LCK_Init: + VisitDecl(C->getInitCaptureField()); + break; } } // Note: If we actually needed to be able to match lambda |

