[analyzer] Overhauling of the checker registration mechanism.
[clang.git] / include / clang / Frontend / AnalyzerOptions.h
blobba1d0de11df4b76f337968f2ee5d5d14a0c97131
1 //===--- AnalyzerOptions.h - Analysis Engine Options ------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This header contains the structures necessary for a front-end to specify
11 // various analyses.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_FRONTEND_ANALYZEROPTIONS_H
16 #define LLVM_CLANG_FRONTEND_ANALYZEROPTIONS_H
18 #include <string>
19 #include <vector>
21 namespace clang {
22 class ASTConsumer;
23 class Diagnostic;
24 class Preprocessor;
25 class LangOptions;
27 /// Analysis - Set of available source code analyses.
28 enum Analyses {
29 #define ANALYSIS(NAME, CMDFLAG, DESC, SCOPE) NAME,
30 #include "clang/Frontend/Analyses.def"
31 NumAnalyses
34 /// AnalysisStores - Set of available analysis store models.
35 enum AnalysisStores {
36 #define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN) NAME##Model,
37 #include "clang/Frontend/Analyses.def"
38 NumStores
41 /// AnalysisConstraints - Set of available constraint models.
42 enum AnalysisConstraints {
43 #define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN) NAME##Model,
44 #include "clang/Frontend/Analyses.def"
45 NumConstraints
48 /// AnalysisDiagClients - Set of available diagnostic clients for rendering
49 /// analysis results.
50 enum AnalysisDiagClients {
51 #define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN, AUTOCREAT) PD_##NAME,
52 #include "clang/Frontend/Analyses.def"
53 NUM_ANALYSIS_DIAG_CLIENTS
56 class AnalyzerOptions {
57 public:
58 std::vector<Analyses> AnalysisList;
59 /// \brief Pair of checker name and enable/disable.
60 std::vector<std::pair<std::string, bool> > CheckersControlList;
61 AnalysisStores AnalysisStoreOpt;
62 AnalysisConstraints AnalysisConstraintsOpt;
63 AnalysisDiagClients AnalysisDiagOpt;
64 std::string AnalyzeSpecificFunction;
65 unsigned MaxNodes;
66 unsigned MaxLoop;
67 unsigned AnalyzeAll : 1;
68 unsigned AnalyzerDisplayProgress : 1;
69 unsigned AnalyzeNestedBlocks : 1;
70 unsigned AnalyzerStats : 1;
71 unsigned EagerlyAssume : 1;
72 unsigned IdempotentOps : 1;
73 unsigned ObjCSelfInitCheck : 1;
74 unsigned BufferOverflows : 1;
75 unsigned PurgeDead : 1;
76 unsigned TrimGraph : 1;
77 unsigned VisualizeEGDot : 1;
78 unsigned VisualizeEGUbi : 1;
79 unsigned EnableExperimentalChecks : 1;
80 unsigned EnableExperimentalInternalChecks : 1;
81 unsigned InlineCall : 1;
82 unsigned UnoptimizedCFG : 1;
83 unsigned CFGAddImplicitDtors : 1;
84 unsigned CFGAddInitializers : 1;
85 unsigned EagerlyTrimEGraph : 1;
87 public:
88 AnalyzerOptions() {
89 AnalysisStoreOpt = BasicStoreModel;
90 AnalysisConstraintsOpt = RangeConstraintsModel;
91 AnalysisDiagOpt = PD_HTML;
92 AnalyzeAll = 0;
93 AnalyzerDisplayProgress = 0;
94 AnalyzeNestedBlocks = 0;
95 AnalyzerStats = 0;
96 EagerlyAssume = 0;
97 IdempotentOps = 0;
98 ObjCSelfInitCheck = 0;
99 BufferOverflows = 0;
100 PurgeDead = 1;
101 TrimGraph = 0;
102 VisualizeEGDot = 0;
103 VisualizeEGUbi = 0;
104 EnableExperimentalChecks = 0;
105 EnableExperimentalInternalChecks = 0;
106 UnoptimizedCFG = 0;
107 CFGAddImplicitDtors = 0;
108 CFGAddInitializers = 0;
109 EagerlyTrimEGraph = 0;
115 #endif