aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/PathDiagnostic.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2008-08-10 19:59:06 +0000
committerNico Weber <nicolasweber@gmx.de>2008-08-10 19:59:06 +0000
commit7bfaaaecb3113f955db31e8d8a51acffd1bc0c27 (patch)
treebac57d5f77ac6696a51a822a63f513fb92d79a65 /lib/Analysis/PathDiagnostic.cpp
parent3ac5e9fc38e1a59da84844f6adb95e803779098d (diff)
* Remove isInSystemHeader() from DiagClient, move it to SourceManager
* Move FormatError() from TextDiagnostic up to DiagClient, remove now empty class TextDiagnostic * Make DiagClient optional for Diagnostic This fixes the following problems: * -html-diags (and probably others) does now output the same set of warnings as console clang does * nothing crashes if one forgets to call setHeaderSearch() on TextDiagnostic * some code duplication is removed git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54620 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PathDiagnostic.cpp')
-rw-r--r--lib/Analysis/PathDiagnostic.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/Analysis/PathDiagnostic.cpp b/lib/Analysis/PathDiagnostic.cpp
index 28b76b38f1..4c34953b17 100644
--- a/lib/Analysis/PathDiagnostic.cpp
+++ b/lib/Analysis/PathDiagnostic.cpp
@@ -33,9 +33,6 @@ void PathDiagnosticClient::HandleDiagnostic(Diagnostic &Diags,
PathDiagnostic* D = new PathDiagnostic();
- // Ripped from TextDiagnostics::FormatDiagnostic. Perhaps we should
- // centralize it somewhere?
-
std::ostringstream os;
switch (DiagLevel) {
@@ -46,17 +43,8 @@ void PathDiagnosticClient::HandleDiagnostic(Diagnostic &Diags,
case Diagnostic::Fatal: os << "fatal error: "; break;
break;
}
-
- std::string Msg = Diags.getDescription(ID);
- for (unsigned i = 0; i < Msg.size() - 1; ++i) {
- if (Msg[i] == '%' && isdigit(Msg[i + 1])) {
- unsigned StrNo = Msg[i + 1] - '0';
- Msg = std::string(Msg.begin(), Msg.begin() + i) +
- (StrNo < NumStrs ? Strs[StrNo] : "<<<INTERNAL ERROR>>>") +
- std::string(Msg.begin() + i + 2, Msg.end());
- }
- }
+ std::string Msg = FormatDiagnostic(Diags, DiagLevel, ID, Strs, NumStrs);
os << Msg;