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_BASIC_DIAGNOSTICOPTIONS_H
11 #define LLVM_CLANG_BASIC_DIAGNOSTICOPTIONS_H
13 #include "clang/Basic/LLVM.h"
14 #include "llvm/ADT/IntrusiveRefCntPtr.h"
20 /// \brief Specifies which overload candidates to display when overload
22 enum OverloadsShown : unsigned {
23 Ovl_All, ///< Show all overloads.
24 Ovl_Best ///< Show just the "best" overload candidates.
27 /// \brief Options for controlling the compiler diagnostics engine.
28 class DiagnosticOptions : public RefCountedBase<DiagnosticOptions>{
30 enum TextDiagnosticFormat { Clang, Msvc, Vi };
33 enum { DefaultTabStop = 8, MaxTabStop = 100,
34 DefaultMacroBacktraceLimit = 6,
35 DefaultTemplateBacktraceLimit = 10,
36 DefaultConstexprBacktraceLimit = 10,
37 DefaultSpellCheckingLimit = 50 };
39 // Define simple diagnostic options (with no accessors).
40 #define DIAGOPT(Name, Bits, Default) unsigned Name : Bits;
41 #define ENUM_DIAGOPT(Name, Type, Bits, Default)
42 #include "clang/Basic/DiagnosticOptions.def"
45 // Define diagnostic options of enumeration type. These are private, and will
46 // have accessors (below).
47 #define DIAGOPT(Name, Bits, Default)
48 #define ENUM_DIAGOPT(Name, Type, Bits, Default) unsigned Name : Bits;
49 #include "clang/Basic/DiagnosticOptions.def"
52 /// \brief The file to log diagnostic output to.
53 std::string DiagnosticLogFile;
55 /// \brief The file to serialize diagnostics to (non-appending).
56 std::string DiagnosticSerializationFile;
58 /// The list of -W... options used to alter the diagnostic mappings, with the
60 std::vector<std::string> Warnings;
62 /// The list of -R... options used to alter the diagnostic mappings, with the
64 std::vector<std::string> Remarks;
67 // Define accessors/mutators for diagnostic options of enumeration type.
68 #define DIAGOPT(Name, Bits, Default)
69 #define ENUM_DIAGOPT(Name, Type, Bits, Default) \
70 Type get##Name() const { return static_cast<Type>(Name); } \
71 void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
72 #include "clang/Basic/DiagnosticOptions.def"
75 #define DIAGOPT(Name, Bits, Default) Name = Default;
76 #define ENUM_DIAGOPT(Name, Type, Bits, Default) set##Name(Default);
77 #include "clang/Basic/DiagnosticOptions.def"
81 typedef DiagnosticOptions::TextDiagnosticFormat TextDiagnosticFormat;
83 } // end namespace clang