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
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 };
38 // Define simple diagnostic options (with no accessors).
39 #define DIAGOPT(Name, Bits, Default) unsigned Name : Bits;
40 #define ENUM_DIAGOPT(Name, Type, Bits, Default)
41 #include "clang/Basic/DiagnosticOptions.def"
44 // Define diagnostic options of enumeration type. These are private, and will
45 // have accessors (below).
46 #define DIAGOPT(Name, Bits, Default)
47 #define ENUM_DIAGOPT(Name, Type, Bits, Default) unsigned Name : Bits;
48 #include "clang/Basic/DiagnosticOptions.def"
51 /// \brief The file to log diagnostic output to.
52 std::string DiagnosticLogFile;
54 /// \brief The file to serialize diagnostics to (non-appending).
55 std::string DiagnosticSerializationFile;
57 /// The list of -W... options used to alter the diagnostic mappings, with the
59 std::vector<std::string> Warnings;
62 // Define accessors/mutators for diagnostic options of enumeration type.
63 #define DIAGOPT(Name, Bits, Default)
64 #define ENUM_DIAGOPT(Name, Type, Bits, Default) \
65 Type get##Name() const { return static_cast<Type>(Name); } \
66 void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
67 #include "clang/Basic/DiagnosticOptions.def"
70 #define DIAGOPT(Name, Bits, Default) Name = Default;
71 #define ENUM_DIAGOPT(Name, Type, Bits, Default) set##Name(Default);
72 #include "clang/Basic/DiagnosticOptions.def"
76 typedef DiagnosticOptions::TextDiagnosticFormat TextDiagnosticFormat;
78 } // end namespace clang