aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Sema/SemaLambda.h
blob: cf9fff1f1a2ae2b5c7d397fa9f48fa6b6586f09e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//===--- SemaLambda.h - Lambda Helper Functions --------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief This file provides some common utility functions for processing
/// Lambdas.
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_SEMA_LAMBDA_H
#define LLVM_CLANG_SEMA_LAMBDA_H
#include "clang/AST/ASTLambda.h"
#include "clang/Sema/ScopeInfo.h"
namespace clang {
 
// Given a lambda's call operator and a variable (or null for 'this'), 
// compute the nearest enclosing lambda that is capture-ready (i.e 
// the enclosing context is not dependent, and all intervening lambdas can 
// either implicitly or explicitly capture Var)
// 
// Return the CallOperator of the capturable lambda and set function scope 
// index to the correct index within the function scope stack to correspond 
// to the capturable lambda.
// If VarDecl *VD is null, we check for 'this' capture.
CXXMethodDecl* 
GetInnermostEnclosingCapturableLambda( 
    ArrayRef<sema::FunctionScopeInfo*> FunctionScopes,
    unsigned &FunctionScopeIndex,
    DeclContext *const CurContext, VarDecl *VD, Sema &S);

} // clang

#endif // LLVM_CLANG_SEMA_LAMBDA_H