start partitioning the diagnostics into two classes: those
that are builtin and those that are aren't. This is a bunch
of API refactoring that will make this possible, but there is
no functionality change yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44473 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/TextDiagnostics.cpp b/Driver/TextDiagnostics.cpp
index 3c29cca..5b14cdd 100644
--- a/Driver/TextDiagnostics.cpp
+++ b/Driver/TextDiagnostics.cpp
@@ -19,11 +19,12 @@
TextDiagnostics:: ~TextDiagnostics() {}
-std::string TextDiagnostics::FormatDiagnostic(Diagnostic::Level Level,
+std::string TextDiagnostics::FormatDiagnostic(Diagnostic &Diags,
+ Diagnostic::Level Level,
diag::kind ID,
const std::string *Strs,
unsigned NumStrs) {
- std::string Msg = Diagnostic::getDescription(ID);
+ std::string Msg = Diags.getDescription(ID);
// Replace all instances of %0 in Msg with 'Extra'.
for (unsigned i = 0; i < Msg.size() - 1; ++i) {
@@ -43,8 +44,7 @@
if (Pos.isValid()) {
// If this is a warning or note, and if it a system header, suppress the
// diagnostic.
- if (Level == Diagnostic::Warning ||
- Level == Diagnostic::Note) {
+ if (Level == Diagnostic::Warning || Level == Diagnostic::Note) {
if (const FileEntry *F = SourceMgr.getFileEntryForLoc(Pos)) {
DirectoryLookup::DirType DirInfo = TheHeaderSearch->getFileDirFlavor(F);
if (DirInfo == DirectoryLookup::SystemHeaderDir ||