Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:38

0001 //===- LowerAllowCheckPass.h ------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 /// \file
0009 /// This file provides the interface for the pass responsible for removing
0010 /// expensive ubsan checks.
0011 ///
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_LOWERALLOWCHECKPASS_H
0015 #define LLVM_TRANSFORMS_INSTRUMENTATION_LOWERALLOWCHECKPASS_H
0016 
0017 #include "llvm/IR/Function.h"
0018 #include "llvm/IR/PassManager.h"
0019 #include "llvm/Pass.h"
0020 
0021 namespace llvm {
0022 
0023 // This pass is responsible for removing optional traps, like llvm.ubsantrap
0024 // from the hot code.
0025 class LowerAllowCheckPass : public PassInfoMixin<LowerAllowCheckPass> {
0026 public:
0027   struct Options {
0028     std::vector<unsigned int> cutoffs;
0029   };
0030 
0031   explicit LowerAllowCheckPass(LowerAllowCheckPass::Options Opts)
0032       : Opts(std::move(Opts)) {};
0033   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
0034 
0035   static bool IsRequested();
0036   void printPipeline(raw_ostream &OS,
0037                      function_ref<StringRef(StringRef)> MapClassName2PassName);
0038 
0039 private:
0040   LowerAllowCheckPass::Options Opts;
0041 };
0042 
0043 } // namespace llvm
0044 
0045 #endif