LLVM  3.7.0
Macros | Typedefs | Functions | Variables
BoundsChecking.cpp File Reference
#include "llvm/Transforms/Instrumentation.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/Analysis/TargetFolder.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
Include dependency graph for BoundsChecking.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "bounds-checking"
 

Typedefs

typedef IRBuilder< true,
TargetFolder
BuilderTy
 

Functions

 STATISTIC (ChecksAdded,"Bounds checks added")
 
 STATISTIC (ChecksSkipped,"Bounds checks skipped")
 
 STATISTIC (ChecksUnable,"Bounds checks unable to add")
 
 INITIALIZE_PASS (BoundsChecking,"bounds-checking","Run-time bounds checking", false, false) BasicBlock *BoundsChecking
 getTrapBB - create a basic block that traps. More...
 

Variables

static cl::opt< boolSingleTrapBB ("bounds-checking-single-trap", cl::desc("Use one trap block per function"))
 

Macro Definition Documentation

#define DEBUG_TYPE   "bounds-checking"

Definition at line 30 of file BoundsChecking.cpp.

Typedef Documentation

Definition at line 39 of file BoundsChecking.cpp.

Function Documentation

INITIALIZE_PASS ( BoundsChecking  ,
"bounds-checking"  ,
"Run-time bounds checking"  ,
false  ,
false   
)

getTrapBB - create a basic block that traps.

All overflowing conditions branch to this block. There's only one trap block per function.

Definition at line 69 of file BoundsChecking.cpp.

References llvm::BasicBlock::Create(), F(), llvm::Function::getContext(), llvm::Intrinsic::getDeclaration(), llvm::GlobalValue::getParent(), llvm::CallInst::setDoesNotReturn(), and SingleTrapBB.

STATISTIC ( ChecksAdded  ,
"Bounds checks added"   
)
STATISTIC ( ChecksSkipped  ,
"Bounds checks skipped"   
)
STATISTIC ( ChecksUnable  ,
"Bounds checks unable to add  
)

Variable Documentation

cl::opt<bool> SingleTrapBB("bounds-checking-single-trap", cl::desc("Use one trap block per function"))
static

Referenced by INITIALIZE_PASS().