LLVM  14.0.0git
Macros | Functions | Variables
CaptureTracking.cpp File Reference
#include "llvm/Analysis/CaptureTracking.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Support/CommandLine.h"
Include dependency graph for CaptureTracking.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "capture-tracking"
 

Functions

 STATISTIC (NumCaptured, "Number of pointers maybe captured")
 
 STATISTIC (NumNotCaptured, "Number of pointers not captured")
 
 STATISTIC (NumCapturedBefore, "Number of pointers maybe captured before")
 
 STATISTIC (NumNotCapturedBefore, "Number of pointers not captured before")
 

Variables

static cl::opt< unsigned > DefaultMaxUsesToExplore ("capture-tracking-max-uses-to-explore", cl::Hidden, cl::desc("Maximal number of uses to explore."), cl::init(20))
 The default value for MaxUsesToExplore argument. More...
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "capture-tracking"

Definition at line 33 of file CaptureTracking.cpp.

Function Documentation

◆ STATISTIC() [1/4]

STATISTIC ( NumCaptured  ,
"Number of pointers maybe captured"   
)

◆ STATISTIC() [2/4]

STATISTIC ( NumCapturedBefore  ,
"Number of pointers maybe captured before"   
)

◆ STATISTIC() [3/4]

STATISTIC ( NumNotCaptured  ,
"Number of pointers not captured"   
)

◆ STATISTIC() [4/4]

STATISTIC ( NumNotCapturedBefore  ,
"Number of pointers not captured before"   
)

Variable Documentation

◆ DefaultMaxUsesToExplore

cl::opt<unsigned> DefaultMaxUsesToExplore("capture-tracking-max-uses-to-explore", cl::Hidden, cl::desc("Maximal number of uses to explore."), cl::init(20))
static

The default value for MaxUsesToExplore argument.

It's relatively small to keep the cost of analysis reasonable for clients like BasicAliasAnalysis, where the results can't be cached. TODO: we should probably introduce a caching CaptureTracking analysis and use it where possible. The caching version can use much higher limit or don't have this cap at all.

Referenced by llvm::getDefaultMaxUsesToExploreForCaptureTracking(), and llvm::PointerMayBeCaptured().