BoundsChecking.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- BoundsChecking.h - Bounds checking instrumentation -------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_BOUNDSCHECKING_H
  14. #define LLVM_TRANSFORMS_INSTRUMENTATION_BOUNDSCHECKING_H
  15. #include "llvm/IR/PassManager.h"
  16. #include "llvm/Pass.h"
  17. namespace llvm {
  18. /// A pass to instrument code and perform run-time bounds checking on loads,
  19. /// stores, and other memory intrinsics.
  20. struct BoundsCheckingPass : PassInfoMixin<BoundsCheckingPass> {
  21. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
  22. static bool isRequired() { return true; }
  23. };
  24. /// Legacy pass creation function for the above pass.
  25. FunctionPass *createBoundsCheckingLegacyPass();
  26. } // end namespace llvm
  27. #endif // LLVM_TRANSFORMS_INSTRUMENTATION_BOUNDSCHECKING_H
  28. #ifdef __GNUC__
  29. #pragma GCC diagnostic pop
  30. #endif