15 #ifndef LLVM_CLANG_BASIC_DIAGNOSTIC_H 16 #define LLVM_CLANG_BASIC_DIAGNOSTIC_H 22 #include "llvm/ADT/ArrayRef.h" 23 #include "llvm/ADT/DenseMap.h" 24 #include "llvm/ADT/IntrusiveRefCntPtr.h" 25 #include "llvm/ADT/SmallVector.h" 26 #include "llvm/ADT/StringRef.h" 27 #include "llvm/ADT/iterator_range.h" 28 #include "llvm/Support/Compiler.h" 36 #include <type_traits> 43 class DiagnosticBuilder;
44 class DiagnosticConsumer;
49 class StoredDiagnostic;
80 bool BeforePreviousInsertions =
false;
94 bool BeforePreviousInsertions =
false) {
107 bool BeforePreviousInsertions =
false) {
208 unsigned char AllExtensionsSilenced = 0;
211 bool SuppressAfterFatalError =
true;
214 bool SuppressAllDiagnostics =
false;
217 bool ElideType =
true;
220 bool PrintTemplateTree =
false;
223 bool ShowColors =
false;
229 unsigned ErrorLimit = 0;
232 unsigned TemplateBacktraceLimit = 0;
235 unsigned ConstexprBacktraceLimit = 0;
240 std::unique_ptr<DiagnosticConsumer> Owner;
255 llvm::DenseMap<unsigned, DiagnosticMapping> DiagMap;
261 unsigned IgnoreAllWarnings : 1;
264 unsigned EnableAllWarnings : 1;
267 unsigned WarningsAsErrors : 1;
270 unsigned ErrorsAsFatal : 1;
273 unsigned SuppressSystemWarnings : 1;
279 : IgnoreAllWarnings(
false), EnableAllWarnings(
false),
280 WarningsAsErrors(
false), ErrorsAsFatal(
false),
281 SuppressSystemWarnings(
false) {}
283 using iterator = llvm::DenseMap<unsigned, DiagnosticMapping>::iterator;
284 using const_iterator =
285 llvm::DenseMap<unsigned, DiagnosticMapping>::const_iterator;
288 DiagMap[
Diag] = Info;
292 return DiagMap.lookup(Diag);
297 const_iterator begin()
const {
return DiagMap.begin(); }
298 const_iterator end()
const {
return DiagMap.end(); }
302 std::list<DiagState> DiagStates;
309 void appendFirst(DiagState *
State);
318 bool empty()
const {
return Files.empty(); }
323 FirstDiagState = CurDiagState =
nullptr;
329 StringRef DiagName = StringRef())
const;
332 DiagState *getCurDiagState()
const {
return CurDiagState; }
335 SourceLocation getCurDiagStateLoc()
const {
return CurDiagStateLoc; }
346 struct DiagStatePoint {
350 DiagStatePoint(DiagState *State,
unsigned Offset)
363 unsigned ParentOffset = 0;
367 bool HasLocalTransitions =
false;
373 DiagState *lookup(
unsigned Offset)
const;
377 mutable std::map<FileID, File> Files;
380 DiagState *FirstDiagState;
383 DiagState *CurDiagState;
392 DiagStateMap DiagStatesByLoc;
396 std::vector<DiagState *> DiagStateOnPushStack;
398 DiagState *GetCurDiagState()
const {
399 return DiagStatesByLoc.getCurDiagState();
407 return SourceMgr ? DiagStatesByLoc.lookup(*SourceMgr, Loc)
408 : DiagStatesByLoc.getCurDiagState();
416 bool UncompilableErrorOccurred;
419 bool FatalErrorOccurred;
422 bool UnrecoverableErrorOccurred;
426 unsigned TrapNumErrorsOccurred;
427 unsigned TrapNumUnrecoverableErrorsOccurred;
436 unsigned NumWarnings;
451 using ArgToStringFnTy = void (*)(
453 StringRef
Modifier, StringRef Argument,
459 void *ArgToStringCookie =
nullptr;
460 ArgToStringFnTy ArgToStringFn;
465 unsigned DelayedDiagID;
468 std::string DelayedDiagArg1;
471 std::string DelayedDiagArg2;
478 std::string FlagValue;
484 bool ShouldOwnClient =
true);
489 LLVM_DUMP_METHOD
void dump()
const { DiagStatesByLoc.dump(*SourceMgr); }
490 LLVM_DUMP_METHOD
void dump(StringRef DiagName)
const {
491 DiagStatesByLoc.dump(*SourceMgr, DiagName);
505 const DiagState &DS = *GetCurDiagState();
517 std::unique_ptr<DiagnosticConsumer>
takeClient() {
return std::move(Owner); }
522 assert(SourceMgr &&
"SourceManager not set!");
527 assert(DiagStatesByLoc.empty() &&
528 "Leftover diag state from a different SourceManager.");
563 TemplateBacktraceLimit = Limit;
569 return TemplateBacktraceLimit;
575 ConstexprBacktraceLimit = Limit;
581 return ConstexprBacktraceLimit;
588 GetCurDiagState()->IgnoreAllWarnings = Val;
591 return GetCurDiagState()->IgnoreAllWarnings;
599 GetCurDiagState()->EnableAllWarnings = Val;
602 return GetCurDiagState()->EnableAllWarnings;
607 GetCurDiagState()->WarningsAsErrors = Val;
610 return GetCurDiagState()->WarningsAsErrors;
623 GetCurDiagState()->SuppressSystemWarnings = Val;
626 return GetCurDiagState()->SuppressSystemWarnings;
633 SuppressAllDiagnostics = Val;
669 FatalErrorOccurred =
true;
685 GetCurDiagState()->ExtBehavior = H;
688 return GetCurDiagState()->ExtBehavior;
729 bool setDiagnosticGroupWarningAsError(StringRef Group,
bool Enabled);
736 bool setDiagnosticGroupErrorAsFatal(StringRef Group,
bool Enabled);
751 return UncompilableErrorOccurred;
757 return FatalErrorOccurred || UnrecoverableErrorOccurred;
763 this->NumWarnings = NumWarnings;
774 template <
unsigned N>
777 StringRef(FormatString, N - 1));
783 StringRef Modifier, StringRef Argument,
787 ArgToStringFn(Kind, Val, Modifier, Argument, PrevArgs, Output,
788 ArgToStringCookie, QualTypeVals);
793 ArgToStringCookie = Cookie;
799 LastDiagLevel = Other.LastDiagLevel;
819 return Diags->getDiagnosticSeverity(DiagID, Loc, *
this) ==
834 return (
Level)Diags->getDiagnosticLevel(DiagID, Loc, *
this);
876 void SetDelayedDiagnostic(
unsigned DiagID, StringRef Arg1 =
"",
877 StringRef Arg2 =
"");
899 void ReportDelayed();
920 signed char NumDiagArgs;
927 unsigned char DiagArgumentsKind[MaxArguments];
933 std::string DiagArgumentsStr[MaxArguments];
940 intptr_t DiagArgumentsVal[MaxArguments];
968 return Diags->ProcessDiag(*
this);
986 bool EmitCurrentDiagnostic(
bool Force =
false);
1001 unsigned NumUnrecoverableErrors;
1005 : Diag(Diag) { reset(); }
1010 return Diag.TrapNumErrorsOccurred > NumErrors;
1016 return Diag.TrapNumUnrecoverableErrorsOccurred > NumUnrecoverableErrors;
1021 NumErrors = Diag.TrapNumErrorsOccurred;
1022 NumUnrecoverableErrors = Diag.TrapNumUnrecoverableErrorsOccurred;
1047 mutable unsigned NumArgs = 0;
1054 mutable bool IsActive =
false;
1058 mutable bool IsForceEmit =
false;
1063 : DiagObj(diagObj), IsActive(
true) {
1064 assert(diagObj &&
"DiagnosticBuilder requires a valid DiagnosticsEngine!");
1065 diagObj->DiagRanges.clear();
1066 diagObj->DiagFixItHints.clear();
1071 DiagObj->NumDiagArgs = NumArgs;
1078 IsForceEmit =
false;
1094 if (!isActive())
return false;
1113 DiagObj = D.DiagObj;
1114 IsActive = D.IsActive;
1115 IsForceEmit = D.IsForceEmit;
1117 NumArgs = D.NumArgs;
1145 operator bool()
const {
return true; }
1148 assert(isActive() &&
"Clients must not add to cleared diagnostic!");
1149 assert(NumArgs < DiagnosticsEngine::MaxArguments &&
1150 "Too many arguments to diagnostic!");
1152 DiagObj->DiagArgumentsStr[NumArgs++] = S;
1156 assert(isActive() &&
"Clients must not add to cleared diagnostic!");
1157 assert(NumArgs < DiagnosticsEngine::MaxArguments &&
1158 "Too many arguments to diagnostic!");
1159 DiagObj->DiagArgumentsKind[NumArgs] =
Kind;
1160 DiagObj->DiagArgumentsVal[NumArgs++] = V;
1164 assert(isActive() &&
"Clients must not add to cleared diagnostic!");
1165 DiagObj->DiagRanges.push_back(R);
1169 assert(isActive() &&
"Clients must not add to cleared diagnostic!");
1171 DiagObj->DiagFixItHints.push_back(Hint);
1213 template <
typename T>
1215 typename std::enable_if<std::is_same<T, bool>::value,
1245 template <
typename T>
1246 inline typename std::enable_if<
1297 "Multiple diagnostics in flight at once!");
1317 StringRef StoredDiagMessage;
1322 : DiagObj(DO), StoredDiagMessage(storedDiagMessage) {}
1325 unsigned getID()
const {
return DiagObj->CurDiagID; }
1339 assert(Idx < getNumArgs() &&
"Argument index out of range!");
1347 "invalid argument accessor!");
1348 return DiagObj->DiagArgumentsStr[Idx];
1355 "invalid argument accessor!");
1356 return reinterpret_cast<const char*
>(DiagObj->DiagArgumentsVal[Idx]);
1363 "invalid argument accessor!");
1364 return (
int)DiagObj->DiagArgumentsVal[Idx];
1371 "invalid argument accessor!");
1372 return (
unsigned)DiagObj->DiagArgumentsVal[Idx];
1379 "invalid argument accessor!");
1380 return reinterpret_cast<IdentifierInfo*
>(DiagObj->DiagArgumentsVal[Idx]);
1387 "invalid argument accessor!");
1388 return DiagObj->DiagArgumentsVal[Idx];
1393 return DiagObj->DiagRanges.size();
1398 assert(Idx < getNumRanges() &&
"Invalid diagnostic range index!");
1399 return DiagObj->DiagRanges[Idx];
1404 return DiagObj->DiagRanges;
1408 return DiagObj->DiagFixItHints.size();
1412 assert(Idx < getNumFixItHints() &&
"Invalid index!");
1413 return DiagObj->DiagFixItHints[Idx];
1417 return DiagObj->DiagFixItHints;
1428 void FormatDiagnostic(
const char *DiagStr,
const char *DiagEnd,
1440 std::string Message;
1441 std::vector<CharSourceRange> Ranges;
1442 std::vector<FixItHint> FixIts;
1455 explicit operator bool()
const {
return !Message.empty(); }
1471 return llvm::makeArrayRef(Ranges);
1481 return llvm::makeArrayRef(FixIts);
1489 unsigned NumWarnings = 0;
1490 unsigned NumErrors = 0;
1498 virtual void clear() { NumWarnings = NumErrors = 0; }
1530 virtual bool IncludeInDiagnosticCounts()
const;
1543 virtual void anchor();
1563 void clear()
override;
1565 bool IncludeInDiagnosticCounts()
const override;
1589 bool ReportDiags =
true);
1593 #endif // LLVM_CLANG_BASIC_DIAGNOSTIC_H
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
unsigned getTemplateBacktraceLimit() const
Retrieve the maximum number of template instantiation notes to emit along with a given diagnostic...
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.
static FixItHint CreateRemoval(SourceRange RemoveRange)
bool hasErrorOccurred() const
DiagnosticConsumer * getClient()
unsigned fixit_size() const
fixit_iterator fixit_end() const
void setShowColors(bool Val=false)
Set color printing, so the type diffing will inject color markers into the output.
void AddFixItHint(const FixItHint &Hint) const
SourceManager & getSourceManager() const
bool getEnableAllWarnings() const
range_iterator range_begin() const
static CharSourceRange getTokenRange(SourceRange R)
void setShowOverloads(OverloadsShown Val)
Specify which overload candidates to show when overload resolution fails.
~DiagnosticBuilder()
Emits the diagnostic.
Represents a diagnostic in a form that can be retained until its corresponding source manager is dest...
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
std::string CodeToInsert
The actual code to insert at the insertion location, as a string.
const DiagnosticBuilder & setForceEmit() const
Forces the diagnostic to be emitted.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
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...
DiagnosticsEngine::ArgumentKind getArgKind(unsigned Idx) const
Return the kind of the specified index.
unsigned range_size() const
range_iterator range_end() const
bool getSuppressSystemWarnings() const
std::unique_ptr< DiagnosticConsumer > takeClient()
Return the current diagnostic client along with ownership of that client.
diag::Severity getExtensionHandlingBehavior() const
const std::string & getArgStdStr(unsigned Idx) const
Return the provided argument string specified by Idx.
virtual void EndSourceFile()
Callback to inform the diagnostic client that processing of a source file has ended.
Severity
Enum values that allow the client to map NOTEs, WARNINGs, and EXTENSIONs to either Ignore (nothing)...
Abstract interface, implemented by clients of the front-end, which formats and prints fully processed...
RAII class that determines when any errors have occurred between the time the instance was created an...
void setTemplateBacktraceLimit(unsigned Limit)
Specify the maximum number of template instantiation notes to emit along with a given diagnostic...
bool hasSourceManager() const
const DiagnosticsEngine * getDiags() const
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
One of these records is kept for each identifier that is lexed.
unsigned getCurrentDiagID() const
const DiagnosticConsumer * getClient() const
void IncrementAllExtensionsSilenced()
Counter bumped when an extension block is/ encountered.
unsigned getNumErrors() const
const FixItHint & getFixItHint(unsigned Idx) const
void setExtensionHandlingBehavior(diag::Severity H)
Controls whether otherwise-unmapped extension diagnostics are mapped onto ignore/warning/error.
ForwardingDiagnosticConsumer(DiagnosticConsumer &Target)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
static DiagnosticBuilder getEmpty()
Retrieve an empty diagnostic builder.
void setPrintTemplateTree(bool Val=false)
Set tree printing, to outputting the template difference in a tree format.
void setSuppressAfterFatalError(bool Val)
When set to true (the default), suppress further diagnostics after a fatal error. ...
void setSourceManager(SourceManager *SrcMgr)
unsigned getArgUInt(unsigned Idx) const
Return the specified unsigned integer argument.
bool isActive() const
Determine whether this diagnostic is still active.
StringRef getFlagValue() const
Return the value associated with this diagnostic flag.
const SourceLocation & getLocation() const
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
Concrete class used by the front-end to report problems and issues.
bool hasUnrecoverableErrorOccurred() const
Determine whether any kind of unrecoverable error has occurred.
bool hasAllExtensionsSilenced()
bool isDiagnosticInFlight() const
Determine whethere there is already a diagnostic in flight.
intptr_t getRawArg(unsigned Idx) const
Return the specified non-string argument in an opaque form.
ArrayRef< CharSourceRange > getRanges() const
DiagnosticBuilder(const DiagnosticBuilder &D)
Copy constructor.
SourceLocation getCurrentDiagLoc() const
__INTPTR_TYPE__ intptr_t
A signed integer type with the property that any valid pointer to void can be converted to this type...
StringRef getMessage() const
Diagnostic(const DiagnosticsEngine *DO, StringRef storedDiagMessage)
bool EmitCurrentDiagnostic(bool Force=false)
Emit the current diagnostic and clear the diagnostic state.
Sema - This implements semantic analysis and AST building for C.
A little helper class used to produce diagnostics.
Represents a character-granular source range.
DiagnosticsEngine::Level getLevel() const
DiagnosticErrorTrap(DiagnosticsEngine &Diag)
bool hasUncompilableErrorOccurred() const
Errors that actually prevent compilation, not those that are upgraded from a warning by -Werror...
unsigned getNumRanges() const
Return the number of source ranges associated with this diagnostic.
ArrayRef< FixItHint > getFixIts() const
void addFlagValue(StringRef V) const
const char * getArgCStr(unsigned Idx) const
Return the specified C string argument.
void setElideType(bool Val=true)
Set type eliding, to skip outputting same types occurring in template types.
unsigned TemplateDiffUsed
const IdentifierInfo * getArgIdentifier(unsigned Idx) const
Return the specified IdentifierInfo argument.
AddFlagValue(StringRef V)
void Clear()
Clear out the current diagnostic.
bool BeforePreviousInsertions
void setEnableAllWarnings(bool Val)
When set to true, any unmapped ignored warnings are no longer ignored.
fixit_iterator fixit_begin() const
OverloadsShown getShowOverloads() const
CharSourceRange InsertFromRange
Code in the specific range that should be inserted in the insertion location.
unsigned getNumWarnings() const
static CharSourceRange getCharRange(SourceRange R)
CharSourceRange RemoveRange
Code that should be replaced to correct the error.
void AddSourceRange(const CharSourceRange &R) const
void Clear() const
Clear out the current diagnostic.
const CharSourceRange & getRange(unsigned Idx) const
void setSuppressSystemWarnings(bool Val)
When set to true mask warnings that come from system headers.
Encodes a location in the source.
bool hasErrorOccurred() const
Determine whether any errors have occurred since this object instance was created.
bool isLastDiagnosticIgnored() const
Determine whether the previous diagnostic was ignored.
std::pair< NullabilityKind, bool > DiagNullabilityKind
A nullability kind paired with a bit indicating whether it used a context-sensitive keyword...
unsigned getNumWarnings() const
Options for controlling the compiler diagnostics engine.
diag_mapping_range getDiagnosticMappings() const
Get the current set of diagnostic mappings.
virtual void finish()
Callback to inform the diagnostic client that processing of all source files has ended.
bool getPrintTemplateTree()
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.
const char ToggleHighlight
Special character that the diagnostic printer will use to toggle the bold attribute.
Diagnostic consumer that forwards diagnostics along to an existing, already-initialized diagnostic co...
void ProcessWarningOptions(DiagnosticsEngine &Diags, const DiagnosticOptions &Opts, bool ReportDiags=true)
ProcessWarningOptions - Initialize the diagnostic client and process the warning options specified on...
void reset()
Set to initial state of "no errors occurred".
void AddString(StringRef S) const
OpenMPLinearClauseKind Modifier
Modifier of 'linear' clause.
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
void SetArgToStringFn(ArgToStringFnTy Fn, void *Cookie)
std::pair< ArgumentKind, intptr_t > ArgumentValue
Represents on argument value, which is a union discriminated by ArgumentKind, with a value...
void setNoErrorAsFatal(bool Value)
Flavor
Flavors of diagnostics we can emit.
SourceManager & getSourceManager() const
unsigned getCustomDiagID(Level L, const char(&FormatString)[N])
Return an ID for a diagnostic with the specified format string and level.
LLVM_DUMP_METHOD void dump(StringRef DiagName) const
void setNumWarnings(unsigned NumWarnings)
static DiagnosticMapping Make(diag::Severity Severity, bool IsUser, bool IsPragma)
void setLastDiagnosticIgnored(bool Ignored=true)
Pretend that the last diagnostic issued was ignored, so any subsequent notes will be suppressed...
bool getIgnoreAllWarnings() const
Defines various enumerations that describe declaration and type specifiers.
void setErrorLimit(unsigned Limit)
Specify a limit for the number of errors we should emit before giving up.
void setIgnoreAllWarnings(bool Val)
When set to true, any unmapped warnings are ignored.
std::vector< FixItHint >::const_iterator fixit_iterator
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Dataflow Directional Tag Classes.
A diagnostic client that ignores all diagnostics.
Level getDiagnosticLevel(unsigned DiagID, SourceLocation Loc) const
Based on the way the client configured the DiagnosticsEngine object, classify the specified diagnosti...
bool isValid() const
Return true if this is a valid SourceLocation object.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Reads an AST files chain containing the contents of a translation unit.
const FullSourceLoc & getLocation() const
static FixItHint CreateRemoval(CharSourceRange RemoveRange)
Create a code modification hint that removes the given source range.
Level
The level of the diagnostic, after it has been through mapping.
Used for handling and querying diagnostic IDs.
bool hasUnrecoverableErrorOccurred() const
Determine whether any unrecoverable errors have occurred since this object instance was created...
DiagnosticOptions & getDiagnosticOptions() const
Retrieve the diagnostic options.
void setErrorsAsFatal(bool Val)
When set to true, any error reported is made a fatal error.
void setWarningsAsErrors(bool Val)
When set to true, any warnings reported are issued as errors.
unsigned getNumFixItHints() const
void setConstexprBacktraceLimit(unsigned Limit)
Specify the maximum number of constexpr evaluation notes to emit along with a given diagnostic...
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(const DiagnosticsEngine *DO)
unsigned getConstexprBacktraceLimit() const
Retrieve the maximum number of constexpr evaluation notes to emit along with a given diagnostic...
bool hasFatalErrorOccurred() const
llvm::iterator_range< DiagState::const_iterator > diag_mapping_range
void DecrementAllExtensionsSilenced()
int getArgSInt(unsigned Idx) const
Return the specified signed integer argument.
const IntrusiveRefCntPtr< DiagnosticIDs > & getDiagnosticIDs() const
void setSuppressAllDiagnostics(bool Val=true)
Suppress all diagnostics, to silence the front end when we know that we don't want any more diagnosti...
static FixItHint CreateReplacement(SourceRange RemoveRange, StringRef Code)
Defines the clang::SourceLocation class and associated facilities.
ArrayRef< CharSourceRange > getRanges() const
Return an array reference for this diagnostic's ranges.
ArrayRef< FixItHint > getFixItHints() const
OverloadsShown
Specifies which overload candidates to display when overload resolution fails.
Level
The level of the diagnostic, after it has been through mapping.
Do not present this diagnostic, ignore it.
bool hasSourceManager() const
unsigned kind
All of the diagnostics that can be emitted by the frontend.
static FixItHint CreateReplacement(CharSourceRange RemoveRange, StringRef Code)
Create a code modification hint that replaces the given source range with the given code string...
Writes an AST file containing the contents of a translation unit.
unsigned getNumArgs() const
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) ...
A SourceLocation and its associated SourceManager.
Defines the Diagnostic IDs-related interfaces.
__DEVICE__ int max(int __a, int __b)
bool getErrorsAsFatal() const
bool isIgnored(unsigned DiagID, SourceLocation Loc) const
Determine whether the diagnostic is known to be ignored.
Annotates a diagnostic with some code that should be inserted, removed, or replaced to fix the proble...
void setNoWarningAsError(bool Value)
bool getWarningsAsErrors() const
bool Emit()
Force the diagnostic builder to emit the diagnostic now.
A trivial tuple used to represent a source range.
void setLocation(FullSourceLoc Loc)
virtual void BeginSourceFile(const LangOptions &LangOpts, const Preprocessor *PP=nullptr)
Callback to inform the diagnostic client that processing of a source file is beginning.
std::vector< CharSourceRange >::const_iterator range_iterator
This class handles loading and caching of source files into memory.
bool getSuppressAllDiagnostics() const
LLVM_DUMP_METHOD void dump() const
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
bool ownsClient() const
Determine whether this DiagnosticsEngine object own its client.
enum TokenKind : unsigned
void notePriorDiagnosticFrom(const DiagnosticsEngine &Other)
Note that the prior diagnostic was emitted by some other DiagnosticsEngine, and we may be attaching a...