1 //===- Transforms/Instrumentation.h - Instrumentation passes ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines constructor functions for instrumentation passes.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_H
15 #define LLVM_TRANSFORMS_INSTRUMENTATION_H
17 #include "llvm/ADT/StringRef.h"
24 // Insert edge profiling instrumentation
25 ModulePass *createEdgeProfilerPass();
27 // Insert optimal edge profiling instrumentation
28 ModulePass *createOptimalEdgeProfilerPass();
30 // Insert path profiling instrumentation
31 ModulePass *createPathProfilerPass();
33 // Insert GCOV profiling instrumentation
35 static GCOVOptions getDefault();
37 // Specify whether to emit .gcno files.
40 // Specify whether to modify the program to emit .gcda files when run.
43 // A four-byte version string. The meaning of a version string is described in
47 // Emit a "cfg checksum" that follows the "line number checksum" of a
48 // function. This affects both .gcno and .gcda files.
51 // Add the 'noredzone' attribute to added runtime library calls.
54 // Emit the name of the function in the .gcda files. This is redundant, as
55 // the function identifier can be used to find the name from the .gcno file.
56 bool FunctionNamesInData;
58 ModulePass *createGCOVProfilerPass(const GCOVOptions &Options =
59 GCOVOptions::getDefault());
61 // Insert AddressSanitizer (address sanity checking) instrumentation
62 FunctionPass *createAddressSanitizerFunctionPass(
63 bool CheckInitOrder = true, bool CheckUseAfterReturn = false,
64 bool CheckLifetime = false, StringRef BlacklistFile = StringRef(),
65 bool ZeroBaseShadow = false);
66 ModulePass *createAddressSanitizerModulePass(
67 bool CheckInitOrder = true, StringRef BlacklistFile = StringRef(),
68 bool ZeroBaseShadow = false);
70 // Insert MemorySanitizer instrumentation (detection of uninitialized reads)
71 FunctionPass *createMemorySanitizerPass(bool TrackOrigins = false,
72 StringRef BlacklistFile = StringRef());
74 // Insert ThreadSanitizer (race detection) instrumentation
75 FunctionPass *createThreadSanitizerPass(StringRef BlacklistFile = StringRef());
77 // BoundsChecking - This pass instruments the code to perform run-time bounds
78 // checking on loads, stores, and other memory intrinsics.
79 FunctionPass *createBoundsCheckingPass();
81 /// createDebugIRPass - Create and return a pass that modifies a module's
82 /// debug metadata to point back to IR instead of the original source file
83 ModulePass *createDebugIRPass(StringRef FilenamePostfix,
84 bool hideDebugIntrinsics = true,
85 bool hideDebugMetadata = true);
87 } // End llvm namespace