LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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/IR/DataLayout.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/InstIterator.h"
#include "llvm/Support/TargetFolder.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetLibraryInfo.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
 

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 15 of file BoundsChecking.cpp.

Typedef Documentation

Definition at line 38 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 72 of file BoundsChecking.cpp.

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

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().