LLVM 22.0.0git
MemProfInstrumentation.h
Go to the documentation of this file.
1//===--- MemProfInstrumentation.h - Memory profiler instrumentation ----*- C++
2//-*-===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the MemProf instrumentation pass classes.
11//
12//===----------------------------------------------------------------------===//
13#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_MEMPROF_INSTRUMENTATION_H
14#define LLVM_TRANSFORMS_INSTRUMENTATION_MEMPROF_INSTRUMENTATION_H
15
16#include "llvm/IR/PassManager.h"
18
19namespace llvm {
20class Function;
21class Module;
22
23/// Public interface to the memory profiler pass for instrumenting code to
24/// profile memory accesses.
25///
26/// The profiler itself is a function pass that works by inserting various
27/// calls to the MemProfiler runtime library functions. The runtime library
28/// essentially replaces malloc() and free() with custom implementations that
29/// record data about the allocations.
30class MemProfilerPass : public PassInfoMixin<MemProfilerPass> {
31public:
34 static bool isRequired() { return true; }
35};
36
37/// Public interface to the memory profiler module pass for instrumenting code
38/// to profile memory allocations and accesses.
39class ModuleMemProfilerPass : public PassInfoMixin<ModuleMemProfilerPass> {
40public:
43 static bool isRequired() { return true; }
44};
45
46} // namespace llvm
47
48#endif
#define LLVM_ABI
Definition: Compiler.h:213
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition: MD5.cpp:55
Machine Check Debug Module
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:255
Public interface to the memory profiler pass for instrumenting code to profile memory accesses.
LLVM_ABI MemProfilerPass()
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Public interface to the memory profiler module pass for instrumenting code to profile memory allocati...
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
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
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:70