// Insert GCOV profiling instrumentation
ModulePass *createGCOVProfilerPass(bool EmitNotes = true, bool EmitData = true,
bool Use402Format = false,
- bool UseExtraChecksum = false);
+ bool UseExtraChecksum = false,
+ bool NoRedZone = false);
// Insert AddressSanitizer (address sanity checking) instrumentation
FunctionPass *createAddressSanitizerFunctionPass(
bool CheckLifetime = false, StringRef BlacklistFile = StringRef());
ModulePass *createAddressSanitizerModulePass(
bool CheckInitOrder = false, StringRef BlacklistFile = StringRef());
+
// Insert MemorySanitizer instrumentation (detection of uninitialized reads)
FunctionPass *createMemorySanitizerPass();
+
// Insert ThreadSanitizer (race detection) instrumentation
FunctionPass *createThreadSanitizerPass();
static char ID;
GCOVProfiler()
: ModulePass(ID), EmitNotes(true), EmitData(true), Use402Format(false),
- UseExtraChecksum(false) {
+ UseExtraChecksum(false), NoRedZone(false) {
initializeGCOVProfilerPass(*PassRegistry::getPassRegistry());
}
GCOVProfiler(bool EmitNotes, bool EmitData, bool use402Format = false,
- bool useExtraChecksum = false)
+ bool useExtraChecksum = false, bool NoRedZone = false)
: ModulePass(ID), EmitNotes(EmitNotes), EmitData(EmitData),
Use402Format(use402Format), UseExtraChecksum(useExtraChecksum) {
assert((EmitNotes || EmitData) && "GCOVProfiler asked to do nothing?");
bool EmitData;
bool Use402Format;
bool UseExtraChecksum;
+ bool NoRedZone;
Module *M;
LLVMContext *Ctx;
ModulePass *llvm::createGCOVProfilerPass(bool EmitNotes, bool EmitData,
bool Use402Format,
- bool UseExtraChecksum) {
- return new GCOVProfiler(EmitNotes, EmitData, Use402Format, UseExtraChecksum);
+ bool UseExtraChecksum,
+ bool NoRedZone) {
+ return new GCOVProfiler(EmitNotes, EmitData, Use402Format, UseExtraChecksum,
+ NoRedZone);
}
namespace {
WriteoutF = Function::Create(WriteoutFTy, GlobalValue::InternalLinkage,
"__llvm_gcov_writeout", M);
WriteoutF->setUnnamedAddr(true);
+ WriteoutF->addFnAttr(Attributes::NoInline);
+ if (NoRedZone)
+ WriteoutF->addFnAttr(Attributes::NoRedZone);
BasicBlock *BB = BasicBlock::Create(*Ctx, "entry", WriteoutF);
IRBuilder<> Builder(BB);
F->setUnnamedAddr(true);
F->setLinkage(GlobalValue::InternalLinkage);
F->addFnAttr(Attributes::NoInline);
+ if (NoRedZone)
+ F->addFnAttr(Attributes::NoRedZone);
BB = BasicBlock::Create(*Ctx, "entry", F);
Builder.SetInsertPoint(BB);
Fn->setUnnamedAddr(true);
Fn->setLinkage(GlobalValue::InternalLinkage);
Fn->addFnAttr(Attributes::NoInline);
+ if (NoRedZone)
+ Fn->addFnAttr(Attributes::NoRedZone);
Type *Int32Ty = Type::getInt32Ty(*Ctx);
Type *Int64Ty = Type::getInt64Ty(*Ctx);
else
FlushF->setLinkage(GlobalValue::InternalLinkage);
FlushF->setUnnamedAddr(true);
+ FlushF->addFnAttr(Attributes::NoInline);
+ if (NoRedZone)
+ FlushF->addFnAttr(Attributes::NoRedZone);
BasicBlock *Entry = BasicBlock::Create(*Ctx, "entry", FlushF);