LLVM  10.0.0svn
Macros | Functions | Variables
PoisonChecking.cpp File Reference
#include "llvm/Transforms/Instrumentation/PoisonChecking.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/Debug.h"
Include dependency graph for PoisonChecking.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "poison-checking"
 

Functions

static bool isConstantFalse (Value *V)
 
static ValuebuildOrChain (IRBuilder<> &B, ArrayRef< Value *> Ops)
 
static void generatePoisonChecksForBinOp (Instruction &I, SmallVector< Value *, 2 > &Checks)
 
static ValuegeneratePoisonChecks (Instruction &I)
 
static ValuegetPoisonFor (DenseMap< Value *, Value *> &ValToPoison, Value *V)
 
static void CreateAssert (IRBuilder<> &B, Value *Cond)
 
static void CreateAssertNot (IRBuilder<> &B, Value *Cond)
 
static bool rewrite (Function &F)
 

Variables

static cl::opt< boolLocalCheck ("poison-checking-function-local", cl::init(false), cl::desc("Check that returns are non-poison (for testing)"))
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "poison-checking"

Definition at line 76 of file PoisonChecking.cpp.

Function Documentation

◆ buildOrChain()

static Value* buildOrChain ( IRBuilder<> &  B,
ArrayRef< Value *>  Ops 
)
static

◆ CreateAssert()

static void CreateAssert ( IRBuilder<> &  B,
Value Cond 
)
static

Definition at line 237 of file PoisonChecking.cpp.

◆ CreateAssertNot()

static void CreateAssertNot ( IRBuilder<> &  B,
Value Cond 
)
static

Definition at line 251 of file PoisonChecking.cpp.

Referenced by rewrite().

◆ generatePoisonChecks()

static Value* generatePoisonChecks ( Instruction I)
static

◆ generatePoisonChecksForBinOp()

static void generatePoisonChecksForBinOp ( Instruction I,
SmallVector< Value *, 2 > &  Checks 
)
static

◆ getPoisonFor()

static Value* getPoisonFor ( DenseMap< Value *, Value *> &  ValToPoison,
Value V 
)
static

◆ isConstantFalse()

static bool isConstantFalse ( Value V)
static

Definition at line 84 of file PoisonChecking.cpp.

References assert(), llvm::Value::getType(), and llvm::Type::isIntegerTy().

Referenced by buildOrChain().

◆ rewrite()

static bool rewrite ( Function F)
static

Variable Documentation

◆ LocalCheck

cl::opt<bool> LocalCheck("poison-checking-function-local", cl::init(false), cl::desc("Check that returns are non-poison (for testing)"))
static

Referenced by rewrite().