Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:37:04

0001 //===--- SemaLambda.h - Lambda Helper Functions --------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 ///
0009 /// \file
0010 /// This file provides some common utility functions for processing
0011 /// Lambdas.
0012 ///
0013 //===----------------------------------------------------------------------===//
0014 
0015 #ifndef LLVM_CLANG_SEMA_SEMALAMBDA_H
0016 #define LLVM_CLANG_SEMA_SEMALAMBDA_H
0017 
0018 #include "clang/AST/ASTLambda.h"
0019 #include <optional>
0020 
0021 namespace clang {
0022 namespace sema {
0023 class FunctionScopeInfo;
0024 }
0025 class Sema;
0026 
0027 /// Examines the FunctionScopeInfo stack to determine the nearest
0028 /// enclosing lambda (to the current lambda) that is 'capture-capable' for
0029 /// the variable referenced in the current lambda (i.e. \p VarToCapture).
0030 /// If successful, returns the index into Sema's FunctionScopeInfo stack
0031 /// of the capture-capable lambda's LambdaScopeInfo.
0032 /// See Implementation for more detailed comments.
0033 
0034 std::optional<unsigned> getStackIndexOfNearestEnclosingCaptureCapableLambda(
0035     ArrayRef<const sema::FunctionScopeInfo *> FunctionScopes,
0036     ValueDecl *VarToCapture, Sema &S);
0037 
0038 } // clang
0039 
0040 #endif