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/iterator_range.h"
31 class DiagnosticBuilder;
32 class DiagnosticConsumer;
33 class DiagnosticErrorTrap;
34 class DiagnosticOptions;
38 class StoredDiagnostic;
171 unsigned char AllExtensionsSilenced;
172 bool IgnoreAllWarnings;
173 bool WarningsAsErrors;
174 bool EnableAllWarnings;
177 bool SuppressSystemWarnings;
178 bool SuppressAllDiagnostics;
180 bool PrintTemplateTree;
184 unsigned TemplateBacktraceLimit;
186 unsigned ConstexprBacktraceLimit;
192 std::unique_ptr<DiagnosticConsumer> Owner;
207 llvm::DenseMap<unsigned, DiagnosticMapping> DiagMap;
211 typedef llvm::DenseMap<unsigned, DiagnosticMapping>::const_iterator
215 DiagMap[
Diag] = Info;
220 const_iterator
begin()
const {
return DiagMap.begin(); }
221 const_iterator
end()
const {
return DiagMap.end(); }
225 std::list<DiagState> DiagStates;
232 struct DiagStatePoint {
236 : State(State), Loc(Loc) { }
238 bool operator<(
const DiagStatePoint &RHS)
const {
241 if (RHS.Loc.isInvalid())
245 return Loc.isBeforeInTranslationUnitThan(RHS.Loc);
254 typedef std::vector<DiagStatePoint> DiagStatePointsTy;
255 mutable DiagStatePointsTy DiagStatePoints;
259 std::vector<DiagState *> DiagStateOnPushStack;
261 DiagState *GetCurDiagState()
const {
262 assert(!DiagStatePoints.empty());
263 return DiagStatePoints.back().State;
266 void PushDiagStatePoint(DiagState *
State, SourceLocation L) {
269 assert(Loc.isValid() &&
"Adding invalid loc point");
270 assert(!DiagStatePoints.empty() &&
271 (DiagStatePoints.back().Loc.isInvalid() ||
272 DiagStatePoints.back().Loc.isBeforeInTranslationUnitThan(Loc)) &&
273 "Previous point loc comes after or is the same as new one");
274 DiagStatePoints.push_back(DiagStatePoint(State, Loc));
286 bool UncompilableErrorOccurred;
289 bool FatalErrorOccurred;
292 bool UnrecoverableErrorOccurred;
296 unsigned TrapNumErrorsOccurred;
297 unsigned TrapNumUnrecoverableErrorsOccurred;
305 unsigned NumWarnings;
318 typedef void (*ArgToStringFnTy)(
320 StringRef
Modifier, StringRef Argument,
321 ArrayRef<ArgumentValue> PrevArgs,
322 SmallVectorImpl<char> &Output,
324 ArrayRef<intptr_t> QualTypeVals);
325 void *ArgToStringCookie;
326 ArgToStringFnTy ArgToStringFn;
331 unsigned DelayedDiagID;
334 std::string DelayedDiagArg1;
337 std::string DelayedDiagArg2;
344 std::string FlagValue;
347 explicit DiagnosticsEngine(
348 const IntrusiveRefCntPtr<DiagnosticIDs> &Diags,
349 DiagnosticOptions *DiagOpts,
350 DiagnosticConsumer *client =
nullptr,
351 bool ShouldOwnClient =
true);
365 const DiagState &DS = *GetCurDiagState();
377 std::unique_ptr<DiagnosticConsumer>
takeClient() {
return std::move(Owner); }
381 assert(SourceMgr &&
"SourceManager not set!");
417 TemplateBacktraceLimit = Limit;
423 return TemplateBacktraceLimit;
429 ConstexprBacktraceLimit = Limit;
435 return ConstexprBacktraceLimit;
473 SuppressAllDiagnostics = Val;
507 FatalErrorOccurred =
true;
585 return UncompilableErrorOccurred;
591 return FatalErrorOccurred || UnrecoverableErrorOccurred;
597 this->NumWarnings = NumWarnings;
608 template <
unsigned N>
611 StringRef(FormatString, N - 1));
617 StringRef
Modifier, StringRef Argument,
621 ArgToStringFn(Kind, Val, Modifier, Argument, PrevArgs, Output,
622 ArgToStringCookie, QualTypeVals);
627 ArgToStringCookie = Cookie;
633 LastDiagLevel = Other.LastDiagLevel;
653 return Diags->getDiagnosticSeverity(DiagID, Loc, *
this) ==
668 return (
Level)Diags->getDiagnosticLevel(DiagID, Loc, *
this);
709 StringRef Arg2 =
"");
719 void ReportDelayed();
751 signed char NumDiagArgs;
758 unsigned char DiagArgumentsKind[MaxArguments];
764 std::string DiagArgumentsStr[MaxArguments];
771 intptr_t DiagArgumentsVal[MaxArguments];
799 return Diags->ProcessDiag(*
this);
832 unsigned NumUnrecoverableErrors;
836 : Diag(Diag) {
reset(); }
841 return Diag.TrapNumErrorsOccurred > NumErrors;
847 return Diag.TrapNumUnrecoverableErrorsOccurred > NumUnrecoverableErrors;
852 NumErrors = Diag.TrapNumErrorsOccurred;
853 NumUnrecoverableErrors = Diag.TrapNumUnrecoverableErrorsOccurred;
875 mutable unsigned NumArgs = 0;
882 mutable bool IsActive =
false;
886 mutable bool IsForceEmit =
false;
894 : DiagObj(diagObj), IsActive(
true) {
895 assert(diagObj &&
"DiagnosticBuilder requires a valid DiagnosticsEngine!");
896 diagObj->DiagRanges.clear();
897 diagObj->DiagFixItHints.clear();
904 DiagObj->NumDiagArgs =
NumArgs;
947 IsActive = D.IsActive;
948 IsForceEmit = D.IsForceEmit;
976 operator bool()
const {
return true; }
979 assert(
isActive() &&
"Clients must not add to cleared diagnostic!");
980 assert(
NumArgs < DiagnosticsEngine::MaxArguments &&
981 "Too many arguments to diagnostic!");
983 DiagObj->DiagArgumentsStr[
NumArgs++] =
S;
987 assert(
isActive() &&
"Clients must not add to cleared diagnostic!");
988 assert(
NumArgs < DiagnosticsEngine::MaxArguments &&
989 "Too many arguments to diagnostic!");
991 DiagObj->DiagArgumentsVal[
NumArgs++] = V;
995 assert(
isActive() &&
"Clients must not add to cleared diagnostic!");
996 DiagObj->DiagRanges.push_back(R);
1000 assert(
isActive() &&
"Clients must not add to cleared diagnostic!");
1002 DiagObj->DiagFixItHints.push_back(Hint);
1043 template <
typename T>
1045 typename std::enable_if<std::is_same<T, bool>::value,
1046 const DiagnosticBuilder &>
::type
1075 template <
typename T>
1076 inline typename std::enable_if<
1078 const DiagnosticBuilder &>
::type
1126 assert(CurDiagID == ~0U &&
"Multiple diagnostics in flight at once!");
1146 StringRef StoredDiagMessage;
1150 : DiagObj(DO), StoredDiagMessage(storedDiagMessage) {}
1153 unsigned getID()
const {
return DiagObj->CurDiagID; }
1167 assert(Idx <
getNumArgs() &&
"Argument index out of range!");
1175 "invalid argument accessor!");
1176 return DiagObj->DiagArgumentsStr[Idx];
1183 "invalid argument accessor!");
1184 return reinterpret_cast<const char*
>(DiagObj->DiagArgumentsVal[Idx]);
1191 "invalid argument accessor!");
1192 return (
int)DiagObj->DiagArgumentsVal[Idx];
1199 "invalid argument accessor!");
1200 return (
unsigned)DiagObj->DiagArgumentsVal[Idx];
1207 "invalid argument accessor!");
1208 return reinterpret_cast<IdentifierInfo*
>(DiagObj->DiagArgumentsVal[Idx]);
1215 "invalid argument accessor!");
1216 return DiagObj->DiagArgumentsVal[Idx];
1221 return DiagObj->DiagRanges.size();
1226 assert(Idx <
getNumRanges() &&
"Invalid diagnostic range index!");
1227 return DiagObj->DiagRanges[Idx];
1232 return DiagObj->DiagRanges;
1236 return DiagObj->DiagFixItHints.size();
1241 return DiagObj->DiagFixItHints[Idx];
1245 return DiagObj->DiagFixItHints;
1268 std::string Message;
1269 std::vector<CharSourceRange> Ranges;
1270 std::vector<FixItHint> FixIts;
1283 explicit operator bool()
const {
return Message.size() > 0; }
1298 return llvm::makeArrayRef(Ranges);
1308 return llvm::makeArrayRef(FixIts);
1371 virtual void anchor();
1391 void clear()
override;
1417 bool ReportDiags =
true);
void setSeverityForAll(diag::Flavor Flavor, diag::Severity Map, SourceLocation Loc=SourceLocation())
Add the specified mapping to all diagnostics of the specified flavor.
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.
unsigned getNumWarnings() const
std::vector< CharSourceRange >::const_iterator range_iterator
static FixItHint CreateRemoval(SourceRange RemoveRange)
DiagnosticConsumer * getClient()
bool isActive() const
Determine whether this diagnostic is still active.
void setShowColors(bool Val=false)
Set color printing, so the type diffing will inject color markers into the output.
void pushMappings(SourceLocation Loc)
Copies the current DiagMappings and pushes the new copy onto the top of the stack.
unsigned getNumArgs() const
unsigned getTemplateBacktraceLimit() const
Retrieve the maximum number of template instantiation notes to emit along with a given diagnostic...
StringRef getFlagValue() const
Return the value associated with this diagnostic flag.
bool getIgnoreAllWarnings() const
unsigned NumErrors
Number of errors reported.
static CharSourceRange getTokenRange(SourceRange R)
void setShowOverloads(OverloadsShown Val)
Specify which overload candidates to show when overload resolution fails.
StringRef getMessage() const
const std::string & getArgStdStr(unsigned Idx) const
Return the provided argument string specified by Idx.
~DiagnosticBuilder()
Emits the diagnostic.
Represents a diagnostic in a form that can be retained until its corresponding source manager is dest...
bool hasErrorOccurred() const
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
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.
const FullSourceLoc & getLocation() const
std::string CodeToInsert
The actual code to insert at the insertion location, as a string.
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...
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.
bool setDiagnosticGroupWarningAsError(StringRef Group, bool Enabled)
Set the warning-as-error flag for the given diagnostic group.
std::unique_ptr< DiagnosticConsumer > takeClient()
Return the current diagnostic client along with ownership of that client.
bool hasErrorOccurred() const
Determine whether any errors have occurred since this object instance was created.
bool getWarningsAsErrors() const
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 SetDelayedDiagnostic(unsigned DiagID, StringRef Arg1="", StringRef Arg2="")
Set the "delayed" diagnostic that will be emitted once the current diagnostic completes.
void setTemplateBacktraceLimit(unsigned Limit)
Specify the maximum number of template instantiation notes to emit along with a given diagnostic...
void Clear() const
Clear out the current diagnostic.
fixit_iterator fixit_end() const
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
One of these records is kept for each identifier that is lexed.
unsigned getNumWarnings() const
void setClient(DiagnosticConsumer *client, bool ShouldOwnClient=true)
Set the diagnostic client associated with this diagnostic object.
void IncrementAllExtensionsSilenced()
Counter bumped when an extension block is/ encountered.
const DiagnosticsEngine * getDiags() const
bool isDiagnosticInFlight() const
Determine whethere there is already a diagnostic in flight.
bool setDiagnosticGroupErrorAsFatal(StringRef Group, bool Enabled)
Set the error-as-fatal flag for the given diagnostic group.
int getArgSInt(unsigned Idx) const
Return the specified signed integer argument.
void setExtensionHandlingBehavior(diag::Severity H)
Controls whether otherwise-unmapped extension diagnostics are mapped onto ignore/warning/error.
ForwardingDiagnosticConsumer(DiagnosticConsumer &Target)
void addFlagValue(StringRef V) const
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
SourceManager & getSourceManager() const
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.
std::pair< NullabilityKind, bool > DiagNullabilityKind
A nullability kind paired with a bit indicating whether it used a context-sensitive keyword...
void setSourceManager(SourceManager *SrcMgr)
bool hasUnrecoverableErrorOccurred() const
Determine whether any kind of unrecoverable error has occurred.
bool hasUnrecoverableErrorOccurred() const
Determine whether any unrecoverable errors have occurred since this object instance was created...
bool isLastDiagnosticIgnored() const
Determine whether the previous diagnostic was ignored.
const SourceLocation & getLocation() const
unsigned getNumRanges() const
Return the number of source ranges associated with this diagnostic.
virtual bool IncludeInDiagnosticCounts() const
Indicates whether the diagnostics handled by this DiagnosticConsumer should be included in the number...
Concrete class used by the front-end to report problems and issues.
bool hasAllExtensionsSilenced()
bool setSeverityForGroup(diag::Flavor Flavor, StringRef Group, diag::Severity Map, SourceLocation Loc=SourceLocation())
Change an entire diagnostic group (e.g.
llvm::iterator_range< DiagState::const_iterator > diag_mapping_range
fixit_iterator fixit_begin() const
DiagnosticBuilder(const DiagnosticBuilder &D)
Copy constructor.
const char * getArgCStr(unsigned Idx) const
Return the specified C string argument.
const IntrusiveRefCntPtr< DiagnosticIDs > & getDiagnosticIDs() const
__INTPTR_TYPE__ intptr_t
A signed integer type with the property that any valid pointer to void can be converted to this type...
void Reset()
Reset the state of the diagnostic object to its initial configuration.
bool IncludeInDiagnosticCounts() const override
Indicates whether the diagnostics handled by this DiagnosticConsumer should be included in the number...
detail::InMemoryDirectory::const_iterator I
Diagnostic(const DiagnosticsEngine *DO, StringRef storedDiagMessage)
void setFatalsAsError(bool Val)
When set to true, any fatal error reported is made an error.
const IdentifierInfo * getArgIdentifier(unsigned Idx) const
Return the specified IdentifierInfo argument.
bool EmitCurrentDiagnostic(bool Force=false)
Emit the current diagnostic and clear the diagnostic state.
const DiagnosticConsumer * getClient() const
bool getFatalsAsError() const
void setLastDiagnosticIgnored()
Pretend that the last diagnostic issued was ignored, so any subsequent notes will be suppressed...
Sema - This implements semantic analysis and AST building for C.
diag::Severity getExtensionHandlingBehavior() const
A little helper class used to produce diagnostics.
unsigned getCurrentDiagID() const
virtual ~DiagnosticConsumer()
friend class DiagnosticBuilder
Represents a character-granular source range.
bool hasFatalErrorOccurred() const
DiagnosticErrorTrap(DiagnosticsEngine &Diag)
range_iterator range_begin() const
void setElideType(bool Val=true)
Set type eliding, to skip outputting same types occurring in template types.
unsigned TemplateDiffUsed
intptr_t getRawArg(unsigned Idx) const
Return the specified non-string argument in an opaque form.
diag_mapping_range getDiagnosticMappings() const
Get the current set of diagnostic mappings.
AddFlagValue(StringRef V)
std::pair< ArgumentKind, intptr_t > ArgumentValue
Represents on argument value, which is a union discriminated by ArgumentKind, with a value...
unsigned getConstexprBacktraceLimit() const
Retrieve the maximum number of constexpr evaluation notes to emit along with a given diagnostic...
void AddString(StringRef S) const
void Clear()
Clear out the current diagnostic.
void AddSourceRange(const CharSourceRange &R) const
bool BeforePreviousInsertions
void setEnableAllWarnings(bool Val)
When set to true, any unmapped ignored warnings are no longer ignored.
class LLVM_ALIGNAS(8) TemplateSpecializationType unsigned NumArgs
Represents a type template specialization; the template must be a class template, a type alias templa...
The result type of a method or function.
CharSourceRange InsertFromRange
Code in the specific range that should be inserted in the insertion location.
static CharSourceRange getCharRange(SourceRange R)
void AddFixItHint(const FixItHint &Hint) const
bool getSuppressSystemWarnings() const
CharSourceRange RemoveRange
Code that should be replaced to correct the error.
ArrayRef< FixItHint > getFixIts() const
void setSuppressSystemWarnings(bool Val)
When set to true mask warnings that come from system headers.
Encodes a location in the source.
const TemplateArgument * iterator
bool isValid() const
Return true if this is a valid SourceLocation object.
Options for controlling the compiler diagnostics engine.
virtual void finish()
Callback to inform the diagnostic client that processing of all source files has ended.
bool getSuppressAllDiagnostics() const
bool getPrintTemplateTree()
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".
unsigned range_size() 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)
unsigned NumWarnings
Number of warnings reported.
void setNoErrorAsFatal(bool Value)
DiagnosticOptions & getDiagnosticOptions() const
Retrieve the diagnostic options.
~ForwardingDiagnosticConsumer() override
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.
Flavor
Flavors of diagnostics we can emit.
unsigned getCustomDiagID(Level L, const char(&FormatString)[N])
Return an ID for a diagnostic with the specified format string and level.
bool operator<(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
bool getEnableAllWarnings() const
void setNumWarnings(unsigned NumWarnings)
static DiagnosticMapping Make(diag::Severity Severity, bool IsUser, bool IsPragma)
bool isIgnored(unsigned DiagID, SourceLocation Loc) const
Determine whether the diagnostic is known to be ignored.
const DiagnosticBuilder & setForceEmit() const
Forces the diagnostic to be emitted.
DiagnosticsEngine::ArgumentKind getArgKind(unsigned Idx) const
Return the kind of the specified index.
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.
A diagnostic client that ignores all diagnostics.
range_iterator range_end() const
bool hasSourceManager() const
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
Reads an AST files chain containing the contents of a translation unit.
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.
StoredDiagnostic()=default
Used for handling and querying diagnostic IDs.
bool getErrorsAsFatal() const
void setErrorsAsFatal(bool Val)
When set to true, any error reported is made a fatal error.
ArrayRef< CharSourceRange > getRanges() const
Return an array reference for this diagnostic's ranges.
unsigned Map[Count]
The type of a lookup table which maps from language-specific address spaces to target-specific ones...
const FixItHint & getFixItHint(unsigned Idx) const
std::vector< FixItHint >::const_iterator fixit_iterator
bool hasSourceManager() const
void setWarningsAsErrors(bool Val)
When set to true, any warnings reported are issued as errors.
SourceManager & getSourceManager() const
void setSeverity(diag::kind Diag, diag::Severity Map, SourceLocation Loc)
This allows the client to specify that certain warnings are ignored.
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...
void setConstexprBacktraceLimit(unsigned Limit)
Specify the maximum number of constexpr evaluation notes to emit along with a given diagnostic...
unsigned fixit_size() const
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.
ArrayRef< CharSourceRange > getRanges() const
Diagnostic(const DiagnosticsEngine *DO)
void DecrementAllExtensionsSilenced()
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.
OverloadsShown
Specifies which overload candidates to display when overload resolution fails.
OverloadsShown getShowOverloads() const
Level
The level of the diagnostic, after it has been through mapping.
Do not present this diagnostic, ignore it.
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.
const CharSourceRange & getRange(unsigned Idx) const
unsigned getNumFixItHints() const
DiagnosticsEngine::Level getLevel() 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.
unsigned getNumErrors() const
unsigned getArgUInt(unsigned Idx) const
Return the specified unsigned integer argument.
Annotates a diagnostic with some code that should be inserted, removed, or replaced to fix the proble...
SourceLocation getCurrentDiagLoc() const
void setNoWarningAsError(bool Value)
bool Emit()
Force the diagnostic builder to emit the diagnostic now.
bool ownsClient() const
Determine whether this DiagnosticsEngine object own its client.
A trivial tuple used to represent a source range.
void setLocation(FullSourceLoc Loc)
void FormatDiagnostic(SmallVectorImpl< char > &OutStr) const
Format this diagnostic into a string, substituting the formal arguments into the %0 slots...
Level getDiagnosticLevel(unsigned DiagID, SourceLocation Loc) const
Based on the way the client configured the DiagnosticsEngine object, classify the specified diagnosti...
virtual void BeginSourceFile(const LangOptions &LangOpts, const Preprocessor *PP=nullptr)
Callback to inform the diagnostic client that processing of a source file is beginning.
FixItHint()
Empty code modification hint, indicating that no code modification is known.
bool hasUncompilableErrorOccurred() const
Errors that actually prevent compilation, not those that are upgraded from a warning by -Werror...
This class handles loading and caching of source files into memory.
ArrayRef< FixItHint > getFixItHints() const
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
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...