#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/DiagnosticError.h"
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/TokenKinds.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/CrashRecoveryContext.h"
#include "llvm/Support/Unicode.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <limits>
#include <string>
#include <utility>
#include <vector>
usingnamespaceclang;
const StreamingDiagnostic &clang::operator<<(const StreamingDiagnostic &DB,
DiagNullabilityKind nullability) { … }
const StreamingDiagnostic &clang::operator<<(const StreamingDiagnostic &DB,
llvm::Error &&E) { … }
static void DummyArgToStringFn(DiagnosticsEngine::ArgumentKind AK, intptr_t QT,
StringRef Modifier, StringRef Argument,
ArrayRef<DiagnosticsEngine::ArgumentValue> PrevArgs,
SmallVectorImpl<char> &Output,
void *Cookie,
ArrayRef<intptr_t> QualTypeVals) { … }
DiagnosticsEngine::DiagnosticsEngine(
IntrusiveRefCntPtr<DiagnosticIDs> diags,
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts, DiagnosticConsumer *client,
bool ShouldOwnClient)
: … { … }
DiagnosticsEngine::~DiagnosticsEngine() { … }
void DiagnosticsEngine::dump() const { … }
void DiagnosticsEngine::dump(StringRef DiagName) const { … }
void DiagnosticsEngine::setClient(DiagnosticConsumer *client,
bool ShouldOwnClient) { … }
void DiagnosticsEngine::pushMappings(SourceLocation Loc) { … }
bool DiagnosticsEngine::popMappings(SourceLocation Loc) { … }
void DiagnosticsEngine::Reset(bool soft ) { … }
void DiagnosticsEngine::SetDelayedDiagnostic(unsigned DiagID, StringRef Arg1,
StringRef Arg2, StringRef Arg3) { … }
void DiagnosticsEngine::ReportDelayed() { … }
DiagnosticMapping &
DiagnosticsEngine::DiagState::getOrAddMapping(diag::kind Diag) { … }
void DiagnosticsEngine::DiagStateMap::appendFirst(DiagState *State) { … }
void DiagnosticsEngine::DiagStateMap::append(SourceManager &SrcMgr,
SourceLocation Loc,
DiagState *State) { … }
DiagnosticsEngine::DiagState *
DiagnosticsEngine::DiagStateMap::lookup(SourceManager &SrcMgr,
SourceLocation Loc) const { … }
DiagnosticsEngine::DiagState *
DiagnosticsEngine::DiagStateMap::File::lookup(unsigned Offset) const { … }
DiagnosticsEngine::DiagStateMap::File *
DiagnosticsEngine::DiagStateMap::getFile(SourceManager &SrcMgr,
FileID ID) const { … }
void DiagnosticsEngine::DiagStateMap::dump(SourceManager &SrcMgr,
StringRef DiagName) const { … }
void DiagnosticsEngine::PushDiagStatePoint(DiagState *State,
SourceLocation Loc) { … }
void DiagnosticsEngine::setSeverity(diag::kind Diag, diag::Severity Map,
SourceLocation L) { … }
bool DiagnosticsEngine::setSeverityForGroup(diag::Flavor Flavor,
StringRef Group, diag::Severity Map,
SourceLocation Loc) { … }
bool DiagnosticsEngine::setSeverityForGroup(diag::Flavor Flavor,
diag::Group Group,
diag::Severity Map,
SourceLocation Loc) { … }
bool DiagnosticsEngine::setDiagnosticGroupWarningAsError(StringRef Group,
bool Enabled) { … }
bool DiagnosticsEngine::setDiagnosticGroupErrorAsFatal(StringRef Group,
bool Enabled) { … }
void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor,
diag::Severity Map,
SourceLocation Loc) { … }
void DiagnosticsEngine::Report(const StoredDiagnostic &storedDiag) { … }
bool DiagnosticsEngine::EmitCurrentDiagnostic(bool Force) { … }
DiagnosticConsumer::~DiagnosticConsumer() = default;
void DiagnosticConsumer::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
const Diagnostic &Info) { … }
template <std::size_t StrLen>
static bool ModifierIs(const char *Modifier, unsigned ModifierLen,
const char (&Str)[StrLen]) { … }
static const char *ScanFormat(const char *I, const char *E, char Target) { … }
static void HandleSelectModifier(const Diagnostic &DInfo, unsigned ValNo,
const char *Argument, unsigned ArgumentLen,
SmallVectorImpl<char> &OutStr) { … }
static void HandleIntegerSModifier(unsigned ValNo,
SmallVectorImpl<char> &OutStr) { … }
static void HandleOrdinalModifier(unsigned ValNo,
SmallVectorImpl<char> &OutStr) { … }
static unsigned PluralNumber(const char *&Start, const char *End) { … }
static bool TestPluralRange(unsigned Val, const char *&Start, const char *End) { … }
static bool EvalPluralExpr(unsigned ValNo, const char *Start, const char *End) { … }
static void HandlePluralModifier(const Diagnostic &DInfo, unsigned ValNo,
const char *Argument, unsigned ArgumentLen,
SmallVectorImpl<char> &OutStr) { … }
static const char *getTokenDescForDiagnostic(tok::TokenKind Kind) { … }
void Diagnostic::
FormatDiagnostic(SmallVectorImpl<char> &OutStr) const { … }
void clang::EscapeStringForDiagnostic(StringRef Str,
SmallVectorImpl<char> &OutStr) { … }
void Diagnostic::
FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
SmallVectorImpl<char> &OutStr) const { … }
StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
StringRef Message)
: … { … }
StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level,
const Diagnostic &Info)
: … { … }
StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
StringRef Message, FullSourceLoc Loc,
ArrayRef<CharSourceRange> Ranges,
ArrayRef<FixItHint> FixIts)
: … { … }
llvm::raw_ostream &clang::operator<<(llvm::raw_ostream &OS,
const StoredDiagnostic &SD) { … }
bool DiagnosticConsumer::IncludeInDiagnosticCounts() const { … }
void IgnoringDiagConsumer::anchor() { … }
ForwardingDiagnosticConsumer::~ForwardingDiagnosticConsumer() = default;
void ForwardingDiagnosticConsumer::HandleDiagnostic(
DiagnosticsEngine::Level DiagLevel,
const Diagnostic &Info) { … }
void ForwardingDiagnosticConsumer::clear() { … }
bool ForwardingDiagnosticConsumer::IncludeInDiagnosticCounts() const { … }
PartialDiagnostic::DiagStorageAllocator::DiagStorageAllocator() { … }
PartialDiagnostic::DiagStorageAllocator::~DiagStorageAllocator() { … }
char DiagnosticError::ID;