clang 24.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
18#include "clang/Basic/LLVM.h"
19#include "llvm/ADT/IntrusiveRefCntPtr.h"
20#include "llvm/ADT/StringRef.h"
21#include "llvm/Support/ErrorHandling.h"
22#include <optional>
23#include <vector>
24
25namespace clang {
28class LangOptions;
29class SourceLocation;
30
31// Import the diagnostic enums themselves.
32namespace diag {
33enum class Group;
34
35// Size of each of the diagnostic categories.
36enum {
52};
53// Start position for diagnostics.
54// clang-format off
55enum {
72};
73// clang-format on
74
75class CustomDiagInfo;
76
77/// All of the diagnostics that can be emitted by the frontend.
78typedef unsigned kind;
79
80/// Enum values that allow the client to map NOTEs, WARNINGs, and EXTENSIONs
81/// to either Ignore (nothing), Remark (emit a remark), Warning
82/// (emit a warning) or Error (emit as an error). It allows clients to
83/// map ERRORs to Error or Fatal (stop emitting diagnostics after this one).
84enum class Severity : uint8_t {
85 // NOTE: 0 means "uncomputed".
86 Ignored = 1, ///< Do not present this diagnostic, ignore it.
87 Remark = 2, ///< Present this diagnostic as a remark.
88 Warning = 3, ///< Present this diagnostic as a warning.
89 Error = 4, ///< Present this diagnostic as an error.
90 Fatal = 5 ///< Present this diagnostic as a fatal error.
91};
92
93/// Flavors of diagnostics we can emit. Used to filter for a particular
94/// kind of diagnostic (for instance, for -W/-R flags).
95enum class Flavor {
96 WarningOrError, ///< A diagnostic that indicates a problem or potential
97 ///< problem. Can be made fatal by -Werror.
98 Remark ///< A diagnostic that indicates normal progress through
99 ///< compilation.
100};
101} // end namespace diag
102} // end namespace clang
103
104// This has to be included *after* the DIAG_START_ enums above are defined.
105#include "clang/Basic/DiagnosticCommonInterface.inc"
106
107namespace clang {
109 LLVM_PREFERRED_TYPE(diag::Severity)
110 unsigned Severity : 3;
111 LLVM_PREFERRED_TYPE(bool)
112 unsigned IsUser : 1;
113 LLVM_PREFERRED_TYPE(bool)
114 unsigned IsPragma : 1;
115 LLVM_PREFERRED_TYPE(bool)
116 unsigned HasNoWarningAsError : 1;
117 LLVM_PREFERRED_TYPE(bool)
118 unsigned HasNoErrorAsFatal : 1;
119 LLVM_PREFERRED_TYPE(bool)
120 unsigned WasUpgradedFromWarning : 1;
121
122public:
123 static DiagnosticMapping Make(diag::Severity Severity, bool IsUser,
124 bool IsPragma) {
126 Result.Severity = (unsigned)Severity;
127 Result.IsUser = IsUser;
128 Result.IsPragma = IsPragma;
129 Result.HasNoWarningAsError = 0;
130 Result.HasNoErrorAsFatal = 0;
131 Result.WasUpgradedFromWarning = 0;
132 return Result;
133 }
134
135 diag::Severity getSeverity() const { return (diag::Severity)Severity; }
137
138 bool isUser() const { return IsUser; }
139 bool isPragma() const { return IsPragma; }
140
141 bool isErrorOrFatal() const {
144 }
145
146 bool hasNoWarningAsError() const { return HasNoWarningAsError; }
147 void setNoWarningAsError(bool Value) { HasNoWarningAsError = Value; }
148
149 bool hasNoErrorAsFatal() const { return HasNoErrorAsFatal; }
150 void setNoErrorAsFatal(bool Value) { HasNoErrorAsFatal = Value; }
151
152 /// Whether this mapping attempted to map the diagnostic to a warning, but
153 /// was overruled because the diagnostic was already mapped to an error or
154 /// fatal error.
155 bool wasUpgradedFromWarning() const { return WasUpgradedFromWarning; }
156 void setUpgradedFromWarning(bool Value) { WasUpgradedFromWarning = Value; }
157
158 /// Serialize this mapping as a raw integer.
159 unsigned serialize() const {
160 return (IsUser << 7) | (IsPragma << 6) | (HasNoWarningAsError << 5) |
161 (HasNoErrorAsFatal << 4) | (WasUpgradedFromWarning << 3) | Severity;
162 }
163 /// Deserialize a mapping.
164 static DiagnosticMapping deserialize(unsigned Bits) {
166 Result.IsUser = (Bits >> 7) & 1;
167 Result.IsPragma = (Bits >> 6) & 1;
168 Result.HasNoWarningAsError = (Bits >> 5) & 1;
169 Result.HasNoErrorAsFatal = (Bits >> 4) & 1;
170 Result.WasUpgradedFromWarning = (Bits >> 3) & 1;
171 Result.Severity = Bits & 0x7;
172 return Result;
173 }
174
176 return serialize() == Other.serialize();
177 }
178};
179
180/// Used for handling and querying diagnostic IDs.
181///
182/// Can be used and shared by multiple Diagnostics for multiple translation
183/// units.
184class DiagnosticIDs : public RefCountedBase<DiagnosticIDs> {
185public:
186 /// The level of the diagnostic, after it has been through mapping.
188
189 // Diagnostic classes.
199
202 }
203
205 LLVM_PREFERRED_TYPE(diag::Severity)
206 unsigned DefaultSeverity : 3;
207 LLVM_PREFERRED_TYPE(Class)
208 unsigned DiagClass : 3;
209 LLVM_PREFERRED_TYPE(bool)
210 unsigned ShowInSystemHeader : 1;
211 LLVM_PREFERRED_TYPE(bool)
212 unsigned ShowInSystemMacro : 1;
213 LLVM_PREFERRED_TYPE(bool)
214 unsigned HasGroup : 1;
215 diag::Group Group;
216 std::string Description;
217
218 auto get_as_tuple() const {
219 return std::tuple(DefaultSeverity, DiagClass, ShowInSystemHeader,
220 ShowInSystemMacro, HasGroup, Group,
221 std::string_view{Description});
222 }
223
224 public:
225 CustomDiagDesc(diag::Severity DefaultSeverity, std::string Description,
226 unsigned Class = CLASS_WARNING,
227 bool ShowInSystemHeader = false,
228 bool ShowInSystemMacro = false,
229 std::optional<diag::Group> Group = std::nullopt)
230 : DefaultSeverity(static_cast<unsigned>(DefaultSeverity)),
231 DiagClass(Class), ShowInSystemHeader(ShowInSystemHeader),
232 ShowInSystemMacro(ShowInSystemMacro), HasGroup(Group != std::nullopt),
233 Group(Group.value_or(diag::Group{})),
234 Description(std::move(Description)) {}
235
236 std::optional<diag::Group> GetGroup() const {
237 if (HasGroup)
238 return Group;
239 return std::nullopt;
240 }
241
243 return static_cast<diag::Severity>(DefaultSeverity);
244 }
245
246 Class GetClass() const { return static_cast<Class>(DiagClass); }
247 std::string_view GetDescription() const { return Description; }
248 bool ShouldShowInSystemHeader() const { return ShowInSystemHeader; }
249
250 friend bool operator==(const CustomDiagDesc &lhs,
251 const CustomDiagDesc &rhs) {
252 return lhs.get_as_tuple() == rhs.get_as_tuple();
253 }
254
255 friend bool operator<(const CustomDiagDesc &lhs,
256 const CustomDiagDesc &rhs) {
257 return lhs.get_as_tuple() < rhs.get_as_tuple();
258 }
259 };
260
261 struct GroupInfo {
262 LLVM_PREFERRED_TYPE(diag::Severity)
264 LLVM_PREFERRED_TYPE(bool)
266 };
267
268private:
269 /// Information for uniquing and looking up custom diags.
270 std::unique_ptr<diag::CustomDiagInfo> CustomDiagInfo;
271 std::unique_ptr<GroupInfo[]> GroupInfos = []() {
272 auto GIs = std::make_unique<GroupInfo[]>(
273 static_cast<size_t>(diag::Group::NUM_GROUPS));
274 for (size_t i = 0; i != static_cast<size_t>(diag::Group::NUM_GROUPS); ++i)
275 GIs[i] = {{}, false};
276 return GIs;
277 }();
278
279public:
282
283 // Convenience method to construct a new refcounted DiagnosticIDs.
285 return llvm::makeIntrusiveRefCnt<DiagnosticIDs>();
286 }
287
288 /// Return an ID for a diagnostic with the specified format string and
289 /// level.
290 ///
291 /// If this is the first request for this diagnostic, it is registered and
292 /// created, otherwise the existing ID is returned.
293
294 // FIXME: Replace this function with a create-only facilty like
295 // createCustomDiagIDFromFormatString() to enforce safe usage. At the time of
296 // writing, nearly all callers of this function were invalid.
297 unsigned getCustomDiagID(CustomDiagDesc Diag);
298
299 // FIXME: this API should almost never be used; custom diagnostics do not
300 // have an associated diagnostic group and thus cannot be controlled by users
301 // like other diagnostics. The number of times this API is used in Clang
302 // should only ever be reduced, not increased.
303 // [[deprecated("Use a CustomDiagDesc instead of a Level")]]
304 unsigned getCustomDiagID(Level Level, StringRef Message) {
305 return getCustomDiagID([&]() -> CustomDiagDesc {
306 switch (Level) {
308 return {diag::Severity::Ignored, std::string(Message), CLASS_WARNING,
309 /*ShowInSystemHeader*/ true, /*ShowInSystemMacro=*/true};
311 return {diag::Severity::Fatal, std::string(Message), CLASS_NOTE,
312 /*ShowInSystemHeader*/ true, /*ShowInSystemMacro=*/true};
314 return {diag::Severity::Remark, std::string(Message), CLASS_REMARK,
315 /*ShowInSystemHeader*/ true, /*ShowInSystemMacro=*/true};
317 return {diag::Severity::Warning, std::string(Message), CLASS_WARNING,
318 /*ShowInSystemHeader*/ true, /*ShowInSystemMacro=*/true};
320 return {diag::Severity::Error, std::string(Message), CLASS_ERROR,
321 /*ShowInSystemHeader*/ true, /*ShowInSystemMacro=*/true};
323 return {diag::Severity::Fatal, std::string(Message), CLASS_ERROR,
324 /*ShowInSystemHeader*/ true, /*ShowInSystemMacro=*/true};
325 }
326 llvm_unreachable("Fully covered switch above!");
327 }());
328 }
329
330 //===--------------------------------------------------------------------===//
331 // Diagnostic classification and reporting interfaces.
332 //
333
334 /// Given a diagnostic ID, return a description of the issue.
335 StringRef getDescription(unsigned DiagID) const;
336
337 /// Given a diagnostic ID, return the stable ID of the diagnostic.
338 std::string getStableID(unsigned DiagID) const;
339
340 /// Given a diagnostic ID, return the previous stable IDs of the diagnostic.
342
343 /// Return true if the unmapped diagnostic levelof the specified
344 /// diagnostic ID is a Warning or Extension.
345 ///
346 /// This is not legal to call on NOTEs.
347 bool isWarningOrExtension(unsigned DiagID) const;
348
349 /// Return true if the specified diagnostic is mapped to errors by
350 /// default.
351 bool isDefaultMappingAsError(unsigned DiagID) const;
352
353 /// Get the default mapping for this diagnostic.
354 DiagnosticMapping getDefaultMapping(unsigned DiagID) const;
355
356 void initCustomDiagMapping(DiagnosticMapping &, unsigned DiagID);
357
358 /// Determine whether the given diagnostic ID is a Note.
359 bool isNote(unsigned DiagID) const;
360
361 /// Determine whether the given diagnostic ID is for an
362 /// extension of some sort.
363 bool isExtensionDiag(unsigned DiagID) const {
364 bool ignored;
365 return isExtensionDiag(DiagID, ignored);
366 }
367
368 /// Determine whether the given diagnostic ID is for an
369 /// extension of some sort, and whether it is enabled by default.
370 ///
371 /// This also returns EnabledByDefault, which is set to indicate whether the
372 /// diagnostic is ignored by default (in which case -pedantic enables it) or
373 /// treated as a warning/error by default.
374 ///
375 bool isExtensionDiag(unsigned DiagID, bool &EnabledByDefault) const;
376
377 bool isTrapDiag(unsigned DiagID) const {
378 return getDiagClass(DiagID) == CLASS_TRAP;
379 }
380
381 /// Given a group ID, returns the flag that toggles the group.
382 /// For example, for Group::DeprecatedDeclarations, returns
383 /// "deprecated-declarations".
384 static StringRef getWarningOptionForGroup(diag::Group);
385
386 /// Given a diagnostic group ID, return its documentation.
387 static StringRef getWarningOptionDocumentation(diag::Group GroupID);
388
389 void setGroupSeverity(StringRef Group, diag::Severity);
390 void setGroupNoWarningsAsError(StringRef Group, bool);
391
392 /// Given a group ID, returns the flag that toggles the group.
393 /// For example, for "deprecated-declarations", returns
394 /// Group::DeprecatedDeclarations.
395 static std::optional<diag::Group> getGroupForWarningOption(StringRef);
396
397 /// Return the lowest-level group that contains the specified diagnostic.
398 std::optional<diag::Group> getGroupForDiag(unsigned DiagID) const;
399
400 /// Return the lowest-level warning option that enables the specified
401 /// diagnostic.
402 ///
403 /// If there is no -Wfoo flag that controls the diagnostic, this returns null.
404 StringRef getWarningOptionForDiag(unsigned DiagID);
405
406 /// Return the category number that a specified \p DiagID belongs to,
407 /// or 0 if no category.
408 static unsigned getCategoryNumberForDiag(unsigned DiagID);
409
410 /// Return the number of diagnostic categories.
411 static unsigned getNumberOfCategories();
412
413 /// Given a category ID, return the name of the category.
414 static StringRef getCategoryNameFromID(unsigned CategoryID);
415
416 /// Return true if a given diagnostic falls into an ARC diagnostic
417 /// category.
418 static bool isARCDiagnostic(unsigned DiagID);
419
420 /// Return true if a given diagnostic is a codegen-time ABI check.
421 static bool isCodegenABICheckDiagnostic(unsigned DiagID);
422
423 /// Enumeration describing how the emission of a diagnostic should
424 /// be treated when it occurs during C++ template argument deduction.
426 /// The diagnostic should not be reported, but it should cause
427 /// template argument deduction to fail.
428 ///
429 /// The vast majority of errors that occur during template argument
430 /// deduction fall into this category.
432
433 /// The diagnostic should be suppressed entirely.
434 ///
435 /// Warnings generally fall into this category.
437
438 /// The diagnostic should be reported.
439 ///
440 /// The diagnostic should be reported. Various fatal errors (e.g.,
441 /// template instantiation depth exceeded) fall into this category.
443
444 /// The diagnostic is an access-control diagnostic, which will be
445 /// substitution failures in some contexts and reported in others.
447 };
448
449 /// Determines whether the given built-in diagnostic ID is
450 /// for an error that is suppressed if it occurs during C++ template
451 /// argument deduction.
452 ///
453 /// When an error is suppressed due to SFINAE, the template argument
454 /// deduction fails but no diagnostic is emitted. Certain classes of
455 /// errors, such as those errors that involve C++ access control,
456 /// are not SFINAE errors.
457 static SFINAEResponse getDiagnosticSFINAEResponse(unsigned DiagID);
458
459 /// Whether the diagnostic message can be deferred.
460 ///
461 /// For single source offloading languages, a diagnostic message occurred
462 /// in a device host function may be deferred until the function is sure
463 /// to be emitted.
464 static bool isDeferrable(unsigned DiagID);
465
466 /// Get the string of all diagnostic flags.
467 ///
468 /// \returns A list of all diagnostics flags as they would be written in a
469 /// command line invocation including their `no-` variants. For example:
470 /// `{"-Wempty-body", "-Wno-empty-body", ...}`
471 static std::vector<std::string> getDiagnosticFlags();
472
473 /// Get the set of all diagnostic IDs in the group with the given name.
474 ///
475 /// \param[out] Diags - On return, the diagnostics in the group.
476 /// \returns \c true if the given group is unknown, \c false otherwise.
477 bool getDiagnosticsInGroup(diag::Flavor Flavor, StringRef Group,
478 SmallVectorImpl<diag::kind> &Diags) const;
479
480 /// Get the set of all diagnostic IDs.
481 static void getAllDiagnostics(diag::Flavor Flavor,
482 std::vector<diag::kind> &Diags);
483
484 /// Get the diagnostic option with the closest edit distance to the
485 /// given group name.
486 static StringRef getNearestOption(diag::Flavor Flavor, StringRef Group);
487
488 /// Get the appropriate diagnostic Id to use for issuing a compatibility
489 /// diagnostic. For use by the various DiagCompat() helpers.
490 static unsigned getCompatDiagId(const LangOptions &LangOpts,
491 unsigned CompatDiagId);
492
493 /// Return true if either of the following two conditions hold:
494 /// 1. \p Loc is in a system header and the diagnostic kind \p DiagID does
495 /// not have the property 'ShowInSystemHeader'.
496 /// 2. \p Loc is in the expansion of a macro defined in a system header and
497 /// the diagnostic kind \p DiagID does not have the property
498 /// 'ShowInSystemMacro'.
499 bool shouldSuppressAsSystemWarning(unsigned DiagID, SourceLocation Loc,
500 const DiagnosticsEngine &Diag) const;
501
502private:
503 /// Classify the specified diagnostic ID into a Level, consumable by
504 /// the DiagnosticClient.
505 ///
506 /// The classification is based on the way the client configured the
507 /// DiagnosticsEngine object.
508 ///
509 /// \param Loc The source location for which we are interested in finding out
510 /// the diagnostic state. Can be null in order to query the latest state.
512 getDiagnosticLevel(unsigned DiagID, SourceLocation Loc,
513 const DiagnosticsEngine &Diag) const LLVM_READONLY;
514
516 getDiagnosticSeverity(unsigned DiagID, SourceLocation Loc,
517 const DiagnosticsEngine &Diag) const LLVM_READONLY;
518
519 Class getDiagClass(unsigned DiagID) const;
520
521 /// Whether the diagnostic may leave the AST in a state where some
522 /// invariants can break.
523 bool isUnrecoverable(unsigned DiagID) const;
524
525 friend class DiagnosticsEngine;
526};
527
528} // end namespace clang
529
530#endif
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
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.
A little helper class used to produce diagnostics.
friend bool operator==(const CustomDiagDesc &lhs, const CustomDiagDesc &rhs)
friend bool operator<(const CustomDiagDesc &lhs, const CustomDiagDesc &rhs)
std::optional< diag::Group > GetGroup() const
diag::Severity GetDefaultSeverity() const
CustomDiagDesc(diag::Severity DefaultSeverity, std::string Description, unsigned Class=CLASS_WARNING, bool ShowInSystemHeader=false, bool ShowInSystemMacro=false, std::optional< diag::Group > Group=std::nullopt)
std::string_view GetDescription() const
void initCustomDiagMapping(DiagnosticMapping &, unsigned DiagID)
static StringRef getCategoryNameFromID(unsigned CategoryID)
Given a category ID, return the name of the category.
unsigned getCustomDiagID(Level Level, StringRef Message)
static unsigned getNumberOfCategories()
Return the number of diagnostic categories.
static StringRef getNearestOption(diag::Flavor Flavor, StringRef Group)
Get the diagnostic option with the closest edit distance to the given group name.
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.
static std::vector< std::string > getDiagnosticFlags()
Get the string of all diagnostic flags.
bool isWarningOrExtension(unsigned DiagID) const
Return true if the unmapped diagnostic levelof the specified diagnostic ID is a Warning or Extension.
void setGroupSeverity(StringRef Group, diag::Severity)
bool isExtensionDiag(unsigned DiagID) const
Determine whether the given diagnostic ID is for an extension of some sort.
DiagnosticMapping getDefaultMapping(unsigned DiagID) const
Get the default mapping for this diagnostic.
std::string getStableID(unsigned DiagID) const
Given a diagnostic ID, return the stable ID of the diagnostic.
static SFINAEResponse getDiagnosticSFINAEResponse(unsigned DiagID)
Determines whether the given built-in diagnostic ID is for an error that is suppressed if it occurs d...
bool shouldSuppressAsSystemWarning(unsigned DiagID, SourceLocation Loc, const DiagnosticsEngine &Diag) const
Return true if either of the following two conditions hold:
bool isDefaultMappingAsError(unsigned DiagID) const
Return true if the specified diagnostic is mapped to errors by default.
void setGroupNoWarningsAsError(StringRef Group, bool)
bool isTrapDiag(unsigned DiagID) const
static bool isCodegenABICheckDiagnostic(unsigned DiagID)
Return true if a given diagnostic is a codegen-time ABI check.
StringRef getDescription(unsigned DiagID) const
Given a diagnostic ID, return a description of the issue.
SFINAEResponse
Enumeration describing how the emission of a diagnostic should be treated when it occurs during C++ t...
@ SFINAE_SubstitutionFailure
The diagnostic should not be reported, but it should cause template argument deduction to fail.
@ SFINAE_Suppress
The diagnostic should be suppressed entirely.
@ SFINAE_AccessControl
The diagnostic is an access-control diagnostic, which will be substitution failures in some contexts ...
@ SFINAE_Report
The diagnostic should be reported.
bool isNote(unsigned DiagID) const
Determine whether the given diagnostic ID is a Note.
StringRef getWarningOptionForDiag(unsigned DiagID)
Return the lowest-level warning option that enables the specified diagnostic.
static StringRef getWarningOptionDocumentation(diag::Group GroupID)
Given a diagnostic group ID, return its documentation.
static std::optional< diag::Group > getGroupForWarningOption(StringRef)
Given a group ID, returns the flag that toggles the group.
friend class DiagnosticsEngine
static bool IsCustomDiag(diag::kind Diag)
static unsigned getCompatDiagId(const LangOptions &LangOpts, unsigned CompatDiagId)
Get the appropriate diagnostic Id to use for issuing a compatibility diagnostic.
unsigned getCustomDiagID(CustomDiagDesc Diag)
Return an ID for a diagnostic with the specified format string and level.
Level
The level of the diagnostic, after it has been through mapping.
static unsigned getCategoryNumberForDiag(unsigned DiagID)
Return the category number that a specified DiagID belongs to, or 0 if no category.
static StringRef getWarningOptionForGroup(diag::Group)
Given a group ID, returns the flag that toggles the group.
static bool isARCDiagnostic(unsigned DiagID)
Return true if a given diagnostic falls into an ARC diagnostic category.
static void getAllDiagnostics(diag::Flavor Flavor, std::vector< diag::kind > &Diags)
Get the set of all diagnostic IDs.
std::optional< diag::Group > getGroupForDiag(unsigned DiagID) const
Return the lowest-level group that contains the specified diagnostic.
static llvm::IntrusiveRefCntPtr< DiagnosticIDs > create()
static bool isDeferrable(unsigned DiagID)
Whether the diagnostic message can be deferred.
llvm::SmallVector< StringRef, 4 > getLegacyStableIDs(unsigned DiagID) const
Given a diagnostic ID, return the previous stable IDs of the diagnostic.
bool wasUpgradedFromWarning() const
Whether this mapping attempted to map the diagnostic to a warning, but was overruled because the diag...
unsigned serialize() const
Serialize this mapping as a raw integer.
bool operator==(DiagnosticMapping Other) const
void setNoWarningAsError(bool Value)
void setSeverity(diag::Severity Value)
static DiagnosticMapping deserialize(unsigned Bits)
Deserialize a mapping.
diag::Severity getSeverity() const
void setUpgradedFromWarning(bool Value)
static DiagnosticMapping Make(diag::Severity Severity, bool IsUser, bool IsPragma)
void setNoErrorAsFatal(bool Value)
bool hasNoWarningAsError() const
Concrete class used by the front-end to report problems and issues.
Definition Diagnostic.h:234
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Encodes a location in the source.
Flavor
Flavors of diagnostics we can emit.
@ WarningOrError
A diagnostic that indicates a problem or potential problem.
@ DIAG_SIZE_SERIALIZATION
@ DIAG_START_SERIALIZATION
unsigned kind
All of the diagnostics that can be emitted by the frontend.
Severity
Enum values that allow the client to map NOTEs, WARNINGs, and EXTENSIONs to either Ignore (nothing),...
@ Warning
Present this diagnostic as a warning.
@ Fatal
Present this diagnostic as a fatal error.
@ Error
Present this diagnostic as an error.
@ Remark
Present this diagnostic as a remark.
@ Ignored
Do not present this diagnostic, ignore it.
Top level wrappers for InstallAPI frontend operations.
@ Result
The result type of a method or function.
Definition TypeBase.h:906
@ Class
The "class" keyword introduces the elaborated-type-specifier.
Definition TypeBase.h:6031
@ Other
Other implicit parameter.
Definition Decl.h:1774
__packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 uint8_t