aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/PathDiagnostic.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-18 04:44:58 +0000
committerChris Lattner <sabre@nondot.org>2008-11-18 04:44:58 +0000
commite837f931a8465029bb0e85a919d0ea0a4e9d510f (patch)
tree033263695d66e53ae7a08409a38e43cad8ceca12 /lib/Analysis/PathDiagnostic.cpp
parentf89963b1e819d5e73796a4f9d7cd70129846e2ec (diff)
cleanups and simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59491 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PathDiagnostic.cpp')
-rw-r--r--lib/Analysis/PathDiagnostic.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/Analysis/PathDiagnostic.cpp b/lib/Analysis/PathDiagnostic.cpp
index 4c34953b17..971e751b8d 100644
--- a/lib/Analysis/PathDiagnostic.cpp
+++ b/lib/Analysis/PathDiagnostic.cpp
@@ -33,22 +33,18 @@ void PathDiagnosticClient::HandleDiagnostic(Diagnostic &Diags,
PathDiagnostic* D = new PathDiagnostic();
- std::ostringstream os;
-
+ const char *LevelStr;
switch (DiagLevel) {
- default: assert(0 && "Unknown diagnostic type!");
- case Diagnostic::Note: os << "note: "; break;
- case Diagnostic::Warning: os << "warning: "; break;
- case Diagnostic::Error: os << "error: "; break;
- case Diagnostic::Fatal: os << "fatal error: "; break;
- break;
+ default: assert(0 && "Unknown diagnostic type!");
+ case Diagnostic::Note: LevelStr = "note: "; break;
+ case Diagnostic::Warning: LevelStr = "warning: "; break;
+ case Diagnostic::Error: LevelStr = "error: "; break;
+ case Diagnostic::Fatal: LevelStr = "fatal error: "; break;
}
std::string Msg = FormatDiagnostic(Diags, DiagLevel, ID, Strs, NumStrs);
- os << Msg;
-
- PathDiagnosticPiece* P = new PathDiagnosticPiece(Pos, os.str());
+ PathDiagnosticPiece* P = new PathDiagnosticPiece(Pos, LevelStr+Msg);
while (NumRanges) {
P->addRange(*Ranges);