LLVM 22.0.0git
SanitizerBinaryMetadata.h
Go to the documentation of this file.
1//===------- Definition of the SanitizerBinaryMetadata class ----*- 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 SanitizerBinaryMetadata pass.
10//
11//===----------------------------------------------------------------------===//
12#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_SANITIZERBINARYMETADATA_H
13#define LLVM_TRANSFORMS_INSTRUMENTATION_SANITIZERBINARYMETADATA_H
14
15#include "llvm/ADT/ArrayRef.h"
17#include "llvm/IR/Function.h"
18#include "llvm/IR/Module.h"
19#include "llvm/IR/PassManager.h"
22
23namespace llvm {
24namespace vfs {
25class FileSystem;
26} // namespace vfs
27
29 bool Covered = false;
30 bool Atomics = false;
31 bool UAR = false;
33};
34
35inline constexpr int kSanitizerBinaryMetadataAtomicsBit = 0;
36inline constexpr int kSanitizerBinaryMetadataUARBit = 1;
38
45
47 "sanmd_covered";
49 "sanmd_atomics";
50
51/// Public interface to the SanitizerBinaryMetadata module pass for emitting
52/// metadata for binary analysis sanitizers.
53//
54/// The pass should be inserted after optimizations.
56 : public PassInfoMixin<SanitizerBinaryMetadataPass> {
57public:
61 ArrayRef<std::string> IgnorelistFiles = {});
63 static bool isRequired() { return true; }
64
65private:
68 const ArrayRef<std::string> IgnorelistFiles;
69};
70
71} // namespace llvm
72
73#endif
#define LLVM_ABI
Definition Compiler.h:213
Module.h This file contains the declarations for the Module class.
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
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:41
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 SanitizerBinaryMetadataPass(SanitizerBinaryMetadataOptions Opts={}, IntrusiveRefCntPtr< vfs::FileSystem > VFS=nullptr, ArrayRef< std::string > IgnorelistFiles={})
The virtual file system interface.
This is an optimization pass for GlobalISel generic memory operations.
constexpr uint64_t kSanitizerBinaryMetadataUAR
constexpr uint64_t kSanitizerBinaryMetadataUARHasSize
constexpr int kSanitizerBinaryMetadataUARHasSizeBit
constexpr uint64_t kSanitizerBinaryMetadataAtomics
constexpr int kSanitizerBinaryMetadataAtomicsBit
constexpr int kSanitizerBinaryMetadataUARBit
constexpr char kSanitizerBinaryMetadataCoveredSection[]
constexpr char kSanitizerBinaryMetadataAtomicsSection[]
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