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 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 22 namespace llvm { 23 24 class FunctionPass; 25 class Module; 26 class Function; 27 28 /// Create a lint pass. 29 /// 30 /// Check a module or function. 31 FunctionPass *createLintPass(); 32 33 /// Check a module. 34 /// 35 /// This should only be used for debugging, because it plays games with 36 /// PassManagers and stuff. 37 void lintModule( 38 const Module &M ///< The module to be checked 39 ); 40 41 // lintFunction - Check a function. 42 void lintFunction( 43 const Function &F ///< The function to be checked 44 ); 45 46 } // End llvm namespace 47 48 #endif 49