LLVM 24.0.0git
CopyProf.h
Go to the documentation of this file.
1//===-- CopyProf.h ----------------------------------------------*- 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 declares the instrumentation passes for CopyProf that insert
10// callbacks into special member functions, and add store instrumentation.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_COPYPROF_H
15#define LLVM_TRANSFORMS_INSTRUMENTATION_COPYPROF_H
16
17#include "llvm/IR/PassManager.h"
18
19namespace llvm {
20
21// Early-stage pass that instruments special member functions to call into the
22// CopyProf runtime.
23class CopyProfPass : public PassInfoMixin<CopyProfPass> {
24public:
25 CopyProfPass() = default;
27
28 static bool isRequired() { return true; }
29};
30
31// Module-level pass that inserts the CopyProf runtime initialization
32// constructor and hooks it into @llvm.global_ctors.
33class ModuleCopyProfPass : public PassInfoMixin<ModuleCopyProfPass> {
34public:
35 ModuleCopyProfPass() = default;
37
38 static bool isRequired() { return true; }
39};
40
41// Late-stage pass that instruments store instructions to detect whether an
42// object copy has been modified before it is destructed.
43class CopyProfStoresPass : public PassInfoMixin<CopyProfStoresPass> {
44public:
45 CopyProfStoresPass() = default;
47
48 static bool isRequired() { return true; }
49};
50
51} // namespace llvm
52
53#endif // LLVM_TRANSFORMS_INSTRUMENTATION_COPYPROF_H
#define LLVM_ABI
Definition Compiler.h:215
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition MD5.cpp:54
FunctionAnalysisManager FAM
static bool isRequired()
Definition CopyProf.h:28
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
Definition CopyProf.cpp:301
CopyProfPass()=default
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
Definition CopyProf.cpp:317
static bool isRequired()
Definition CopyProf.h:48
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Definition CopyProf.cpp:312
static bool isRequired()
Definition CopyProf.h:38
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.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition PassManager.h:89