clang  14.0.0git
SemaLambda.h
Go to the documentation of this file.
1 //===--- SemaLambda.h - Lambda Helper Functions --------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This file provides some common utility functions for processing
11 /// Lambdas.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CLANG_SEMA_SEMALAMBDA_H
16 #define LLVM_CLANG_SEMA_SEMALAMBDA_H
17 
18 #include "clang/AST/ASTLambda.h"
19 
20 namespace clang {
21 namespace sema {
22 class FunctionScopeInfo;
23 }
24 class Sema;
25 
26 /// Examines the FunctionScopeInfo stack to determine the nearest
27 /// enclosing lambda (to the current lambda) that is 'capture-capable' for
28 /// the variable referenced in the current lambda (i.e. \p VarToCapture).
29 /// If successful, returns the index into Sema's FunctionScopeInfo stack
30 /// of the capture-capable lambda's LambdaScopeInfo.
31 /// See Implementation for more detailed comments.
32 
34  ArrayRef<const sema::FunctionScopeInfo *> FunctionScopes,
35  VarDecl *VarToCapture, Sema &S);
36 
37 } // clang
38 
39 #endif
llvm::Optional
Definition: LLVM.h:40
ASTLambda.h
clang::getStackIndexOfNearestEnclosingCaptureCapableLambda
Optional< unsigned > getStackIndexOfNearestEnclosingCaptureCapableLambda(ArrayRef< const sema::FunctionScopeInfo * > FunctionScopes, VarDecl *VarToCapture, Sema &S)
Examines the FunctionScopeInfo stack to determine the nearest enclosing lambda (to the current lambda...
Definition: SemaLambda.cpp:173
clang
Definition: CalledOnceCheck.h:17