LLVM 22.0.0git
LowerAllowCheckPass.h
Go to the documentation of this file.
1//===- LowerAllowCheckPass.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/// \file
9/// This file provides the interface for the pass responsible for removing
10/// expensive ubsan checks.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_LOWERALLOWCHECKPASS_H
15#define LLVM_TRANSFORMS_INSTRUMENTATION_LOWERALLOWCHECKPASS_H
16
17#include "llvm/IR/Function.h"
18#include "llvm/IR/PassManager.h"
19#include "llvm/Pass.h"
21
22namespace llvm {
23
24// This pass is responsible for removing optional traps, like llvm.ubsantrap
25// from the hot code.
26class LowerAllowCheckPass : public PassInfoMixin<LowerAllowCheckPass> {
27public:
28 struct Options {
29 std::vector<unsigned int> cutoffs;
30 unsigned int runtime_check = 0;
31 };
32
34 : Opts(std::move(Opts)) {};
36
37 LLVM_ABI static bool IsRequested();
38 LLVM_ABI void
40 function_ref<StringRef(StringRef)> MapClassName2PassName);
41
42private:
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
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
LowerAllowCheckPass(LowerAllowCheckPass::Options Opts)
LLVM_ABI void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
static LLVM_ABI bool IsRequested()
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.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1869
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:851
std::vector< unsigned int > cutoffs
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition PassManager.h:70