LLVM  16.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 
17 #include "llvm/IR/PassManager.h"
18 
19 namespace llvm {
20 class Module;
21 class StringRef;
22 class raw_ostream;
23 
29  bool EagerChecks);
30  bool Kernel;
32  bool Recover;
34 };
35 
36 /// A module pass for msan instrumentation.
37 ///
38 /// Instruments functions to detect unitialized reads. This function pass
39 /// inserts calls to runtime library functions. If the functions aren't declared
40 /// yet, the pass inserts the declarations. Otherwise the existing globals are
41 /// used.
42 struct MemorySanitizerPass : public PassInfoMixin<MemorySanitizerPass> {
44 
46  void printPipeline(raw_ostream &OS,
47  function_ref<StringRef(StringRef)> MapClassName2PassName);
48  static bool isRequired() { return true; }
49 
50 private:
51  MemorySanitizerOptions Options;
52 };
53 }
54 
55 #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:152
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::MemorySanitizerOptions::TrackOrigins
int TrackOrigins
Definition: MemorySanitizer.h:31
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:371
llvm::MemorySanitizerOptions::Kernel
bool Kernel
Definition: MemorySanitizer.h:30
llvm::MemorySanitizerPass::MemorySanitizerPass
MemorySanitizerPass(MemorySanitizerOptions Options)
Definition: MemorySanitizer.h:43
llvm::MemorySanitizerPass::printPipeline
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
Definition: MemorySanitizer.cpp:712
llvm::MemorySanitizerPass::run
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Definition: MemorySanitizer.cpp:684
false
Definition: StackSlotColoring.cpp:141
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
STLFunctionalExtras.h
llvm::MemorySanitizerOptions::Recover
bool Recover
Definition: MemorySanitizer.h:32
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLFunctionalExtras.h:36
llvm::MemorySanitizerPass::isRequired
static bool isRequired()
Definition: MemorySanitizer.h:48
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::MemorySanitizerPass
A module pass for msan instrumentation.
Definition: MemorySanitizer.h:42
PassManager.h
llvm::MemorySanitizerOptions
Definition: MemorySanitizer.h:24
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:42
llvm::MemorySanitizerOptions::EagerChecks
bool EagerChecks
Definition: MemorySanitizer.h:33
llvm::MemorySanitizerOptions::MemorySanitizerOptions
MemorySanitizerOptions(int TrackOrigins, bool Recover, bool Kernel)
Definition: MemorySanitizer.h:26
llvm::MemorySanitizerOptions::MemorySanitizerOptions
MemorySanitizerOptions()
Definition: MemorySanitizer.h:25