LLVM API Documentation

Defines | 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/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 "llvm/Target/TargetLibraryInfo.h"
Include dependency graph for BoundsChecking.cpp:

Go to the source code of this file.

Defines

#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"))

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