clang 22.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#include <optional>
20
21namespace clang {
22namespace sema {
24}
25class Sema;
26
27/// Examines the FunctionScopeInfo stack to determine the nearest
28/// enclosing lambda (to the current lambda) that is 'capture-capable' for
29/// the variable referenced in the current lambda (i.e. \p VarToCapture).
30/// If successful, returns the index into Sema's FunctionScopeInfo stack
31/// of the capture-capable lambda's LambdaScopeInfo.
32/// See Implementation for more detailed comments.
33
36 ValueDecl *VarToCapture, Sema &S);
37
38} // clang
39
40#endif
This file provides some common utility functions for processing Lambda related AST Constructs.
Sema - This implements semantic analysis and AST building for C.
Definition Sema.h:854
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:711
Retains information about a function, method, or block that is currently being parsed.
Definition ScopeInfo.h:104
The JSON file list parser is used to communicate input to InstallAPI.
UnsignedOrNone getStackIndexOfNearestEnclosingCaptureCapableLambda(ArrayRef< const sema::FunctionScopeInfo * > FunctionScopes, ValueDecl *VarToCapture, Sema &S)
Examines the FunctionScopeInfo stack to determine the nearest enclosing lambda (to the current lambda...