• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===----- llvm/Analysis/CaptureTracking.h - Pointer capture ----*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains routines that help determine which pointers are captured.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_ANALYSIS_CAPTURETRACKING_H
15 #define LLVM_ANALYSIS_CAPTURETRACKING_H
16 
17 namespace llvm {
18   class Value;
19 
20   /// PointerMayBeCaptured - Return true if this pointer value may be captured
21   /// by the enclosing function (which is required to exist).  This routine can
22   /// be expensive, so consider caching the results.  The boolean ReturnCaptures
23   /// specifies whether returning the value (or part of it) from the function
24   /// counts as capturing it or not.  The boolean StoreCaptures specified
25   /// whether storing the value (or part of it) into memory anywhere
26   /// automatically counts as capturing it or not.
27   bool PointerMayBeCaptured(const Value *V,
28                             bool ReturnCaptures,
29                             bool StoreCaptures);
30 
31 } // end namespace llvm
32 
33 #endif
34