DiagnosticsEngine;
27 classDiagnosticBuilder;
75#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, CATEGORY, \ 76 NOWERROR, SHOWINSYSHEADER, SHOWINSYSMACRO, DEFFERABLE) \ 79#include "clang/Basic/DiagnosticCommonKinds.inc" 109 unsignedSeverity : 3;
110LLVM_PREFERRED_TYPE(
bool)
112LLVM_PREFERRED_TYPE(
bool)
113 unsignedIsPragma : 1;
114LLVM_PREFERRED_TYPE(
bool)
115 unsignedHasNoWarningAsError : 1;
116LLVM_PREFERRED_TYPE(
bool)
117 unsignedHasNoErrorAsFatal : 1;
118LLVM_PREFERRED_TYPE(
bool)
119 unsignedWasUpgradedFromWarning : 1;
127 Result.IsPragma = IsPragma;
128 Result.HasNoWarningAsError = 0;
129 Result.HasNoErrorAsFatal = 0;
130 Result.WasUpgradedFromWarning = 0;
159 return(IsUser << 7) | (IsPragma << 6) | (HasNoWarningAsError << 5) |
160(HasNoErrorAsFatal << 4) | (WasUpgradedFromWarning << 3) | Severity;
165 Result.IsUser = (Bits >> 7) & 1;
166 Result.IsPragma = (Bits >> 6) & 1;
167 Result.HasNoWarningAsError = (Bits >> 5) & 1;
168 Result.HasNoErrorAsFatal = (Bits >> 4) & 1;
169 Result.WasUpgradedFromWarning = (Bits >> 3) & 1;
170 Result.Severity = Bits & 0x7;
203 unsignedDefaultSeverity : 3;
204LLVM_PREFERRED_TYPE(
Class)
205 unsignedDiagClass : 3;
206LLVM_PREFERRED_TYPE(
bool)
207 unsignedShowInSystemHeader : 1;
208LLVM_PREFERRED_TYPE(
bool)
209 unsignedShowInSystemMacro : 1;
210LLVM_PREFERRED_TYPE(
bool)
211 unsignedHasGroup : 1;
213std::string Description;
215 autoget_as_tuple()
const{
216 returnstd::tuple(DefaultSeverity, DiagClass, ShowInSystemHeader,
217ShowInSystemMacro, HasGroup, Group,
218std::string_view{Description});
224 boolShowInSystemHeader =
false,
225 boolShowInSystemMacro =
false,
226std::optional<diag::Group> Group = std::nullopt)
227: DefaultSeverity(static_cast<
unsigned>(DefaultSeverity)),
228DiagClass(
Class), ShowInSystemHeader(ShowInSystemHeader),
229ShowInSystemMacro(ShowInSystemMacro), HasGroup(Group !=
std::nullopt),
230Group(Group.value_or(diag::Group{})),
231Description(
std::move(Description)) {}
249 returnlhs.get_as_tuple() == rhs.get_as_tuple();
254 returnlhs.get_as_tuple() < rhs.get_as_tuple();
261LLVM_PREFERRED_TYPE(
bool)
267 std::unique_ptr<diag::CustomDiagInfo> CustomDiagInfo;
269 autoGIs = std::make_unique<GroupInfo[]>(
272GIs[i] = {{},
false};
315llvm_unreachable(
"Fully covered switch above!");
342 bool isNote(
unsignedDiagID)
const;
358 bool isExtensionDiag(
unsignedDiagID,
bool&EnabledByDefault)
const;
461std::vector<diag::kind> &Diags);
484 ClassgetDiagClass(
unsignedDiagID)
const;
496 LevelDiagLevel)
const;
500 boolisUnrecoverable(
unsignedDiagID)
const;
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)
bool ShouldShowInSystemHeader() const
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
Used for handling and querying diagnostic IDs.
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.
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 isDefaultMappingAsError(unsigned DiagID) const
Return true if the specified diagnostic is mapped to errors by default.
void setGroupNoWarningsAsError(StringRef Group, bool)
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.
static bool IsCustomDiag(diag::kind Diag)
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 bool isDeferrable(unsigned DiagID)
Whether the diagnostic message can be deferred.
bool hasNoErrorAsFatal() const
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
bool isErrorOrFatal() 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.
Encodes a location in the source.
@ DIAG_SIZE_SERIALIZATION
@ DIAG_START_SERIALIZATION
Flavor
Flavors of diagnostics we can emit.
@ WarningOrError
A diagnostic that indicates a problem or potential problem.
@ NUM_BUILTIN_COMMON_DIAGNOSTICS
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.
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.
@ Other
Other implicit parameter.
unsigned HasNoWarningAsError
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4