]> CyberLeo.Net >> Repos - FreeBSD/releng/9.0.git/blob - contrib/llvm/tools/clang/include/clang/Frontend/AnalyzerOptions.h
Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
[FreeBSD/releng/9.0.git] / contrib / llvm / tools / clang / include / clang / Frontend / AnalyzerOptions.h
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.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CLANG_FRONTEND_ANALYZEROPTIONS_H
16 #define LLVM_CLANG_FRONTEND_ANALYZEROPTIONS_H
17
18 #include <string>
19 #include <vector>
20
21 namespace clang {
22 class ASTConsumer;
23 class DiagnosticsEngine;
24 class Preprocessor;
25 class LangOptions;
26
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
32 };
33
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
39 };
40
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
46 };
47
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
54 };
55
56 /// AnalysisPurgeModes - Set of available strategies for dead symbol removal.
57 enum AnalysisPurgeMode {
58 #define ANALYSIS_PURGE(NAME, CMDFLAG, DESC) NAME,
59 #include "clang/Frontend/Analyses.def"
60 NumPurgeModes
61 };
62
63 class AnalyzerOptions {
64 public:
65   /// \brief Pair of checker name and enable/disable.
66   std::vector<std::pair<std::string, bool> > CheckersControlList;
67   AnalysisStores AnalysisStoreOpt;
68   AnalysisConstraints AnalysisConstraintsOpt;
69   AnalysisDiagClients AnalysisDiagOpt;
70   AnalysisPurgeMode AnalysisPurgeOpt;
71   std::string AnalyzeSpecificFunction;
72   unsigned MaxNodes;
73   unsigned MaxLoop;
74   unsigned ShowCheckerHelp : 1;
75   unsigned AnalyzeAll : 1;
76   unsigned AnalyzerDisplayProgress : 1;
77   unsigned AnalyzeNestedBlocks : 1;
78   unsigned EagerlyAssume : 1;
79   unsigned TrimGraph : 1;
80   unsigned VisualizeEGDot : 1;
81   unsigned VisualizeEGUbi : 1;
82   unsigned InlineCall : 1;
83   unsigned UnoptimizedCFG : 1;
84   unsigned CFGAddImplicitDtors : 1;
85   unsigned CFGAddInitializers : 1;
86   unsigned EagerlyTrimEGraph : 1;
87
88 public:
89   AnalyzerOptions() {
90     AnalysisStoreOpt = RegionStoreModel;
91     AnalysisConstraintsOpt = RangeConstraintsModel;
92     AnalysisDiagOpt = PD_HTML;
93     AnalysisPurgeOpt = PurgeStmt;
94     ShowCheckerHelp = 0;
95     AnalyzeAll = 0;
96     AnalyzerDisplayProgress = 0;
97     AnalyzeNestedBlocks = 0;
98     EagerlyAssume = 0;
99     TrimGraph = 0;
100     VisualizeEGDot = 0;
101     VisualizeEGUbi = 0;
102     InlineCall = 0;
103     UnoptimizedCFG = 0;
104     CFGAddImplicitDtors = 0;
105     CFGAddInitializers = 0;
106     EagerlyTrimEGraph = 0;
107   }
108 };
109
110 }
111
112 #endif