clang  16.0.0git
DiagnosticIDs.h
Go to the documentation of this file.
1 //===--- DiagnosticIDs.h - Diagnostic IDs Handling --------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// Defines the Diagnostic IDs-related interfaces.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_BASIC_DIAGNOSTICIDS_H
15 #define LLVM_CLANG_BASIC_DIAGNOSTICIDS_H
16 
17 #include "clang/Basic/LLVM.h"
18 #include "llvm/ADT/IntrusiveRefCntPtr.h"
19 #include "llvm/ADT/StringRef.h"
20 #include <vector>
21 
22 namespace clang {
23  class DiagnosticsEngine;
24  class SourceLocation;
25 
26  // Import the diagnostic enums themselves.
27  namespace diag {
28  enum class Group;
29 
30  // Size of each of the diagnostic categories.
31  enum {
44  };
45  // Start position for diagnostics.
46  enum {
60  };
61 
63 
64  /// All of the diagnostics that can be emitted by the frontend.
65  typedef unsigned kind;
66 
67  // Get typedefs for common diagnostics.
68  enum {
69 #define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, CATEGORY, \
70  NOWERROR, SHOWINSYSHEADER, SHOWINSYSMACRO, DEFFERABLE) \
71  ENUM,
72 #define COMMONSTART
73 #include "clang/Basic/DiagnosticCommonKinds.inc"
75 #undef DIAG
76  };
77 
78  /// Enum values that allow the client to map NOTEs, WARNINGs, and EXTENSIONs
79  /// to either Ignore (nothing), Remark (emit a remark), Warning
80  /// (emit a warning) or Error (emit as an error). It allows clients to
81  /// map ERRORs to Error or Fatal (stop emitting diagnostics after this one).
82  enum class Severity {
83  // NOTE: 0 means "uncomputed".
84  Ignored = 1, ///< Do not present this diagnostic, ignore it.
85  Remark = 2, ///< Present this diagnostic as a remark.
86  Warning = 3, ///< Present this diagnostic as a warning.
87  Error = 4, ///< Present this diagnostic as an error.
88  Fatal = 5 ///< Present this diagnostic as a fatal error.
89  };
90 
91  /// Flavors of diagnostics we can emit. Used to filter for a particular
92  /// kind of diagnostic (for instance, for -W/-R flags).
93  enum class Flavor {
94  WarningOrError, ///< A diagnostic that indicates a problem or potential
95  ///< problem. Can be made fatal by -Werror.
96  Remark ///< A diagnostic that indicates normal progress through
97  ///< compilation.
98  };
99  }
100 
102  unsigned Severity : 3;
103  unsigned IsUser : 1;
104  unsigned IsPragma : 1;
105  unsigned HasNoWarningAsError : 1;
106  unsigned HasNoErrorAsFatal : 1;
107  unsigned WasUpgradedFromWarning : 1;
108 
109 public:
110  static DiagnosticMapping Make(diag::Severity Severity, bool IsUser,
111  bool IsPragma) {
112  DiagnosticMapping Result;
113  Result.Severity = (unsigned)Severity;
114  Result.IsUser = IsUser;
115  Result.IsPragma = IsPragma;
116  Result.HasNoWarningAsError = 0;
117  Result.HasNoErrorAsFatal = 0;
118  Result.WasUpgradedFromWarning = 0;
119  return Result;
120  }
121 
122  diag::Severity getSeverity() const { return (diag::Severity)Severity; }
124 
125  bool isUser() const { return IsUser; }
126  bool isPragma() const { return IsPragma; }
127 
128  bool isErrorOrFatal() const {
129  return getSeverity() == diag::Severity::Error ||
131  }
132 
133  bool hasNoWarningAsError() const { return HasNoWarningAsError; }
134  void setNoWarningAsError(bool Value) { HasNoWarningAsError = Value; }
135 
136  bool hasNoErrorAsFatal() const { return HasNoErrorAsFatal; }
137  void setNoErrorAsFatal(bool Value) { HasNoErrorAsFatal = Value; }
138 
139  /// Whether this mapping attempted to map the diagnostic to a warning, but
140  /// was overruled because the diagnostic was already mapped to an error or
141  /// fatal error.
142  bool wasUpgradedFromWarning() const { return WasUpgradedFromWarning; }
143  void setUpgradedFromWarning(bool Value) { WasUpgradedFromWarning = Value; }
144 
145  /// Serialize this mapping as a raw integer.
146  unsigned serialize() const {
147  return (IsUser << 7) | (IsPragma << 6) | (HasNoWarningAsError << 5) |
148  (HasNoErrorAsFatal << 4) | (WasUpgradedFromWarning << 3) | Severity;
149  }
150  /// Deserialize a mapping.
151  static DiagnosticMapping deserialize(unsigned Bits) {
152  DiagnosticMapping Result;
153  Result.IsUser = (Bits >> 7) & 1;
154  Result.IsPragma = (Bits >> 6) & 1;
155  Result.HasNoWarningAsError = (Bits >> 5) & 1;
156  Result.HasNoErrorAsFatal = (Bits >> 4) & 1;
157  Result.WasUpgradedFromWarning = (Bits >> 3) & 1;
158  Result.Severity = Bits & 0x7;
159  return Result;
160  }
161 };
162 
163 /// Used for handling and querying diagnostic IDs.
164 ///
165 /// Can be used and shared by multiple Diagnostics for multiple translation units.
166 class DiagnosticIDs : public RefCountedBase<DiagnosticIDs> {
167 public:
168  /// The level of the diagnostic, after it has been through mapping.
169  enum Level {
171  };
172 
173 private:
174  /// Information for uniquing and looking up custom diags.
175  std::unique_ptr<diag::CustomDiagInfo> CustomDiagInfo;
176 
177 public:
178  DiagnosticIDs();
179  ~DiagnosticIDs();
180 
181  /// Return an ID for a diagnostic with the specified format string and
182  /// level.
183  ///
184  /// If this is the first request for this diagnostic, it is registered and
185  /// created, otherwise the existing ID is returned.
186 
187  // FIXME: Replace this function with a create-only facilty like
188  // createCustomDiagIDFromFormatString() to enforce safe usage. At the time of
189  // writing, nearly all callers of this function were invalid.
190  unsigned getCustomDiagID(Level L, StringRef FormatString);
191 
192  //===--------------------------------------------------------------------===//
193  // Diagnostic classification and reporting interfaces.
194  //
195 
196  /// Given a diagnostic ID, return a description of the issue.
197  StringRef getDescription(unsigned DiagID) const;
198 
199  /// Return true if the unmapped diagnostic levelof the specified
200  /// diagnostic ID is a Warning or Extension.
201  ///
202  /// This only works on builtin diagnostics, not custom ones, and is not
203  /// legal to call on NOTEs.
204  static bool isBuiltinWarningOrExtension(unsigned DiagID);
205 
206  /// Return true if the specified diagnostic is mapped to errors by
207  /// default.
208  static bool isDefaultMappingAsError(unsigned DiagID);
209 
210  /// Determine whether the given built-in diagnostic ID is a Note.
211  static bool isBuiltinNote(unsigned DiagID);
212 
213  /// Determine whether the given built-in diagnostic ID is for an
214  /// extension of some sort.
215  static bool isBuiltinExtensionDiag(unsigned DiagID) {
216  bool ignored;
217  return isBuiltinExtensionDiag(DiagID, ignored);
218  }
219 
220  /// Determine whether the given built-in diagnostic ID is for an
221  /// extension of some sort, and whether it is enabled by default.
222  ///
223  /// This also returns EnabledByDefault, which is set to indicate whether the
224  /// diagnostic is ignored by default (in which case -pedantic enables it) or
225  /// treated as a warning/error by default.
226  ///
227  static bool isBuiltinExtensionDiag(unsigned DiagID, bool &EnabledByDefault);
228 
229  /// Given a group ID, returns the flag that toggles the group.
230  /// For example, for Group::DeprecatedDeclarations, returns
231  /// "deprecated-declarations".
232  static StringRef getWarningOptionForGroup(diag::Group);
233 
234  /// Given a diagnostic group ID, return its documentation.
235  static StringRef getWarningOptionDocumentation(diag::Group GroupID);
236 
237  /// Given a group ID, returns the flag that toggles the group.
238  /// For example, for "deprecated-declarations", returns
239  /// Group::DeprecatedDeclarations.
241 
242  /// Return the lowest-level group that contains the specified diagnostic.
243  static llvm::Optional<diag::Group> getGroupForDiag(unsigned DiagID);
244 
245  /// Return the lowest-level warning option that enables the specified
246  /// diagnostic.
247  ///
248  /// If there is no -Wfoo flag that controls the diagnostic, this returns null.
249  static StringRef getWarningOptionForDiag(unsigned DiagID);
250 
251  /// Return the category number that a specified \p DiagID belongs to,
252  /// or 0 if no category.
253  static unsigned getCategoryNumberForDiag(unsigned DiagID);
254 
255  /// Return the number of diagnostic categories.
256  static unsigned getNumberOfCategories();
257 
258  /// Given a category ID, return the name of the category.
259  static StringRef getCategoryNameFromID(unsigned CategoryID);
260 
261  /// Return true if a given diagnostic falls into an ARC diagnostic
262  /// category.
263  static bool isARCDiagnostic(unsigned DiagID);
264 
265  /// Enumeration describing how the emission of a diagnostic should
266  /// be treated when it occurs during C++ template argument deduction.
268  /// The diagnostic should not be reported, but it should cause
269  /// template argument deduction to fail.
270  ///
271  /// The vast majority of errors that occur during template argument
272  /// deduction fall into this category.
274 
275  /// The diagnostic should be suppressed entirely.
276  ///
277  /// Warnings generally fall into this category.
279 
280  /// The diagnostic should be reported.
281  ///
282  /// The diagnostic should be reported. Various fatal errors (e.g.,
283  /// template instantiation depth exceeded) fall into this category.
285 
286  /// The diagnostic is an access-control diagnostic, which will be
287  /// substitution failures in some contexts and reported in others.
289  };
290 
291  /// Determines whether the given built-in diagnostic ID is
292  /// for an error that is suppressed if it occurs during C++ template
293  /// argument deduction.
294  ///
295  /// When an error is suppressed due to SFINAE, the template argument
296  /// deduction fails but no diagnostic is emitted. Certain classes of
297  /// errors, such as those errors that involve C++ access control,
298  /// are not SFINAE errors.
299  static SFINAEResponse getDiagnosticSFINAEResponse(unsigned DiagID);
300 
301  /// Whether the diagnostic message can be deferred.
302  ///
303  /// For single source offloading languages, a diagnostic message occurred
304  /// in a device host function may be deferred until the function is sure
305  /// to be emitted.
306  static bool isDeferrable(unsigned DiagID);
307 
308  /// Get the string of all diagnostic flags.
309  ///
310  /// \returns A list of all diagnostics flags as they would be written in a
311  /// command line invocation including their `no-` variants. For example:
312  /// `{"-Wempty-body", "-Wno-empty-body", ...}`
313  static std::vector<std::string> getDiagnosticFlags();
314 
315  /// Get the set of all diagnostic IDs in the group with the given name.
316  ///
317  /// \param[out] Diags - On return, the diagnostics in the group.
318  /// \returns \c true if the given group is unknown, \c false otherwise.
320  SmallVectorImpl<diag::kind> &Diags) const;
321 
322  /// Get the set of all diagnostic IDs.
324  std::vector<diag::kind> &Diags);
325 
326  /// Get the diagnostic option with the closest edit distance to the
327  /// given group name.
328  static StringRef getNearestOption(diag::Flavor Flavor, StringRef Group);
329 
330 private:
331  /// Classify the specified diagnostic ID into a Level, consumable by
332  /// the DiagnosticClient.
333  ///
334  /// The classification is based on the way the client configured the
335  /// DiagnosticsEngine object.
336  ///
337  /// \param Loc The source location for which we are interested in finding out
338  /// the diagnostic state. Can be null in order to query the latest state.
340  getDiagnosticLevel(unsigned DiagID, SourceLocation Loc,
341  const DiagnosticsEngine &Diag) const LLVM_READONLY;
342 
344  getDiagnosticSeverity(unsigned DiagID, SourceLocation Loc,
345  const DiagnosticsEngine &Diag) const LLVM_READONLY;
346 
347  /// Used to report a diagnostic that is finally fully formed.
348  ///
349  /// \returns \c true if the diagnostic was emitted, \c false if it was
350  /// suppressed.
351  bool ProcessDiag(DiagnosticsEngine &Diag) const;
352 
353  /// Used to emit a diagnostic that is finally fully formed,
354  /// ignoring suppression.
355  void EmitDiag(DiagnosticsEngine &Diag, Level DiagLevel) const;
356 
357  /// Whether the diagnostic may leave the AST in a state where some
358  /// invariants can break.
359  bool isUnrecoverable(unsigned DiagID) const;
360 
361  friend class DiagnosticsEngine;
362 };
363 
364 } // end namespace clang
365 
366 #endif
clang::DiagnosticIDs::isDeferrable
static bool isDeferrable(unsigned DiagID)
Whether the diagnostic message can be deferred.
Definition: DiagnosticIDs.cpp:341
clang::diag::Severity
Severity
Enum values that allow the client to map NOTEs, WARNINGs, and EXTENSIONs to either Ignore (nothing),...
Definition: DiagnosticIDs.h:82
clang::DiagnosticMapping::deserialize
static DiagnosticMapping deserialize(unsigned Bits)
Deserialize a mapping.
Definition: DiagnosticIDs.h:151
clang::DiagnosticIDs::getAllDiagnostics
static void getAllDiagnostics(diag::Flavor Flavor, std::vector< diag::kind > &Diags)
Get the set of all diagnostic IDs.
Definition: DiagnosticIDs.cpp:712
clang::diag::Severity::Error
@ Error
Present this diagnostic as an error.
clang::DiagnosticIDs::getDiagnosticFlags
static std::vector< std::string > getDiagnosticFlags()
Get the string of all diagnostic flags.
Definition: DiagnosticIDs.cpp:661
Diag
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
Definition: LiteralSupport.cpp:79
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
clang::DiagnosticIDs::getCustomDiagID
unsigned getCustomDiagID(Level L, StringRef FormatString)
Return an ID for a diagnostic with the specified format string and level.
Definition: DiagnosticIDs.cpp:416
clang::diag::DIAG_START_COMMON
@ DIAG_START_COMMON
Definition: DiagnosticIDs.h:47
clang::DiagnosticsEngine
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:192
clang::diag::Severity::Remark
@ Remark
Present this diagnostic as a remark.
clang::DiagnosticMapping::hasNoWarningAsError
bool hasNoWarningAsError() const
Definition: DiagnosticIDs.h:133
llvm::Optional
Definition: LLVM.h:40
clang::DiagnosticIDs::Level
Level
The level of the diagnostic, after it has been through mapping.
Definition: DiagnosticIDs.h:169
clang::diag::Group
Group
Definition: DiagnosticCategories.h:23
clang::DiagnosticIDs::isBuiltinNote
static bool isBuiltinNote(unsigned DiagID)
Determine whether the given built-in diagnostic ID is a Note.
Definition: DiagnosticIDs.cpp:434
clang::DiagnosticMapping::setUpgradedFromWarning
void setUpgradedFromWarning(bool Value)
Definition: DiagnosticIDs.h:143
clang::diag::DIAG_SIZE_SERIALIZATION
@ DIAG_SIZE_SERIALIZATION
Definition: DiagnosticIDs.h:35
clang::DiagnosticIDs::getDiagnosticsInGroup
bool getDiagnosticsInGroup(diag::Flavor Flavor, StringRef Group, SmallVectorImpl< diag::kind > &Diags) const
Get the set of all diagnostic IDs in the group with the given name.
Definition: DiagnosticIDs.cpp:704
llvm::RefCountedBase
Definition: LLVM.h:49
clang::DiagnosticMapping::hasNoErrorAsFatal
bool hasNoErrorAsFatal() const
Definition: DiagnosticIDs.h:136
clang::diag::NUM_BUILTIN_COMMON_DIAGNOSTICS
@ NUM_BUILTIN_COMMON_DIAGNOSTICS
Definition: DiagnosticIDs.h:74
clang::diag::Severity::Ignored
@ Ignored
Do not present this diagnostic, ignore it.
clang::DiagnosticIDs::SFINAEResponse
SFINAEResponse
Enumeration describing how the emission of a diagnostic should be treated when it occurs during C++ t...
Definition: DiagnosticIDs.h:267
clang::DiagnosticIDs::getWarningOptionForGroup
static StringRef getWarningOptionForGroup(diag::Group)
Given a group ID, returns the flag that toggles the group.
Definition: DiagnosticIDs.cpp:633
clang::diag::Flavor::WarningOrError
@ WarningOrError
A diagnostic that indicates a problem or potential problem.
clang::diag::DIAG_START_FRONTEND
@ DIAG_START_FRONTEND
Definition: DiagnosticIDs.h:49
clang::diag::DIAG_SIZE_AST
@ DIAG_SIZE_AST
Definition: DiagnosticIDs.h:38
clang::diag::DIAG_START_REFACTORING
@ DIAG_START_REFACTORING
Definition: DiagnosticIDs.h:58
clang::diag::DIAG_SIZE_COMMON
@ DIAG_SIZE_COMMON
Definition: DiagnosticIDs.h:32
clang::diag::Severity::Fatal
@ Fatal
Present this diagnostic as a fatal error.
clang::DiagnosticIDs::isDefaultMappingAsError
static bool isDefaultMappingAsError(unsigned DiagID)
Return true if the specified diagnostic is mapped to errors by default.
Definition: DiagnosticIDs.cpp:455
clang::diag::DIAG_SIZE_ANALYSIS
@ DIAG_SIZE_ANALYSIS
Definition: DiagnosticIDs.h:42
clang::DiagnosticIDs::getDescription
StringRef getDescription(unsigned DiagID) const
Given a diagnostic ID, return a description of the issue.
Definition: DiagnosticIDs.cpp:464
clang::DiagnosticIDs::isARCDiagnostic
static bool isARCDiagnostic(unsigned DiagID)
Return true if a given diagnostic falls into an ARC diagnostic category.
Definition: DiagnosticIDs.cpp:868
clang::DiagnosticMapping
Definition: DiagnosticIDs.h:101
clang::DiagnosticIDs::getDiagnosticSFINAEResponse
static SFINAEResponse getDiagnosticSFINAEResponse(unsigned DiagID)
Determines whether the given built-in diagnostic ID is for an error that is suppressed if it occurs d...
Definition: DiagnosticIDs.cpp:335
clang::DiagnosticIDs::SFINAE_Suppress
@ SFINAE_Suppress
The diagnostic should be suppressed entirely.
Definition: DiagnosticIDs.h:278
clang::DiagnosticIDs::Note
@ Note
Definition: DiagnosticIDs.h:170
clang::DiagnosticIDs::getWarningOptionDocumentation
static StringRef getWarningOptionDocumentation(diag::Group GroupID)
Given a diagnostic group ID, return its documentation.
Definition: DiagnosticIDs.cpp:629
clang::DiagnosticMapping::wasUpgradedFromWarning
bool wasUpgradedFromWarning() const
Whether this mapping attempted to map the diagnostic to a warning, but was overruled because the diag...
Definition: DiagnosticIDs.h:142
clang::DiagnosticIDs::SFINAE_SubstitutionFailure
@ SFINAE_SubstitutionFailure
The diagnostic should not be reported, but it should cause template argument deduction to fail.
Definition: DiagnosticIDs.h:273
clang::diag::DIAG_UPPER_LIMIT
@ DIAG_UPPER_LIMIT
Definition: DiagnosticIDs.h:59
clang::diag::DIAG_START_LEX
@ DIAG_START_LEX
Definition: DiagnosticIDs.h:51
clang::diag::DIAG_START_SERIALIZATION
@ DIAG_START_SERIALIZATION
Definition: DiagnosticIDs.h:50
clang::DiagnosticIDs::getCategoryNumberForDiag
static unsigned getCategoryNumberForDiag(unsigned DiagID)
Return the category number that a specified DiagID belongs to, or 0 if no category.
Definition: DiagnosticIDs.cpp:277
clang::DiagnosticIDs::DiagnosticIDs
DiagnosticIDs()
Definition: DiagnosticIDs.cpp:406
clang::diag::Severity::Warning
@ Warning
Present this diagnostic as a warning.
clang::diag::DIAG_SIZE_CROSSTU
@ DIAG_SIZE_CROSSTU
Definition: DiagnosticIDs.h:40
clang::DiagnosticMapping::getSeverity
diag::Severity getSeverity() const
Definition: DiagnosticIDs.h:122
clang::DiagnosticIDs::getGroupForWarningOption
static llvm::Optional< diag::Group > getGroupForWarningOption(StringRef)
Given a group ID, returns the flag that toggles the group.
Definition: DiagnosticIDs.cpp:638
clang::DiagnosticIDs::getCategoryNameFromID
static StringRef getCategoryNameFromID(unsigned CategoryID)
Given a category ID, return the name of the category.
Definition: DiagnosticIDs.cpp:326
clang::diag::DIAG_START_ANALYSIS
@ DIAG_START_ANALYSIS
Definition: DiagnosticIDs.h:57
clang::diag::CustomDiagInfo
Definition: DiagnosticIDs.cpp:361
clang::diag::DIAG_SIZE_LEX
@ DIAG_SIZE_LEX
Definition: DiagnosticIDs.h:36
Value
Value
Definition: UninitializedValues.cpp:103
LLVM.h
clang::DiagnosticIDs
Used for handling and querying diagnostic IDs.
Definition: DiagnosticIDs.h:166
clang::diag::Flavor
Flavor
Flavors of diagnostics we can emit.
Definition: DiagnosticIDs.h:93
clang::DiagnosticMapping::setNoErrorAsFatal
void setNoErrorAsFatal(bool Value)
Definition: DiagnosticIDs.h:137
clang::diag::DIAG_SIZE_FRONTEND
@ DIAG_SIZE_FRONTEND
Definition: DiagnosticIDs.h:34
clang::DiagnosticMapping::setSeverity
void setSeverity(diag::Severity Value)
Definition: DiagnosticIDs.h:123
clang::DiagnosticMapping::serialize
unsigned serialize() const
Serialize this mapping as a raw integer.
Definition: DiagnosticIDs.h:146
clang::DiagnosticIDs::Error
@ Error
Definition: DiagnosticIDs.h:170
clang::DiagnosticIDs::Remark
@ Remark
Definition: DiagnosticIDs.h:170
clang::diag::Flavor::Remark
@ Remark
A diagnostic that indicates normal progress through compilation.
clang::diag::DIAG_START_CROSSTU
@ DIAG_START_CROSSTU
Definition: DiagnosticIDs.h:55
clang::DiagnosticIDs::Warning
@ Warning
Definition: DiagnosticIDs.h:170
clang::diag::DIAG_SIZE_SEMA
@ DIAG_SIZE_SEMA
Definition: DiagnosticIDs.h:41
clang::DiagnosticMapping::isPragma
bool isPragma() const
Definition: DiagnosticIDs.h:126
clang
Definition: CalledOnceCheck.h:17
clang::diag::DIAG_START_SEMA
@ DIAG_START_SEMA
Definition: DiagnosticIDs.h:56
clang::diag::DIAG_START_AST
@ DIAG_START_AST
Definition: DiagnosticIDs.h:53
clang::DiagnosticIDs::Ignored
@ Ignored
Definition: DiagnosticIDs.h:170
clang::DiagnosticIDs::~DiagnosticIDs
~DiagnosticIDs()
Definition: DiagnosticIDs.cpp:408
clang::diag::DIAG_SIZE_REFACTORING
@ DIAG_SIZE_REFACTORING
Definition: DiagnosticIDs.h:43
clang::DiagnosticIDs::getNumberOfCategories
static unsigned getNumberOfCategories()
Return the number of diagnostic categories.
Definition: DiagnosticIDs.cpp:319
unsigned
clang::diag::DIAG_SIZE_PARSE
@ DIAG_SIZE_PARSE
Definition: DiagnosticIDs.h:37
clang::DiagnosticMapping::Make
static DiagnosticMapping Make(diag::Severity Severity, bool IsUser, bool IsPragma)
Definition: DiagnosticIDs.h:110
clang::diag::DIAG_SIZE_COMMENT
@ DIAG_SIZE_COMMENT
Definition: DiagnosticIDs.h:39
clang::diag::DIAG_SIZE_DRIVER
@ DIAG_SIZE_DRIVER
Definition: DiagnosticIDs.h:33
clang::DiagnosticMapping::isUser
bool isUser() const
Definition: DiagnosticIDs.h:125
clang::DiagnosticIDs::getNearestOption
static StringRef getNearestOption(diag::Flavor Flavor, StringRef Group)
Get the diagnostic option with the closest edit distance to the given group name.
Definition: DiagnosticIDs.cpp:719
clang::diag::DIAG_START_PARSE
@ DIAG_START_PARSE
Definition: DiagnosticIDs.h:52
clang::DiagnosticMapping::isErrorOrFatal
bool isErrorOrFatal() const
Definition: DiagnosticIDs.h:128
clang::DiagnosticIDs::isBuiltinWarningOrExtension
static bool isBuiltinWarningOrExtension(unsigned DiagID)
Return true if the unmapped diagnostic levelof the specified diagnostic ID is a Warning or Extension.
Definition: DiagnosticIDs.cpp:427
clang::DiagnosticIDs::isBuiltinExtensionDiag
static bool isBuiltinExtensionDiag(unsigned DiagID)
Determine whether the given built-in diagnostic ID is for an extension of some sort.
Definition: DiagnosticIDs.h:215
llvm::SmallVectorImpl
Definition: Randstruct.h:18
clang::DiagnosticMapping::setNoWarningAsError
void setNoWarningAsError(bool Value)
Definition: DiagnosticIDs.h:134
clang::diag::DIAG_START_DRIVER
@ DIAG_START_DRIVER
Definition: DiagnosticIDs.h:48
clang::diag::kind
unsigned kind
All of the diagnostics that can be emitted by the frontend.
Definition: DiagnosticIDs.h:62
clang::DiagnosticIDs::getWarningOptionForDiag
static StringRef getWarningOptionForDiag(unsigned DiagID)
Return the lowest-level warning option that enables the specified diagnostic.
Definition: DiagnosticIDs.cpp:655
clang::DiagnosticIDs::getGroupForDiag
static llvm::Optional< diag::Group > getGroupForDiag(unsigned DiagID)
Return the lowest-level group that contains the specified diagnostic.
Definition: DiagnosticIDs.cpp:646
clang::DiagnosticIDs::SFINAE_Report
@ SFINAE_Report
The diagnostic should be reported.
Definition: DiagnosticIDs.h:284
clang::diag::DIAG_START_COMMENT
@ DIAG_START_COMMENT
Definition: DiagnosticIDs.h:54
clang::DiagnosticIDs::SFINAE_AccessControl
@ SFINAE_AccessControl
The diagnostic is an access-control diagnostic, which will be substitution failures in some contexts ...
Definition: DiagnosticIDs.h:288
clang::DiagnosticIDs::Fatal
@ Fatal
Definition: DiagnosticIDs.h:170