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 in a SARIF file", 56 createSarifDiagnosticConsumer) 57 58ANALYSIS_DIAGNOSTICS(TEXT, "text", "Text output of analysis results to stderr", 59 createTextPathDiagnosticConsumer) 60 61ANALYSIS_DIAGNOSTICS(TEXT_MINIMAL, "text-minimal", 62 "Emits minimal diagnostics to stderr, stating only the " 63 "warning message and the associated notes. Usually " 64 "used in addition to other analysis types", 65 createTextMinimalPathDiagnosticConsumer) 66 67#ifndef ANALYSIS_PURGE 68#define ANALYSIS_PURGE(NAME, CMDFLAG, DESC) 69#endif 70 71ANALYSIS_PURGE( 72 PurgeStmt, "statement", 73 "Purge symbols, bindings, and constraints before every statement") 74 75ANALYSIS_PURGE( 76 PurgeBlock, "block", 77 "Purge symbols, bindings, and constraints before every basic block") 78 79ANALYSIS_PURGE(PurgeNone, "none", 80 "Do not purge symbols, bindings, or constraints") 81 82#ifndef ANALYSIS_INLINING_MODE 83#define ANALYSIS_INLINING_MODE(NAME, CMDFLAG, DESC) 84#endif 85 86ANALYSIS_INLINING_MODE(All, "all", "Analyze all functions as top level") 87 88ANALYSIS_INLINING_MODE( 89 NoRedundancy, "noredundancy", 90 "Do not analyze a function which has been previously inlined") 91 92#undef ANALYSIS_STORE 93#undef ANALYSIS_CONSTRAINTS 94#undef ANALYSIS_DIAGNOSTICS 95#undef ANALYSIS_PURGE 96#undef ANALYSIS_INLINING_MODE 97#undef ANALYSIS_IPA 98