blob: 0fea81e215c9107762a398d03867308083ef3fd9 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===-- llvm/Analysis/Lint.h - LLVM IR Lint ---------------------*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// 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
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
7//===----------------------------------------------------------------------===//
8//
9// This file defines lint interfaces that can be used for some sanity checking
10// of input to the system, and for checking that transformations
11// haven't done something bad. In contrast to the Verifier, the Lint checker
12// checks for undefined behavior or constructions with likely unintended
13// behavior.
14//
15// To see what specifically is checked, look at Lint.cpp
16//
17//===----------------------------------------------------------------------===//
18
19#ifndef LLVM_ANALYSIS_LINT_H
20#define LLVM_ANALYSIS_LINT_H
21
22namespace llvm {
23
24class FunctionPass;
25class Module;
26class Function;
27
Andrew Scullcdfcccc2018-10-05 20:58:37 +010028/// Create a lint pass.
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010029///
30/// Check a module or function.
31FunctionPass *createLintPass();
32
Andrew Scullcdfcccc2018-10-05 20:58:37 +010033/// Check a module.
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010034///
35/// This should only be used for debugging, because it plays games with
36/// PassManagers and stuff.
37void lintModule(
38 const Module &M ///< The module to be checked
39);
40
41// lintFunction - Check a function.
42void lintFunction(
43 const Function &F ///< The function to be checked
44);
45
46} // End llvm namespace
47
48#endif