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 ShowNames : 1; /// Show the diagnostic name
35 unsigned ShowOptionNames : 1; /// Show the option name for mappable
37 unsigned ShowNoteIncludeStack : 1; /// Show include stacks for notes.
38 unsigned ShowCategories : 2; /// Show categories: 0 -> none, 1 -> Number,
41 unsigned Format : 2; /// Format for diagnostics:
42 enum TextDiagnosticFormat { Clang, Msvc, Vi };
44 unsigned ShowColors : 1; /// Show diagnostics with ANSI color sequences.
45 unsigned ShowOverloads : 1; /// Overload candidates to show. Values from
46 /// DiagnosticsEngine::OverloadsShown
47 unsigned VerifyDiagnostics: 1; /// Check that diagnostics match the expected
48 /// diagnostics, indicated by markers in the
49 /// input source file.
51 unsigned ErrorLimit; /// Limit # errors emitted.
52 unsigned MacroBacktraceLimit; /// Limit depth of macro expansion backtrace.
53 unsigned TemplateBacktraceLimit; /// Limit depth of instantiation backtrace.
55 /// The distance between tab stops.
57 enum { DefaultTabStop = 8, MaxTabStop = 100,
58 DefaultMacroBacktraceLimit = 6,
59 DefaultTemplateBacktraceLimit = 10 };
61 /// Column limit for formatting message diagnostics, or 0 if unused.
62 unsigned MessageLength;
64 /// If non-empty, a file to log extended build information to, for development
65 /// testing and analysis.
66 std::string DumpBuildInformation;
68 /// The file to log diagnostic output to.
69 std::string DiagnosticLogFile;
71 /// The list of -W... options used to alter the diagnostic mappings, with the
73 std::vector<std::string> Warnings;
78 TabStop = DefaultTabStop;
85 ShowOverloads = DiagnosticsEngine::Ovl_All;
94 ShowParseableFixits = 0;
95 VerifyDiagnostics = 0;
97 TemplateBacktraceLimit = DefaultTemplateBacktraceLimit;
98 MacroBacktraceLimit = DefaultMacroBacktraceLimit;
102 } // end namespace clang