2003-01-14 23:37:41 +01:00
|
|
|
//===- Transforms/Instrumentation.h - Instrumentation passes ----*- C++ -*-===//
|
2005-04-21 22:59:05 +02:00
|
|
|
//
|
2003-10-20 22:19:47 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:59:42 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 22:59:05 +02:00
|
|
|
//
|
2003-10-20 22:19:47 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2003-01-14 23:37:41 +01:00
|
|
|
//
|
2008-03-06 11:36:00 +01:00
|
|
|
// This file defines constructor functions for instrumentation passes.
|
2003-01-14 23:37:41 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_H
|
|
|
|
#define LLVM_TRANSFORMS_INSTRUMENTATION_H
|
|
|
|
|
2012-12-03 20:09:26 +01:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
namespace llvm {
|
|
|
|
|
2004-09-30 22:13:55 +02:00
|
|
|
class ModulePass;
|
2012-02-13 23:50:51 +01:00
|
|
|
class FunctionPass;
|
2004-09-30 22:13:55 +02:00
|
|
|
|
2007-02-20 06:31:35 +01:00
|
|
|
// Insert edge profiling instrumentation
|
2005-01-07 07:57:28 +01:00
|
|
|
ModulePass *createEdgeProfilerPass();
|
|
|
|
|
2009-09-01 21:05:58 +02:00
|
|
|
// Insert optimal edge profiling instrumentation
|
|
|
|
ModulePass *createOptimalEdgeProfilerPass();
|
|
|
|
|
2011-01-29 02:09:53 +01:00
|
|
|
// Insert path profiling instrumentation
|
|
|
|
ModulePass *createPathProfilerPass();
|
|
|
|
|
2011-04-16 03:20:23 +02:00
|
|
|
// Insert GCOV profiling instrumentation
|
2013-03-14 06:13:26 +01:00
|
|
|
struct GCOVOptions {
|
|
|
|
static GCOVOptions getDefault();
|
|
|
|
|
|
|
|
// Specify whether to emit .gcno files.
|
|
|
|
bool EmitNotes;
|
|
|
|
|
|
|
|
// Specify whether to modify the program to emit .gcda files when run.
|
|
|
|
bool EmitData;
|
|
|
|
|
|
|
|
// A four-byte version string. The meaning of a version string is described in
|
|
|
|
// gcc's gcov-io.h
|
|
|
|
char Version[4];
|
|
|
|
|
|
|
|
// Emit a "cfg checksum" that follows the "line number checksum" of a
|
|
|
|
// function. This affects both .gcno and .gcda files.
|
|
|
|
bool UseCfgChecksum;
|
|
|
|
|
|
|
|
// Add the 'noredzone' attribute to added runtime library calls.
|
|
|
|
bool NoRedZone;
|
|
|
|
|
|
|
|
// Emit the name of the function in the .gcda files. This is redundant, as
|
|
|
|
// the function identifier can be used to find the name from the .gcno file.
|
|
|
|
bool FunctionNamesInData;
|
|
|
|
};
|
|
|
|
ModulePass *createGCOVProfilerPass(const GCOVOptions &Options =
|
|
|
|
GCOVOptions::getDefault());
|
2011-04-12 03:06:09 +02:00
|
|
|
|
2011-11-16 02:35:23 +01:00
|
|
|
// Insert AddressSanitizer (address sanity checking) instrumentation
|
2012-11-29 19:14:24 +01:00
|
|
|
FunctionPass *createAddressSanitizerFunctionPass(
|
2013-03-14 13:38:58 +01:00
|
|
|
bool CheckInitOrder = true, bool CheckUseAfterReturn = false,
|
2013-01-17 12:12:32 +01:00
|
|
|
bool CheckLifetime = false, StringRef BlacklistFile = StringRef(),
|
|
|
|
bool ZeroBaseShadow = false);
|
2012-12-03 20:09:26 +01:00
|
|
|
ModulePass *createAddressSanitizerModulePass(
|
2013-03-14 13:38:58 +01:00
|
|
|
bool CheckInitOrder = true, StringRef BlacklistFile = StringRef(),
|
2013-01-17 12:12:32 +01:00
|
|
|
bool ZeroBaseShadow = false);
|
2012-12-10 20:46:49 +01:00
|
|
|
|
2012-11-29 10:57:20 +01:00
|
|
|
// Insert MemorySanitizer instrumentation (detection of uninitialized reads)
|
2012-12-28 10:30:44 +01:00
|
|
|
FunctionPass *createMemorySanitizerPass(bool TrackOrigins = false,
|
|
|
|
StringRef BlacklistFile = StringRef());
|
2012-12-10 20:46:49 +01:00
|
|
|
|
2012-02-13 23:50:51 +01:00
|
|
|
// Insert ThreadSanitizer (race detection) instrumentation
|
2012-12-28 10:30:44 +01:00
|
|
|
FunctionPass *createThreadSanitizerPass(StringRef BlacklistFile = StringRef());
|
2011-11-16 02:35:23 +01:00
|
|
|
|
2012-07-21 00:39:33 +02:00
|
|
|
// BoundsChecking - This pass instruments the code to perform run-time bounds
|
|
|
|
// checking on loads, stores, and other memory intrinsics.
|
2012-11-23 11:47:35 +01:00
|
|
|
FunctionPass *createBoundsCheckingPass();
|
2012-07-21 00:39:33 +02:00
|
|
|
|
2013-05-08 22:44:14 +02:00
|
|
|
/// createDebugIRPass - Create and return a pass that modifies a module's
|
|
|
|
/// debug metadata to point back to IR instead of the original source file
|
2013-05-24 00:34:33 +02:00
|
|
|
ModulePass *createDebugIRPass(StringRef FilenamePostfix,
|
|
|
|
bool hideDebugIntrinsics = true,
|
|
|
|
bool hideDebugMetadata = true);
|
2013-05-08 22:44:14 +02:00
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2003-01-14 23:37:41 +01:00
|
|
|
#endif
|