LLVM  14.0.0git
Lint.h
Go to the documentation of this file.
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 #include "llvm/IR/PassManager.h"
23 
24 namespace llvm {
25 
26 class FunctionPass;
27 class Module;
28 class Function;
29 
30 FunctionPass *createLintLegacyPassPass();
31 
32 /// Lint a module.
33 ///
34 /// This should only be used for debugging, because it plays games with
35 /// PassManagers and stuff.
36 void lintModule(const Module &M);
37 
38 // Lint a function.
39 void lintFunction(const Function &F);
40 
41 class LintPass : public PassInfoMixin<LintPass> {
42 public:
44 };
45 
46 } // namespace llvm
47 
48 #endif // LLVM_ANALYSIS_LINT_H
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:155
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:374
llvm::Function
Definition: Function.h:62
llvm::createLintLegacyPassPass
FunctionPass * createLintLegacyPassPass()
Definition: Lint.cpp:764
llvm::lintModule
void lintModule(const Module &M)
Lint a module.
Definition: Lint.cpp:780
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::LintPass
Definition: Lint.h:41
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::lintFunction
void lintFunction(const Function &F)
lintFunction - Check a function for errors, printing messages on stderr.
Definition: Lint.cpp:768
PassManager.h
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:44
llvm::codeview::PublicSymFlags::Function
@ Function
llvm::LintPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition: Lint.cpp:705