|
| 1 | +//===- NumericalStabilitySanitizer.h - NSan Pass ---------------*- 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 | +/// \file |
| 10 | +/// This file defines the numerical stability sanitizer (nsan) pass. |
| 11 | +/// |
| 12 | +//===----------------------------------------------------------------------===// |
| 13 | + |
| 14 | +#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_NUMERICALSTABIITYSANITIZER_H |
| 15 | +#define LLVM_TRANSFORMS_INSTRUMENTATION_NUMERICALSTABIITYSANITIZER_H |
| 16 | + |
| 17 | +#include "llvm/IR/PassManager.h" |
| 18 | +#include "llvm/Pass.h" |
| 19 | + |
| 20 | +namespace llvm { |
| 21 | + |
| 22 | +/// Inserts NumericalStabilitySanitizer instrumentation. |
| 23 | +// FunctionPass *createNumericalStabilitySanitizerLegacyPassPass(); |
| 24 | + |
| 25 | +/// A function pass for nsan instrumentation. |
| 26 | +/// |
| 27 | +/// Instruments functions to duplicate floating point computations in a |
| 28 | +/// higher-precision type. |
| 29 | +/// This function pass inserts calls to runtime library functions. If the |
| 30 | +/// functions aren't declared yet, the pass inserts the declarations. |
| 31 | +struct NumericalStabilitySanitizerPass |
| 32 | + : public PassInfoMixin<NumericalStabilitySanitizerPass> { |
| 33 | + PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); |
| 34 | + PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); |
| 35 | + static bool isRequired() { return true; } |
| 36 | +}; |
| 37 | + |
| 38 | +} // end namespace llvm |
| 39 | + |
| 40 | +#endif // LLVM_TRANSFORMS_INSTRUMENTATION_NUMERICALSTABIITYSANITIZER_H |
0 commit comments