SemaLambda.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- SemaLambda.h - Lambda Helper Functions --------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. ///
  14. /// \file
  15. /// This file provides some common utility functions for processing
  16. /// Lambdas.
  17. ///
  18. //===----------------------------------------------------------------------===//
  19. #ifndef LLVM_CLANG_SEMA_SEMALAMBDA_H
  20. #define LLVM_CLANG_SEMA_SEMALAMBDA_H
  21. #include "clang/AST/ASTLambda.h"
  22. namespace clang {
  23. namespace sema {
  24. class FunctionScopeInfo;
  25. }
  26. class Sema;
  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. Optional<unsigned> getStackIndexOfNearestEnclosingCaptureCapableLambda(
  34. ArrayRef<const sema::FunctionScopeInfo *> FunctionScopes,
  35. VarDecl *VarToCapture, Sema &S);
  36. } // clang
  37. #endif
  38. #ifdef __GNUC__
  39. #pragma GCC diagnostic pop
  40. #endif