1259701Sdim//===--- SemaLambda.h - Lambda Helper Functions --------------*- C++ -*-===//
2259701Sdim//
3259701Sdim//                     The LLVM Compiler Infrastructure
4259701Sdim//
5259701Sdim// This file is distributed under the University of Illinois Open Source
6259701Sdim// License. See LICENSE.TXT for details.
7259701Sdim//
8259701Sdim//===----------------------------------------------------------------------===//
9259701Sdim///
10259701Sdim/// \file
11259701Sdim/// \brief This file provides some common utility functions for processing
12259701Sdim/// Lambdas.
13259701Sdim///
14259701Sdim//===----------------------------------------------------------------------===//
15259701Sdim
16259701Sdim#ifndef LLVM_CLANG_SEMA_LAMBDA_H
17259701Sdim#define LLVM_CLANG_SEMA_LAMBDA_H
18259701Sdim#include "clang/AST/ASTLambda.h"
19259701Sdim#include "clang/Sema/ScopeInfo.h"
20259701Sdimnamespace clang {
21259701Sdim
22259701Sdim// Given a lambda's call operator and a variable (or null for 'this'),
23259701Sdim// compute the nearest enclosing lambda that is capture-ready (i.e
24259701Sdim// the enclosing context is not dependent, and all intervening lambdas can
25259701Sdim// either implicitly or explicitly capture Var)
26259701Sdim//
27259701Sdim// Return the CallOperator of the capturable lambda and set function scope
28259701Sdim// index to the correct index within the function scope stack to correspond
29259701Sdim// to the capturable lambda.
30259701Sdim// If VarDecl *VD is null, we check for 'this' capture.
31259701SdimCXXMethodDecl*
32259701SdimGetInnermostEnclosingCapturableLambda(
33259701Sdim    ArrayRef<sema::FunctionScopeInfo*> FunctionScopes,
34259701Sdim    unsigned &FunctionScopeIndex,
35259701Sdim    DeclContext *const CurContext, VarDecl *VD, Sema &S);
36259701Sdim
37259701Sdim} // clang
38259701Sdim
39259701Sdim#endif // LLVM_CLANG_SEMA_LAMBDA_H
40