LLVM 22.0.0git
SanitizerCoverage.h
Go to the documentation of this file.
1//===--------- Definition of the SanitizerCoverage class --------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6// See https://llvm.org/LICENSE.txt for license information.
7// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8//
9//===----------------------------------------------------------------------===//
10//
11// SanitizerCoverage is a simple code coverage implementation.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_SANITIZERCOVERAGE_H
16#define LLVM_TRANSFORMS_INSTRUMENTATION_SANITIZERCOVERAGE_H
17
19#include "llvm/IR/PassManager.h"
23
24namespace llvm {
25class Module;
26namespace vfs {
27class FileSystem;
28} // namespace vfs
29
30/// This is the ModuleSanitizerCoverage pass used in the new pass manager. The
31/// pass instruments functions for coverage, adds initialization calls to the
32/// module for trace PC guards and 8bit counters if they are requested, and
33/// appends globals to llvm.compiler.used.
34class SanitizerCoveragePass : public PassInfoMixin<SanitizerCoveragePass> {
35public:
39 const std::vector<std::string> &AllowlistFiles = {},
40 const std::vector<std::string> &BlocklistFiles = {});
42 static bool isRequired() { return true; }
43
44private:
47 std::unique_ptr<SpecialCaseList> Allowlist;
48 std::unique_ptr<SpecialCaseList> Blocklist;
49};
50
51} // namespace llvm
52
53#endif
#define LLVM_ABI
Definition Compiler.h:213
This header defines various interfaces for pass management in LLVM.
This file defines the RefCountedBase, ThreadSafeRefCountedBase, and IntrusiveRefCntPtr classes.
static LVOptions Options
Definition LVOptions.cpp:25
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCount...
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
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
LLVM_ABI SanitizerCoveragePass(SanitizerCoverageOptions Options=SanitizerCoverageOptions(), IntrusiveRefCntPtr< vfs::FileSystem > VFS=nullptr, const std::vector< std::string > &AllowlistFiles={}, const std::vector< std::string > &BlocklistFiles={})
The virtual file system interface.
This is an optimization pass for GlobalISel generic memory operations.
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:70