1 | //===-- llvm/Analysis/Lint.h - LLVM IR Lint ---------------------*- 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 | // This file defines lint interfaces that can be used for some validation of |
10 | // input to the system, and for checking that transformations haven't done |
11 | // something bad. In contrast to the Verifier, the Lint checker checks for |
12 | // undefined behavior or constructions with likely unintended behavior. |
13 | // |
14 | // To see what specifically is checked, look at Lint.cpp |
15 | // |
16 | //===----------------------------------------------------------------------===// |
17 | |
18 | #ifndef LLVM_ANALYSIS_LINT_H |
19 | #define LLVM_ANALYSIS_LINT_H |
20 | |
21 | #include "llvm/IR/PassManager.h" |
22 | |
23 | namespace llvm { |
24 | |
25 | class Module; |
26 | class Function; |
27 | |
28 | /// Lint a module. |
29 | /// |
30 | /// This should only be used for debugging, because it plays games with |
31 | /// PassManagers and stuff. |
32 | void lintModule(const Module &M); |
33 | |
34 | // Lint a function. |
35 | void lintFunction(const Function &F); |
36 | |
37 | class LintPass : public PassInfoMixin<LintPass> { |
38 | public: |
39 | PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); |
40 | }; |
41 | |
42 | } // namespace llvm |
43 | |
44 | #endif // LLVM_ANALYSIS_LINT_H |
45 | |