SemaLambda.h revision 263508
153642Sguido//===--- SemaLambda.h - Lambda Helper Functions --------------*- C++ -*-===// 260857Sdarrenr// 353642Sguido// The LLVM Compiler Infrastructure 453642Sguido// 553642Sguido// This file is distributed under the University of Illinois Open Source 653642Sguido// License. See LICENSE.TXT for details. 753642Sguido// 853642Sguido//===----------------------------------------------------------------------===// 972006Sdarrenr/// 1057126Sguido/// \file 1153642Sguido/// \brief This file provides some common utility functions for processing 1253642Sguido/// Lambdas. 1353642Sguido/// 1453642Sguido//===----------------------------------------------------------------------===// 1553642Sguido 1653642Sguido#ifndef LLVM_CLANG_SEMA_LAMBDA_H 1753642Sguido#define LLVM_CLANG_SEMA_LAMBDA_H 1853642Sguido#include "clang/AST/ASTLambda.h" 1953642Sguido#include "clang/Sema/ScopeInfo.h" 2053642Sguidonamespace clang { 2153642Sguido 2253642Sguido// Given a lambda's call operator and a variable (or null for 'this'), 2353642Sguido// compute the nearest enclosing lambda that is capture-ready (i.e 2453642Sguido// the enclosing context is not dependent, and all intervening lambdas can 2553642Sguido// either implicitly or explicitly capture Var) 2653642Sguido// 2753642Sguido// Return the CallOperator of the capturable lambda and set function scope 2853642Sguido// index to the correct index within the function scope stack to correspond 2953642Sguido// to the capturable lambda. 3053642Sguido// If VarDecl *VD is null, we check for 'this' capture. 3160857SdarrenrCXXMethodDecl* 3260857SdarrenrGetInnermostEnclosingCapturableLambda( 3360857Sdarrenr ArrayRef<sema::FunctionScopeInfo*> FunctionScopes, 3460857Sdarrenr unsigned &FunctionScopeIndex, 3560857Sdarrenr DeclContext *const CurContext, VarDecl *VD, Sema &S); 3653642Sguido 3753642Sguido} // clang 3853642Sguido 3953642Sguido#endif // LLVM_CLANG_SEMA_LAMBDA_H 4053642Sguido