1//===--- SemaLambda.h - Lambda Helper Functions --------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9///
10/// \file
11/// \brief This file provides some common utility functions for processing
12/// Lambdas.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_CLANG_SEMA_LAMBDA_H
17#define LLVM_CLANG_SEMA_LAMBDA_H
18#include "clang/AST/ASTLambda.h"
19#include "clang/Sema/ScopeInfo.h"
20namespace clang {
21
22// Given a lambda's call operator and a variable (or null for 'this'),
23// compute the nearest enclosing lambda that is capture-ready (i.e
24// the enclosing context is not dependent, and all intervening lambdas can
25// either implicitly or explicitly capture Var)
26//
27// Return the CallOperator of the capturable lambda and set function scope
28// index to the correct index within the function scope stack to correspond
29// to the capturable lambda.
30// If VarDecl *VD is null, we check for 'this' capture.
31CXXMethodDecl*
32GetInnermostEnclosingCapturableLambda(
33    ArrayRef<sema::FunctionScopeInfo*> FunctionScopes,
34    unsigned &FunctionScopeIndex,
35    DeclContext *const CurContext, VarDecl *VD, Sema &S);
36
37} // clang
38
39#endif // LLVM_CLANG_SEMA_LAMBDA_H
40