LLVM 22.0.0git
MemorySanitizer.h
Go to the documentation of this file.
1//===- MemorySanitizer.h - MemorySanitizer instrumentation ------*- C++ -*-===//
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"
19
20namespace llvm {
21class Module;
22class StringRef;
23class raw_ostream;
24
30 bool EagerChecks);
31 bool Kernel;
33 bool Recover;
35};
36
37/// A module pass for msan instrumentation.
38///
39/// Instruments functions to detect unitialized reads. This function pass
40/// inserts calls to runtime library functions. If the functions aren't declared
41/// yet, the pass inserts the declarations. Otherwise the existing globals are
42/// used.
43struct MemorySanitizerPass : public PassInfoMixin<MemorySanitizerPass> {
44 MemorySanitizerPass(MemorySanitizerOptions Options) : Options(Options) {}
45
47 LLVM_ABI void
49 function_ref<StringRef(StringRef)> MapClassName2PassName);
50 static bool isRequired() { return true; }
51
52private:
54};
55}
56
57#endif /* LLVM_TRANSFORMS_INSTRUMENTATION_MEMORYSANITIZER_H */
#define LLVM_ABI
Definition: Compiler.h:213
This header defines various interfaces for pass management in LLVM.
Machine Check Debug Module
raw_pwrite_stream & OS
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:255
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:112
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
MemorySanitizerOptions(int TrackOrigins, bool Recover, bool Kernel)
A module pass for msan instrumentation.
LLVM_ABI void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
MemorySanitizerPass(MemorySanitizerOptions Options)
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:70