DiagnosticBuilder;
53classDiagnosticConsumer;
58classStoredDiagnostic;
193 static const unsignedNumCached = 16;
196 unsignedNumFreeListEntries;
204 if(NumFreeListEntries == 0)
209 Result->DiagRanges.clear();
210 Result->FixItHints.clear();
216 if(S >= Cached && S <= Cached + NumCached) {
217FreeList[NumFreeListEntries++] = S;
296 unsigned charAllExtensionsSilenced = 0;
299 boolFatalsAsError =
false;
302 boolSuppressAllDiagnostics =
false;
305 boolElideType =
true;
308 boolPrintTemplateTree =
false;
311 boolShowColors =
false;
321 unsignedNumOverloadsToShow = 32;
324 unsignedErrorLimit = 0;
327 unsignedTemplateBacktraceLimit = 0;
330 unsignedConstexprBacktraceLimit = 0;
335std::unique_ptr<DiagnosticConsumer> Owner;
350llvm::DenseMap<unsigned, DiagnosticMapping> DiagMap;
356LLVM_PREFERRED_TYPE(
bool)
357 unsignedIgnoreAllWarnings : 1;
360LLVM_PREFERRED_TYPE(
bool)
361 unsignedEnableAllWarnings : 1;
364LLVM_PREFERRED_TYPE(
bool)
365 unsignedWarningsAsErrors : 1;
368LLVM_PREFERRED_TYPE(
bool)
369 unsignedErrorsAsFatal : 1;
372LLVM_PREFERRED_TYPE(
bool)
373 unsignedSuppressSystemWarnings : 1;
381: IgnoreAllWarnings(
false), EnableAllWarnings(
false),
382WarningsAsErrors(
false), ErrorsAsFatal(
false),
383SuppressSystemWarnings(
false), DiagIDs(DiagIDs) {}
385 usingiterator = llvm::DenseMap<unsigned, DiagnosticMapping>::iterator;
386 usingconst_iterator =
387llvm::DenseMap<unsigned, DiagnosticMapping>::const_iterator;
390DiagMap[
Diag] = Info;
394 returnDiagMap.lookup(
Diag);
399const_iterator begin()
const{
returnDiagMap.begin(); }
400const_iterator end()
const{
returnDiagMap.end(); }
404std::list<DiagState> DiagStates;
411 voidappendFirst(DiagState *State);
420 boolempty()
const{
returnFiles.empty(); }
425FirstDiagState = CurDiagState =
nullptr;
426CurDiagStateLoc = SourceLocation();
430LLVM_DUMP_METHOD
void dump(SourceManager &SrcMgr,
431StringRef DiagName = StringRef())
const;
434DiagState *getCurDiagState()
const{
returnCurDiagState; }
437SourceLocation getCurDiagStateLoc()
const{
returnCurDiagStateLoc; }
440 friend classASTReader;
441 friend classASTWriter;
448 structDiagStatePoint {
452DiagStatePoint(DiagState *State,
unsignedOffset)
453: State(State), Offset(Offset) {}
465 unsignedParentOffset = 0;
469 boolHasLocalTransitions =
false;
475DiagState *lookup(
unsignedOffset)
const;
479 mutablestd::map<FileID, File> Files;
482DiagState *FirstDiagState;
485DiagState *CurDiagState;
488SourceLocation CurDiagStateLoc;
491 File*getFile(SourceManager &SrcMgr, FileID
ID)
const;
494DiagStateMap DiagStatesByLoc;
498std::vector<DiagState *> DiagStateOnPushStack;
500DiagState *GetCurDiagState()
const{
501 returnDiagStatesByLoc.getCurDiagState();
504 voidPushDiagStatePoint(DiagState *State, SourceLocation L);
508DiagState *GetDiagStateForLoc(SourceLocation
Loc)
const{
509 returnSourceMgr ? DiagStatesByLoc.lookup(*SourceMgr,
Loc)
510: DiagStatesByLoc.getCurDiagState();
518 boolUncompilableErrorOccurred;
521 boolFatalErrorOccurred;
524 boolUnrecoverableErrorOccurred;
528 unsignedTrapNumErrorsOccurred;
529 unsignedTrapNumUnrecoverableErrorsOccurred;
538 unsignedNumWarnings;
553 usingArgToStringFnTy = void (*)(
555StringRef Modifier, StringRef Argument,
556ArrayRef<ArgumentValue> PrevArgs,
557SmallVectorImpl<char> &Output,
559ArrayRef<intptr_t> QualTypeVals);
561 void*ArgToStringCookie =
nullptr;
562ArgToStringFnTy ArgToStringFn;
566 constSourceManager &)
const>
567DiagSuppressionMapping;
571IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts,
572DiagnosticConsumer *client =
nullptr,
573 boolShouldOwnClient =
true);
579LLVM_DUMP_METHOD
void dump()
const;
580LLVM_DUMP_METHOD
void dump(StringRef DiagName)
const;
593 constDiagState &DS = *GetCurDiagState();
605std::unique_ptr<DiagnosticConsumer>
takeClient() {
returnstd::move(Owner); }
610assert(SourceMgr &&
"SourceManager not set!");
615assert(DiagStatesByLoc.empty() &&
616 "Leftover diag state from a different SourceManager.");
651TemplateBacktraceLimit = Limit;
657 returnTemplateBacktraceLimit;
663ConstexprBacktraceLimit = Limit;
669 returnConstexprBacktraceLimit;
676GetCurDiagState()->IgnoreAllWarnings = Val;
679 returnGetCurDiagState()->IgnoreAllWarnings;
687GetCurDiagState()->EnableAllWarnings = Val;
690 returnGetCurDiagState()->EnableAllWarnings;
695GetCurDiagState()->WarningsAsErrors = Val;
698 returnGetCurDiagState()->WarningsAsErrors;
713GetCurDiagState()->SuppressSystemWarnings = Val;
716 returnGetCurDiagState()->SuppressSystemWarnings;
762 returnstd::numeric_limits<int>::max();
764 returnNumOverloadsToShow;
766llvm_unreachable(
"invalid OverloadsShown kind");
776NumOverloadsToShow = 4;
788FatalErrorOccurred =
true;
804GetCurDiagState()->ExtBehavior = H;
807 returnGetCurDiagState()->ExtBehavior;
873 returnUncompilableErrorOccurred;
879 returnFatalErrorOccurred || UnrecoverableErrorOccurred;
886this->NumWarnings = NumWarnings;
897 template<
unsignedN>
902StringRef(FormatString, N - 1));
908StringRef Modifier, StringRef Argument,
912ArgToStringFn(
Kind, Val, Modifier, Argument, PrevArgs, Output,
913ArgToStringCookie, QualTypeVals);
918ArgToStringCookie = Cookie;
924LastDiagLevel =
Other.LastDiagLevel;
929 void Reset(
boolsoft =
false);
944 returnDiags->getDiagnosticSeverity(DiagID,
Loc, *
this) ==
959 return(
Level)Diags->getDiagnosticLevel(DiagID,
Loc, *
this);
1019 boolisPragma = L.
isValid();
1037 returnDiags->ProcessDiag(*
this, DiagBuilder);
1071 unsignedNumUnrecoverableErrors;
1075: Diag(Diag) {
reset(); }
1080 returnDiag.TrapNumErrorsOccurred > NumErrors;
1086 returnDiag.TrapNumUnrecoverableErrorsOccurred > NumUnrecoverableErrors;
1091NumErrors = Diag.TrapNumErrorsOccurred;
1092NumUnrecoverableErrors = Diag.TrapNumUnrecoverableErrorsOccurred;
1152 "Too many arguments to diagnostic!");
1162 "Too many arguments to diagnostic!");
1192 operator bool()
const{
return true; }
1239 mutablestd::string FlagValue;
1246 mutable boolIsActive =
false;
1250 mutable boolIsForceEmit =
false;
1262IsForceEmit =
false;
1295assert(
isActive() &&
"Clients must not add to cleared diagnostic!");
1304 template<
typename T,
1305 typename= std::enable_if_t<!std::is_lvalue_reference<T>::value>>
1307assert(
isActive() &&
"Clients must not add to cleared diagnostic!");
1309DB << std::move(
V);
1320IsForceEmit =
true;
1376template<
typenameT>
1377inlinestd::enable_if_t<std::is_same<T, bool>::value,
1378 constStreamingDiagnostic &>
1397 unsigned long longI) {
1419template<
typenameT>
1420inlinestd::enable_if_t<
1421std::is_same<std::remove_const_t<T>, DeclContext>::value,
1422 constStreamingDiagnostic &>
1423operator<<(
constStreamingDiagnostic &DB,
T*DC) {
1469 conststd::optional<SourceRange> &Opt) {
1477 conststd::optional<CharSourceRange> &Opt) {
1520std::string FlagValue;
1522std::optional<StringRef> StoredDiagMessage;
1528StringRef StoredDiagMessage);
1531 unsigned getID()
const{
returnDiagID; }
1545assert(Idx <
getNumArgs() &&
"Argument index out of range!");
1553 "invalid argument accessor!");
1561 "invalid argument accessor!");
1562 return reinterpret_cast<const char*
>(DiagStorage.
DiagArgumentsVal[Idx]);
1569 "invalid argument accessor!");
1577 "invalid argument accessor!");
1585 "invalid argument accessor!");
1594 "invalid argument accessor!");
1603assert(Idx <
getNumRanges() &&
"Invalid diagnostic range index!");
1642std::string Message;
1643std::vector<CharSourceRange> Ranges;
1644std::vector<FixItHint> FixIts;
1657 explicit operator bool()
const{
return!Message.empty(); }
1684llvm::raw_ostream &
operator<<(llvm::raw_ostream &OS,
constStoredDiagnostic &);
1744 virtual voidanchor();
1764 void clear()
override;
1773LLVM_PREFERRED_TYPE(
bool)
1775LLVM_PREFERRED_TYPE(
bool)
1777LLVM_PREFERRED_TYPE(
bool)
1779LLVM_PREFERRED_TYPE(
bool)
1783LLVM_PREFERRED_TYPE(
bool)
1795 llvm::vfs::FileSystem &VFS,
boolReportDiags =
true);
enum clang::sema::@1704::IndirectLocalPathEntry::EntryKind Kind
Defines the Diagnostic IDs-related interfaces.
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.
llvm::MachO::Target Target
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
Reads an AST files chain containing the contents of a translation unit.
Writes an AST file containing the contents of a translation unit.
Represents a character-granular source range.
static CharSourceRange getCharRange(SourceRange R)
static CharSourceRange getTokenRange(SourceRange R)
An allocator for DiagnosticStorage objects, which uses a small cache to objects, used to reduce mallo...
void Deallocate(DiagnosticStorage *S)
Free the given storage object.
DiagnosticStorage * Allocate()
Allocate new storage.
A little helper class used to produce diagnostics.
DiagnosticBuilder & operator=(const DiagnosticBuilder &)=delete
const DiagnosticBuilder & setForceEmit() const
Forces the diagnostic to be emitted.
void Clear() const
Clear out the current diagnostic.
void addFlagValue(StringRef V) const
bool isActive() const
Determine whether this diagnostic is still active.
const DiagnosticBuilder & operator<<(const T &V) const
bool Emit()
Force the diagnostic builder to emit the diagnostic now.
~DiagnosticBuilder()
Emits the diagnostic.
const DiagnosticBuilder & operator<<(T &&V) const
Abstract interface, implemented by clients of the front-end, which formats and prints fully processed...
virtual ~DiagnosticConsumer()
virtual void EndSourceFile()
Callback to inform the diagnostic client that processing of a source file has ended.
virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info)
Handle this diagnostic, reporting it to the user or capturing it to a log as needed.
unsigned getNumErrors() const
virtual void finish()
Callback to inform the diagnostic client that processing of all source files has ended.
unsigned NumErrors
Number of errors reported.
unsigned getNumWarnings() const
unsigned NumWarnings
Number of warnings reported.
virtual bool IncludeInDiagnosticCounts() const
Indicates whether the diagnostics handled by this DiagnosticConsumer should be included in the number...
virtual void BeginSourceFile(const LangOptions &LangOpts, const Preprocessor *PP=nullptr)
Callback to inform the diagnostic client that processing of a source file is beginning.
DiagnosticConsumer()=default
RAII class that determines when any errors have occurred between the time the instance was created an...
void reset()
Set to initial state of "no errors occurred".
bool hasUnrecoverableErrorOccurred() const
Determine whether any unrecoverable errors have occurred since this object instance was created.
DiagnosticErrorTrap(DiagnosticsEngine &Diag)
bool hasErrorOccurred() const
Determine whether any errors have occurred since this object instance was created.
Used for handling and querying diagnostic IDs.
Level
The level of the diagnostic, after it has been through mapping.
void setNoWarningAsError(bool Value)
static DiagnosticMapping Make(diag::Severity Severity, bool IsUser, bool IsPragma)
void setNoErrorAsFatal(bool Value)
Options for controlling the compiler diagnostics engine.
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine a...
const SourceLocation & getLocation() const
const std::string & getArgStdStr(unsigned Idx) const
Return the provided argument string specified by Idx.
void FormatDiagnostic(SmallVectorImpl< char > &OutStr) const
Format this diagnostic into a string, substituting the formal arguments into the %0 slots.
uint64_t getRawArg(unsigned Idx) const
Return the specified non-string argument in an opaque form.
unsigned getNumFixItHints() const
StringRef getFlagValue() const
Return the value associated with this diagnostic flag.
unsigned getNumRanges() const
Return the number of source ranges associated with this diagnostic.
const char * getArgCStr(unsigned Idx) const
Return the specified C string argument.
const IdentifierInfo * getArgIdentifier(unsigned Idx) const
Return the specified IdentifierInfo argument.
const CharSourceRange & getRange(unsigned Idx) const
SourceManager & getSourceManager() const
ArrayRef< FixItHint > getFixItHints() const
unsigned getNumArgs() const
bool hasSourceManager() const
DiagnosticsEngine::ArgumentKind getArgKind(unsigned Idx) const
Return the kind of the specified index.
int64_t getArgSInt(unsigned Idx) const
Return the specified signed integer argument.
uint64_t getArgUInt(unsigned Idx) const
Return the specified unsigned integer argument.
const FixItHint & getFixItHint(unsigned Idx) const
ArrayRef< CharSourceRange > getRanges() const
Return an array reference for this diagnostic's ranges.
const DiagnosticsEngine * getDiags() const
Concrete class used by the front-end to report problems and issues.
void setErrorsAsFatal(bool Val)
When set to true, any error reported is made a fatal error.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
void SetArgToStringFn(ArgToStringFnTy Fn, void *Cookie)
bool hasSourceManager() const
bool EmitDiagnostic(const DiagnosticBuilder &DB, bool Force=false)
Emit the diagnostic.
unsigned getCustomDiagID(Level L, const char(&FormatString)[N])
Return an ID for a diagnostic with the specified format string and level.
void setDiagSuppressionMapping(llvm::MemoryBuffer &Input)
Diagnostic suppression mappings can be used to suppress specific diagnostics in specific files.
bool isLastDiagnosticIgnored() const
Determine whether the previous diagnostic was ignored.
bool hasErrorOccurred() const
void overloadCandidatesShown(unsigned N)
Call this after showing N overload candidates.
void setPrintTemplateTree(bool Val)
Set tree printing, to outputting the template difference in a tree format.
void setSuppressSystemWarnings(bool Val)
When set to true mask warnings that come from system headers.
void setNumWarnings(unsigned NumWarnings)
bool getErrorsAsFatal() const
DiagnosticsEngine(const DiagnosticsEngine &)=delete
bool isSuppressedViaMapping(diag::kind DiagId, SourceLocation DiagLoc) const
void setSeverityForAll(diag::Flavor Flavor, diag::Severity Map, SourceLocation Loc=SourceLocation())
Add the specified mapping to all diagnostics of the specified flavor.
void setIgnoreAllWarnings(bool Val)
When set to true, any unmapped warnings are ignored.
bool getSuppressAllDiagnostics() const
bool getIgnoreAllWarnings() const
void setSourceManager(SourceManager *SrcMgr)
void notePriorDiagnosticFrom(const DiagnosticsEngine &Other)
Note that the prior diagnostic was emitted by some other DiagnosticsEngine, and we may be attaching a...
friend void DiagnosticsTestHelper(DiagnosticsEngine &)
void setLastDiagnosticIgnored(bool Ignored)
Pretend that the last diagnostic issued was ignored, so any subsequent notes will be suppressed,...
void setExtensionHandlingBehavior(diag::Severity H)
Controls whether otherwise-unmapped extension diagnostics are mapped onto ignore/warning/error.
LLVM_DUMP_METHOD void dump() const
unsigned getNumOverloadCandidatesToShow() const
When a call or operator fails, print out up to this many candidate overloads as suggestions.
DiagnosticOptions & getDiagnosticOptions() const
Retrieve the diagnostic options.
void setTemplateBacktraceLimit(unsigned Limit)
Specify the maximum number of template instantiation notes to emit along with a given diagnostic.
void DecrementAllExtensionsSilenced()
bool hasUnrecoverableErrorOccurred() const
Determine whether any kind of unrecoverable error has occurred.
void setFatalsAsError(bool Val)
When set to true, any fatal error reported is made an error.
diag_mapping_range getDiagnosticMappings() const
Get the current set of diagnostic mappings.
void setErrorLimit(unsigned Limit)
Specify a limit for the number of errors we should emit before giving up.
void setWarningsAsErrors(bool Val)
When set to true, any warnings reported are issued as errors.
bool getEnableAllWarnings() const
bool getPrintTemplateTree()
void setClient(DiagnosticConsumer *client, bool ShouldOwnClient=true)
Set the diagnostic client associated with this diagnostic object.
void setShowOverloads(OverloadsShown Val)
Specify which overload candidates to show when overload resolution fails.
std::unique_ptr< DiagnosticConsumer > takeClient()
Return the current diagnostic client along with ownership of that client.
llvm::iterator_range< DiagState::const_iterator > diag_mapping_range
SourceManager & getSourceManager() const
void pushMappings(SourceLocation Loc)
Copies the current DiagMappings and pushes the new copy onto the top of the stack.
const DiagnosticConsumer * getClient() const
void setSeverity(diag::kind Diag, diag::Severity Map, SourceLocation Loc)
This allows the client to specify that certain warnings are ignored.
DiagnosticsEngine & operator=(const DiagnosticsEngine &)=delete
unsigned getConstexprBacktraceLimit() const
Retrieve the maximum number of constexpr evaluation notes to emit along with a given diagnostic.
Level
The level of the diagnostic, after it has been through mapping.
void setEnableAllWarnings(bool Val)
When set to true, any unmapped ignored warnings are no longer ignored.
friend class DiagnosticBuilder
DiagnosticConsumer * getClient()
bool hasFatalErrorOccurred() const
std::pair< ArgumentKind, intptr_t > ArgumentValue
Represents on argument value, which is a union discriminated by ArgumentKind, with a value.
@ ak_nameddecl
NamedDecl *.
@ ak_declcontext
DeclContext *.
@ ak_addrspace
address space
@ ak_identifierinfo
IdentifierInfo.
@ ak_qualtype_pair
pair<QualType, QualType>
@ ak_c_string
const char *
@ ak_declarationname
DeclarationName.
@ ak_tokenkind
enum TokenKind : unsigned
@ ak_std_string
std::string
@ ak_nestednamespec
NestedNameSpecifier *.
unsigned getNumErrors() const
bool isIgnored(unsigned DiagID, SourceLocation Loc) const
Determine whether the diagnostic is known to be ignored.
bool hasAllExtensionsSilenced()
Level getDiagnosticLevel(unsigned DiagID, SourceLocation Loc) const
Based on the way the client configured the DiagnosticsEngine object, classify the specified diagnosti...
bool ownsClient() const
Determine whether this DiagnosticsEngine object own its client.
DiagnosticsEngine(IntrusiveRefCntPtr< DiagnosticIDs > Diags, IntrusiveRefCntPtr< DiagnosticOptions > DiagOpts, DiagnosticConsumer *client=nullptr, bool ShouldOwnClient=true)
OverloadsShown getShowOverloads() const
void setConstexprBacktraceLimit(unsigned Limit)
Specify the maximum number of constexpr evaluation notes to emit along with a given diagnostic.
bool setDiagnosticGroupErrorAsFatal(StringRef Group, bool Enabled)
Set the error-as-fatal flag for the given diagnostic group.
bool getSuppressSystemWarnings() const
bool getFatalsAsError() const
void setShowColors(bool Val)
Set color printing, so the type diffing will inject color markers into the output.
bool setDiagnosticGroupWarningAsError(StringRef Group, bool Enabled)
Set the warning-as-error flag for the given diagnostic group.
bool getWarningsAsErrors() const
void IncrementAllExtensionsSilenced()
Counter bumped when an extension block is/ encountered.
void ConvertArgToString(ArgumentKind Kind, intptr_t Val, StringRef Modifier, StringRef Argument, ArrayRef< ArgumentValue > PrevArgs, SmallVectorImpl< char > &Output, ArrayRef< intptr_t > QualTypeVals) const
Converts a diagnostic argument (as an intptr_t) into the string that represents it.
diag::Severity getExtensionHandlingBehavior() const
void setSuppressAllDiagnostics(bool Val)
Suppress all diagnostics, to silence the front end when we know that we don't want any more diagnosti...
unsigned getTemplateBacktraceLimit() const
Retrieve the maximum number of template instantiation notes to emit along with a given diagnostic.
bool setSeverityForGroup(diag::Flavor Flavor, StringRef Group, diag::Severity Map, SourceLocation Loc=SourceLocation())
Change an entire diagnostic group (e.g.
bool hasUncompilableErrorOccurred() const
Errors that actually prevent compilation, not those that are upgraded from a warning by -Werror.
void setElideType(bool Val)
Set type eliding, to skip outputting same types occurring in template types.
bool popMappings(SourceLocation Loc)
Pops the current DiagMappings off the top of the stack, causing the new top of the stack to be the ac...
unsigned getNumWarnings() const
const IntrusiveRefCntPtr< DiagnosticIDs > & getDiagnosticIDs() const
void Reset(bool soft=false)
Reset the state of the diagnostic object to its initial configuration.
Annotates a diagnostic with some code that should be inserted, removed, or replaced to fix the proble...
static FixItHint CreateInsertionFromRange(SourceLocation InsertionLoc, CharSourceRange FromRange, bool BeforePreviousInsertions=false)
Create a code modification hint that inserts the given code from FromRange at a specific location.
static FixItHint CreateRemoval(SourceRange RemoveRange)
FixItHint()=default
Empty code modification hint, indicating that no code modification is known.
bool BeforePreviousInsertions
CharSourceRange RemoveRange
Code that should be replaced to correct the error.
static FixItHint CreateReplacement(CharSourceRange RemoveRange, StringRef Code)
Create a code modification hint that replaces the given source range with the given code string.
static FixItHint CreateRemoval(CharSourceRange RemoveRange)
Create a code modification hint that removes the given source range.
static FixItHint CreateReplacement(SourceRange RemoveRange, StringRef Code)
CharSourceRange InsertFromRange
Code in the specific range that should be inserted in the insertion location.
std::string CodeToInsert
The actual code to insert at the insertion location, as a string.
static FixItHint CreateInsertion(SourceLocation InsertionLoc, StringRef Code, bool BeforePreviousInsertions=false)
Create a code modification hint that inserts the given code string at a specific location.
Diagnostic consumer that forwards diagnostics along to an existing, already-initialized diagnostic co...
bool IncludeInDiagnosticCounts() const override
Indicates whether the diagnostics handled by this DiagnosticConsumer should be included in the number...
~ForwardingDiagnosticConsumer() override
void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override
Handle this diagnostic, reporting it to the user or capturing it to a log as needed.
ForwardingDiagnosticConsumer(DiagnosticConsumer &Target)
A SourceLocation and its associated SourceManager.
One of these records is kept for each identifier that is lexed.
A diagnostic client that ignores all diagnostics.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Sema - This implements semantic analysis and AST building for C.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
This class handles loading and caching of source files into memory.
A trivial tuple used to represent a source range.
Represents a diagnostic in a form that can be retained until its corresponding source manager is dest...
void setLocation(FullSourceLoc Loc)
unsigned range_size() const
ArrayRef< FixItHint > getFixIts() const
range_iterator range_begin() const
StoredDiagnostic()=default
ArrayRef< CharSourceRange > getRanges() const
unsigned fixit_size() const
DiagnosticsEngine::Level getLevel() const
fixit_iterator fixit_begin() const
const FullSourceLoc & getLocation() const
std::vector< FixItHint >::const_iterator fixit_iterator
range_iterator range_end() const
std::vector< CharSourceRange >::const_iterator range_iterator
StringRef getMessage() const
fixit_iterator fixit_end() const
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
StreamingDiagnostic(StreamingDiagnostic &&Diag)=default
DiagStorageAllocator * Allocator
Allocator used to allocate storage for this diagnostic.
StreamingDiagnostic()=default
StreamingDiagnostic(DiagStorageAllocator &Alloc)
Construct with a storage allocator which will manage the storage.
DiagnosticStorage * DiagStorage
void AddString(StringRef V) const
StreamingDiagnostic(const StreamingDiagnostic &Diag)=default
void AddTaggedVal(uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const
void AddSourceRange(const CharSourceRange &R) const
DiagnosticStorage * getStorage() const
Retrieve storage for this particular diagnostic.
void AddFixItHint(const FixItHint &Hint) const
Flavor
Flavors of diagnostics we can emit.
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),...
@ Ignored
Do not present this diagnostic, ignore it.
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
The JSON file list parser is used to communicate input to InstallAPI.
OverloadsShown
Specifies which overload candidates to display when overload resolution fails.
@ Ovl_All
Show all overloads.
@ Ovl_Best
Show just the "best" overload candidates.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
@ Result
The result type of a method or function.
void EscapeStringForDiagnostic(StringRef Str, SmallVectorImpl< char > &OutStr)
EscapeStringForDiagnostic - Append Str to the diagnostic buffer, escaping non-printable characters an...
std::pair< NullabilityKind, bool > DiagNullabilityKind
A nullability kind paired with a bit indicating whether it used a context-sensitive keyword.
void ProcessWarningOptions(DiagnosticsEngine &Diags, const DiagnosticOptions &Opts, llvm::vfs::FileSystem &VFS, bool ReportDiags=true)
ProcessWarningOptions - Initialize the diagnostic client and process the warning options specified on...
const char ToggleHighlight
Special character that the diagnostic printer will use to toggle the bold attribute.
const FunctionProtoType * T
@ Other
Other implicit parameter.
Diagnostic wrappers for TextAPI types for error reporting.
__INTPTR_TYPE__ intptr_t
A signed integer type with the property that any valid pointer to void can be converted to this type,...
AddFlagValue(StringRef V)
unsigned char DiagArgumentsKind[MaxArguments]
Specifies for each argument whether it is in DiagArgumentsStr or in DiagArguments.
SmallVector< CharSourceRange, 8 > DiagRanges
The list of ranges added to this diagnostic.
unsigned char NumDiagArgs
The number of entries in Arguments.
SmallVector< FixItHint, 6 > FixItHints
If valid, provides a hint with some code to insert, remove, or modify at a particular position.
std::string DiagArgumentsStr[MaxArguments]
The values for the various substitution positions that have string arguments.
@ MaxArguments
The maximum number of arguments we can hold.
uint64_t DiagArgumentsVal[MaxArguments]
The values for the various substitution positions.
DiagnosticStorage()=default
unsigned TemplateDiffUsed
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