LLVM  8.0.1
MemorySanitizer.h
Go to the documentation of this file.
1 //===- Transforms/Instrumentation/MemorySanitizer.h - MSan Pass -----------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the memoy sanitizer pass.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_MEMORYSANITIZER_H
15 #define LLVM_TRANSFORMS_INSTRUMENTATION_MEMORYSANITIZER_H
16 
17 #include "llvm/IR/PassManager.h"
18 #include "llvm/Pass.h"
19 
20 namespace llvm {
21 
22 // Insert MemorySanitizer instrumentation (detection of uninitialized reads)
23 FunctionPass *createMemorySanitizerLegacyPassPass(int TrackOrigins = 0,
24  bool Recover = false,
25  bool EnableKmsan = false);
26 
27 /// A function pass for msan instrumentation.
28 ///
29 /// Instruments functions to detect unitialized reads. This function pass
30 /// inserts calls to runtime library functions. If the functions aren't declared
31 /// yet, the pass inserts the declarations. Otherwise the existing globals are
32 /// used.
33 struct MemorySanitizerPass : public PassInfoMixin<MemorySanitizerPass> {
34  MemorySanitizerPass(int TrackOrigins = 0, bool Recover = false,
35  bool EnableKmsan = false)
36  : TrackOrigins(TrackOrigins), Recover(Recover), EnableKmsan(EnableKmsan) {
37  }
38 
40 
41 private:
42  int TrackOrigins;
43  bool Recover;
44  bool EnableKmsan;
45 };
46 }
47 
48 #endif /* LLVM_TRANSFORMS_INSTRUMENTATION_MEMORYSANITIZER_H */
This class represents lattice values for constants.
Definition: AllocatorList.h:24
F(f)
FunctionPass * createMemorySanitizerLegacyPassPass(int TrackOrigins=0, bool Recover=false, bool EnableKmsan=false)
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:366
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:154
A function pass for msan instrumentation.
MemorySanitizerPass(int TrackOrigins=0, bool Recover=false, bool EnableKmsan=false)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.