1//===-- Analyses.def - Metadata about Static Analyses -----------*- 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 the set of static analyses used by AnalysisConsumer.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef ANALYSIS_STORE
14#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN)
15#endif
16
17ANALYSIS_STORE(RegionStore, "region", "Use region-based analyzer store",
18 CreateRegionStoreManager)
19
20#ifndef ANALYSIS_CONSTRAINTS
21#define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN)
22#endif
23
24ANALYSIS_CONSTRAINTS(RangeConstraints, "range",
25 "Use constraint tracking of concrete value ranges",
26 CreateRangeConstraintManager)
27
28ANALYSIS_CONSTRAINTS(Z3Constraints, "z3", "Use Z3 contraint solver",
29 CreateZ3ConstraintManager)
30
31#ifndef ANALYSIS_DIAGNOSTICS
32#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATEFN)
33#endif
34
35ANALYSIS_DIAGNOSTICS(HTML, "html", "Output analysis results using HTML",
36 createHTMLDiagnosticConsumer)
37
38ANALYSIS_DIAGNOSTICS(
39 HTML_SINGLE_FILE, "html-single-file",
40 "Output analysis results using HTML (not allowing for multi-file bugs)",
41 createHTMLSingleFileDiagnosticConsumer)
42
43ANALYSIS_DIAGNOSTICS(PLIST, "plist", "Output analysis results using Plists",
44 createPlistDiagnosticConsumer)
45
46ANALYSIS_DIAGNOSTICS(
47 PLIST_MULTI_FILE, "plist-multi-file",
48 "Output analysis results using Plists (allowing for multi-file bugs)",
49 createPlistMultiFileDiagnosticConsumer)
50
51ANALYSIS_DIAGNOSTICS(PLIST_HTML, "plist-html",
52 "Output analysis results using HTML wrapped with Plists",
53 createPlistHTMLDiagnosticConsumer)
54
55ANALYSIS_DIAGNOSTICS(SARIF, "sarif", "Output analysis results using SARIF",
56 createSarifDiagnosticConsumer)
57
58ANALYSIS_DIAGNOSTICS(SARIF_HTML, "sarif-html",
59 "Output analysis results using both SARIF and HTML "
60 "output files",
61 createSarifHTMLDiagnosticConsumer)
62
63ANALYSIS_DIAGNOSTICS(TEXT, "text", "Text output of analysis results to stderr",
64 createTextPathDiagnosticConsumer)
65
66ANALYSIS_DIAGNOSTICS(TEXT_MINIMAL, "text-minimal",
67 "Emits minimal diagnostics to stderr, stating only the "
68 "warning message and the associated notes. Usually "
69 "used in addition to other analysis types",
70 createTextMinimalPathDiagnosticConsumer)
71
72#ifndef ANALYSIS_PURGE
73#define ANALYSIS_PURGE(NAME, CMDFLAG, DESC)
74#endif
75
76ANALYSIS_PURGE(
77 PurgeStmt, "statement",
78 "Purge symbols, bindings, and constraints before every statement")
79
80ANALYSIS_PURGE(
81 PurgeBlock, "block",
82 "Purge symbols, bindings, and constraints before every basic block")
83
84ANALYSIS_PURGE(PurgeNone, "none",
85 "Do not purge symbols, bindings, or constraints")
86
87#ifndef ANALYSIS_INLINING_MODE
88#define ANALYSIS_INLINING_MODE(NAME, CMDFLAG, DESC)
89#endif
90
91ANALYSIS_INLINING_MODE(All, "all", "Analyze all functions as top level")
92
93ANALYSIS_INLINING_MODE(
94 NoRedundancy, "noredundancy",
95 "Do not analyze a function which has been previously inlined")
96
97#undef ANALYSIS_STORE
98#undef ANALYSIS_CONSTRAINTS
99#undef ANALYSIS_DIAGNOSTICS
100#undef ANALYSIS_PURGE
101#undef ANALYSIS_INLINING_MODE
102#undef ANALYSIS_IPA
103