File indexing completed on 2026-05-10 08:44:38
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_BOUNDSCHECKING_H
0010 #define LLVM_TRANSFORMS_INSTRUMENTATION_BOUNDSCHECKING_H
0011
0012 #include "llvm/IR/PassManager.h"
0013 #include <optional>
0014
0015 namespace llvm {
0016 class Function;
0017
0018
0019
0020 class BoundsCheckingPass : public PassInfoMixin<BoundsCheckingPass> {
0021
0022 public:
0023 struct Options {
0024 struct Runtime {
0025 Runtime(bool MinRuntime, bool MayReturn)
0026 : MinRuntime(MinRuntime), MayReturn(MayReturn) {}
0027 bool MinRuntime;
0028 bool MayReturn;
0029 };
0030 std::optional<Runtime> Rt;
0031 bool Merge = false;
0032 std::optional<int8_t> GuardKind;
0033 };
0034
0035 BoundsCheckingPass(Options Opts) : Opts(Opts) {}
0036 PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
0037 static bool isRequired() { return true; }
0038 void printPipeline(raw_ostream &OS,
0039 function_ref<StringRef(StringRef)> MapClassName2PassName);
0040
0041 private:
0042 Options Opts;
0043 };
0044
0045 }
0046
0047 #endif