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 | |

17 | ANALYSIS_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 | |

24 | ANALYSIS_CONSTRAINTS(RangeConstraints, "range", |

25 | "Use constraint tracking of concrete value ranges", |

26 | CreateRangeConstraintManager) |

27 | |

28 | ANALYSIS_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 | |

35 | ANALYSIS_DIAGNOSTICS(HTML, "html", "Output analysis results using HTML", |

36 | createHTMLDiagnosticConsumer) |

37 | |

38 | ANALYSIS_DIAGNOSTICS( |

39 | HTML_SINGLE_FILE, "html-single-file", |

40 | "Output analysis results using HTML (not allowing for multi-file bugs)", |

41 | createHTMLSingleFileDiagnosticConsumer) |

42 | |

43 | ANALYSIS_DIAGNOSTICS(PLIST, "plist", "Output analysis results using Plists", |

44 | createPlistDiagnosticConsumer) |

45 | |

46 | ANALYSIS_DIAGNOSTICS( |

47 | PLIST_MULTI_FILE, "plist-multi-file", |

48 | "Output analysis results using Plists (allowing for multi-file bugs)", |

49 | createPlistMultiFileDiagnosticConsumer) |

50 | |

51 | ANALYSIS_DIAGNOSTICS(PLIST_HTML, "plist-html", |

52 | "Output analysis results using HTML wrapped with Plists", |

53 | createPlistHTMLDiagnosticConsumer) |

54 | |

55 | ANALYSIS_DIAGNOSTICS(SARIF, "sarif", "Output analysis results using SARIF", |

56 | createSarifDiagnosticConsumer) |

57 | |

58 | ANALYSIS_DIAGNOSTICS(SARIF_HTML, "sarif-html", |

59 | "Output analysis results using both SARIF and HTML " |

60 | "output files", |

61 | createSarifHTMLDiagnosticConsumer) |

62 | |

63 | ANALYSIS_DIAGNOSTICS(TEXT, "text", "Text output of analysis results to stderr", |

64 | createTextPathDiagnosticConsumer) |

65 | |

66 | ANALYSIS_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 | |

76 | ANALYSIS_PURGE( |

77 | PurgeStmt, "statement", |

78 | "Purge symbols, bindings, and constraints before every statement") |

79 | |

80 | ANALYSIS_PURGE( |

81 | PurgeBlock, "block", |

82 | "Purge symbols, bindings, and constraints before every basic block") |

83 | |

84 | ANALYSIS_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 | |

91 | ANALYSIS_INLINING_MODE(All, "all", "Analyze all functions as top level") |

92 | |

93 | ANALYSIS_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 |