LLVM API Documentation
#include "llvm/Transforms/Instrumentation.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
Go to the source code of this file.
Defines | |
#define | DEBUG_TYPE "tsan" |
Functions | |
STATISTIC (NumInstrumentedReads,"Number of instrumented reads") | |
STATISTIC (NumInstrumentedWrites,"Number of instrumented writes") | |
STATISTIC (NumOmittedReadsBeforeWrite,"Number of reads ignored due to following writes") | |
STATISTIC (NumAccessesWithBadSize,"Number of accesses with bad size") | |
STATISTIC (NumInstrumentedVtableWrites,"Number of vtable ptr writes") | |
STATISTIC (NumInstrumentedVtableReads,"Number of vtable ptr reads") | |
STATISTIC (NumOmittedReadsFromConstantGlobals,"Number of reads from constant globals") | |
STATISTIC (NumOmittedReadsFromVtable,"Number of vtable reads") | |
INITIALIZE_PASS (ThreadSanitizer,"tsan","ThreadSanitizer: detects data races.", false, false) const char *ThreadSanitizer | |
static Function * | checkInterfaceFunction (Constant *FuncOrBitcast) |
static bool | isVtableAccess (Instruction *I) |
static bool | isAtomic (Instruction *I) |
static ConstantInt * | createOrdering (IRBuilder<> *IRB, AtomicOrdering ord) |
Variables | |
static cl::opt< bool > | ClInstrumentMemoryAccesses ("tsan-instrument-memory-accesses", cl::init(true), cl::desc("Instrument memory accesses"), cl::Hidden) |
static cl::opt< bool > | ClInstrumentFuncEntryExit ("tsan-instrument-func-entry-exit", cl::init(true), cl::desc("Instrument function entry and exit"), cl::Hidden) |
static cl::opt< bool > | ClInstrumentAtomics ("tsan-instrument-atomics", cl::init(true), cl::desc("Instrument atomics"), cl::Hidden) |
static cl::opt< bool > | ClInstrumentMemIntrinsics ("tsan-instrument-memintrinsics", cl::init(true), cl::desc("Instrument memintrinsics (memset/memcpy/memmove)"), cl::Hidden) |
#define DEBUG_TYPE "tsan" |
Definition at line 46 of file ThreadSanitizer.cpp.
static Function* checkInterfaceFunction | ( | Constant * | FuncOrBitcast | ) | [static] |
Definition at line 127 of file ThreadSanitizer.cpp.
References llvm::Value::dump(), F(), and llvm::report_fatal_error().
static ConstantInt* createOrdering | ( | IRBuilder<> * | IRB, |
AtomicOrdering | ord | ||
) | [static] |
Definition at line 422 of file ThreadSanitizer.cpp.
References llvm::Acquire, llvm::AcquireRelease, llvm::IRBuilderBase::getInt32(), llvm::Monotonic, llvm::NotAtomic, llvm::Release, llvm::SequentiallyConsistent, and llvm::Unordered.
INITIALIZE_PASS | ( | ThreadSanitizer | , |
"tsan" | , | ||
"ThreadSanitizer: detects data races." | , | ||
false | , | ||
false | |||
) | const |
Definition at line 115 of file ThreadSanitizer.cpp.
static bool isAtomic | ( | Instruction * | I | ) | [static] |
Definition at line 299 of file ThreadSanitizer.cpp.
References llvm::CrossThread, and LI.
Referenced by llvm::AssemblyWriter::printInstruction(), and WriteInstruction().
static bool isVtableAccess | ( | Instruction * | I | ) | [static] |
Definition at line 233 of file ThreadSanitizer.cpp.
References llvm::Instruction::getMetadata(), and llvm::LLVMContext::MD_tbaa.
STATISTIC | ( | NumInstrumentedReads | , |
"Number of instrumented reads" | |||
) |
STATISTIC | ( | NumInstrumentedWrites | , |
"Number of instrumented writes" | |||
) |
STATISTIC | ( | NumOmittedReadsBeforeWrite | , |
"Number of reads ignored due to following writes" | |||
) |
STATISTIC | ( | NumAccessesWithBadSize | , |
"Number of accesses with bad size" | |||
) |
STATISTIC | ( | NumInstrumentedVtableWrites | , |
"Number of vtable ptr writes" | |||
) |
STATISTIC | ( | NumInstrumentedVtableReads | , |
"Number of vtable ptr reads" | |||
) |
STATISTIC | ( | NumOmittedReadsFromVtable | , |
"Number of vtable reads" | |||
) |
cl::opt<bool> ClInstrumentAtomics("tsan-instrument-atomics", cl::init(true), cl::desc("Instrument atomics"), cl::Hidden) [static] |
cl::opt<bool> ClInstrumentFuncEntryExit("tsan-instrument-func-entry-exit", cl::init(true), cl::desc("Instrument function entry and exit"), cl::Hidden) [static] |
cl::opt<bool> ClInstrumentMemIntrinsics("tsan-instrument-memintrinsics", cl::init(true), cl::desc("Instrument memintrinsics (memset/memcpy/memmove)"), cl::Hidden) [static] |
cl::opt<bool> ClInstrumentMemoryAccesses("tsan-instrument-memory-accesses", cl::init(true), cl::desc("Instrument memory accesses"), cl::Hidden) [static] |