clang API Documentation
00001 //===--- SemaLambda.h - Lambda Helper Functions --------------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 /// 00010 /// \file 00011 /// \brief This file provides some common utility functions for processing 00012 /// Lambdas. 00013 /// 00014 //===----------------------------------------------------------------------===// 00015 00016 #ifndef LLVM_CLANG_SEMA_SEMALAMBDA_H 00017 #define LLVM_CLANG_SEMA_SEMALAMBDA_H 00018 #include "clang/AST/ASTLambda.h" 00019 #include "clang/Sema/ScopeInfo.h" 00020 namespace clang { 00021 00022 00023 /// \brief Examines the FunctionScopeInfo stack to determine the nearest 00024 /// enclosing lambda (to the current lambda) that is 'capture-capable' for 00025 /// the variable referenced in the current lambda (i.e. \p VarToCapture). 00026 /// If successful, returns the index into Sema's FunctionScopeInfo stack 00027 /// of the capture-capable lambda's LambdaScopeInfo. 00028 /// See Implementation for more detailed comments. 00029 00030 Optional<unsigned> getStackIndexOfNearestEnclosingCaptureCapableLambda( 00031 ArrayRef<const sema::FunctionScopeInfo *> FunctionScopes, 00032 VarDecl *VarToCapture, Sema &S); 00033 00034 } // clang 00035 00036 #endif