1 //===--- DiagnosticOptions.h ------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_FRONTEND_DIAGNOSTICOPTIONS_H
11 #define LLVM_CLANG_FRONTEND_DIAGNOSTICOPTIONS_H
13 #include "clang/Basic/Diagnostic.h"
20 /// DiagnosticOptions - Options for controlling the compiler diagnostics
22 class DiagnosticOptions {
24 unsigned IgnoreWarnings : 1; /// -w
25 unsigned NoRewriteMacros : 1; /// -Wno-rewrite-macros
26 unsigned Pedantic : 1; /// -pedantic
27 unsigned PedanticErrors : 1; /// -pedantic-errors
28 unsigned ShowColumn : 1; /// Show column number on diagnostics.
29 unsigned ShowLocation : 1; /// Show source location information.
30 unsigned ShowCarets : 1; /// Show carets in diagnostics.
31 unsigned ShowFixits : 1; /// Show fixit information.
32 unsigned ShowSourceRanges : 1; /// Show source ranges in numeric form.
33 unsigned ShowParseableFixits : 1; /// Show machine parseable fix-its.
34 unsigned ShowOptionNames : 1; /// Show the option name for mappable
36 unsigned ShowNoteIncludeStack : 1; /// Show include stacks for notes.
37 unsigned ShowCategories : 2; /// Show categories: 0 -> none, 1 -> Number,
40 unsigned Format : 2; /// Format for diagnostics:
41 enum TextDiagnosticFormat { Clang, Msvc, Vi };
43 unsigned ShowColors : 1; /// Show diagnostics with ANSI color sequences.
44 unsigned ShowOverloads : 1; /// Overload candidates to show. Values from
45 /// DiagnosticsEngine::OverloadsShown
46 unsigned VerifyDiagnostics: 1; /// Check that diagnostics match the expected
47 /// diagnostics, indicated by markers in the
48 /// input source file.
50 unsigned ErrorLimit; /// Limit # errors emitted.
51 unsigned MacroBacktraceLimit; /// Limit depth of macro expansion backtrace.
52 unsigned TemplateBacktraceLimit; /// Limit depth of instantiation backtrace.
53 unsigned ConstexprBacktraceLimit; /// Limit depth of constexpr backtrace.
55 /// The distance between tab stops.
57 enum { DefaultTabStop = 8, MaxTabStop = 100,
58 DefaultMacroBacktraceLimit = 6,
59 DefaultTemplateBacktraceLimit = 10,
60 DefaultConstexprBacktraceLimit = 10 };
62 /// Column limit for formatting message diagnostics, or 0 if unused.
63 unsigned MessageLength;
65 /// If non-empty, a file to log extended build information to, for development
66 /// testing and analysis.
67 std::string DumpBuildInformation;
69 /// The file to log diagnostic output to.
70 std::string DiagnosticLogFile;
72 /// The file to serialize diagnostics to (non-appending).
73 std::string DiagnosticSerializationFile;
75 /// The list of -W... options used to alter the diagnostic mappings, with the
77 std::vector<std::string> Warnings;
82 TabStop = DefaultTabStop;
89 ShowOverloads = DiagnosticsEngine::Ovl_All;
97 ShowParseableFixits = 0;
98 VerifyDiagnostics = 0;
100 TemplateBacktraceLimit = DefaultTemplateBacktraceLimit;
101 MacroBacktraceLimit = DefaultMacroBacktraceLimit;
102 ConstexprBacktraceLimit = DefaultConstexprBacktraceLimit;
106 } // end namespace clang