LLVM  13.0.0git
MemorySanitizer.h
Go to the documentation of this file.
1 //===- Transforms/Instrumentation/MemorySanitizer.h - MSan Pass -----------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the memoy sanitizer pass.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_MEMORYSANITIZER_H
14 #define LLVM_TRANSFORMS_INSTRUMENTATION_MEMORYSANITIZER_H
15 
16 #include "llvm/IR/PassManager.h"
17 #include "llvm/Pass.h"
18 
19 namespace llvm {
20 
24  bool Kernel;
26  bool Recover;
27 };
28 
29 // Insert MemorySanitizer instrumentation (detection of uninitialized reads)
32 
33 /// A function pass for msan instrumentation.
34 ///
35 /// Instruments functions to detect unitialized reads. This function pass
36 /// inserts calls to runtime library functions. If the functions aren't declared
37 /// yet, the pass inserts the declarations. Otherwise the existing globals are
38 /// used.
39 struct MemorySanitizerPass : public PassInfoMixin<MemorySanitizerPass> {
40  MemorySanitizerPass(MemorySanitizerOptions Options) : Options(Options) {}
41 
44  static bool isRequired() { return true; }
45 
46 private:
47  MemorySanitizerOptions Options;
48 };
49 }
50 
51 #endif /* LLVM_TRANSFORMS_INSTRUMENTATION_MEMORYSANITIZER_H */
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:155
llvm
Definition: AllocatorList.h:23
llvm::MemorySanitizerOptions::TrackOrigins
int TrackOrigins
Definition: MemorySanitizer.h:25
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:374
llvm::Function
Definition: Function.h:61
llvm::MemorySanitizerOptions::Kernel
bool Kernel
Definition: MemorySanitizer.h:24
Pass.h
llvm::MemorySanitizerPass::MemorySanitizerPass
MemorySanitizerPass(MemorySanitizerOptions Options)
Definition: MemorySanitizer.h:40
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::createMemorySanitizerLegacyPassPass
FunctionPass * createMemorySanitizerLegacyPassPass(MemorySanitizerOptions Options={})
Definition: MemorySanitizer.cpp:695
false
Definition: StackSlotColoring.cpp:142
llvm::MemorySanitizerOptions::Recover
bool Recover
Definition: MemorySanitizer.h:26
llvm::MemorySanitizerPass::isRequired
static bool isRequired()
Definition: MemorySanitizer.h:44
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::MemorySanitizerPass
A function pass for msan instrumentation.
Definition: MemorySanitizer.h:39
PassManager.h
llvm::MemorySanitizerOptions
Definition: MemorySanitizer.h:21
llvm::MemorySanitizerPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
Definition: MemorySanitizer.cpp:668
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:44
llvm::FunctionPass
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:298
llvm::MemorySanitizerOptions::MemorySanitizerOptions
MemorySanitizerOptions()
Definition: MemorySanitizer.h:22