xref: /llvm-project/llvm/include/llvm/Transforms/Instrumentation/NumericalStabilitySanitizer.h (revision 171067923744d597648450d3da204dd2f4a3fea0)
1*17106792SAlexander Shaposhnikov //===- NumericalStabilitySanitizer.h - NSan Pass ---------------*- C++ -*--===//
2*17106792SAlexander Shaposhnikov //
3*17106792SAlexander Shaposhnikov // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*17106792SAlexander Shaposhnikov // See https://llvm.org/LICENSE.txt for license information.
5*17106792SAlexander Shaposhnikov // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*17106792SAlexander Shaposhnikov //
7*17106792SAlexander Shaposhnikov //===----------------------------------------------------------------------===//
8*17106792SAlexander Shaposhnikov //
9*17106792SAlexander Shaposhnikov // \file
10*17106792SAlexander Shaposhnikov // This file defines the numerical stability sanitizer (nsan) pass.
11*17106792SAlexander Shaposhnikov //
12*17106792SAlexander Shaposhnikov //===----------------------------------------------------------------------===//
13*17106792SAlexander Shaposhnikov 
14*17106792SAlexander Shaposhnikov #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_NUMERICALSTABIITYSANITIZER_H
15*17106792SAlexander Shaposhnikov #define LLVM_TRANSFORMS_INSTRUMENTATION_NUMERICALSTABIITYSANITIZER_H
16*17106792SAlexander Shaposhnikov 
17*17106792SAlexander Shaposhnikov #include "llvm/IR/PassManager.h"
18*17106792SAlexander Shaposhnikov #include "llvm/Pass.h"
19*17106792SAlexander Shaposhnikov 
20*17106792SAlexander Shaposhnikov namespace llvm {
21*17106792SAlexander Shaposhnikov 
22*17106792SAlexander Shaposhnikov /// A function pass for nsan instrumentation.
23*17106792SAlexander Shaposhnikov ///
24*17106792SAlexander Shaposhnikov /// Instruments functions to duplicate floating point computations in a
25*17106792SAlexander Shaposhnikov /// higher-precision type.
26*17106792SAlexander Shaposhnikov /// This pass inserts calls to runtime library functions. If the
27*17106792SAlexander Shaposhnikov /// functions aren't declared yet, the pass inserts the declarations.
28*17106792SAlexander Shaposhnikov struct NumericalStabilitySanitizerPass
29*17106792SAlexander Shaposhnikov     : public PassInfoMixin<NumericalStabilitySanitizerPass> {
30*17106792SAlexander Shaposhnikov   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
isRequiredNumericalStabilitySanitizerPass31*17106792SAlexander Shaposhnikov   static bool isRequired() { return true; }
32*17106792SAlexander Shaposhnikov };
33*17106792SAlexander Shaposhnikov 
34*17106792SAlexander Shaposhnikov } // end namespace llvm
35*17106792SAlexander Shaposhnikov 
36*17106792SAlexander Shaposhnikov #endif // LLVM_TRANSFORMS_INSTRUMENTATION_NUMERICALSTABIITYSANITIZER_H
37