diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-18 04:44:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-18 04:44:58 +0000 |
commit | 53f5d4c1b5310f529aed0b0c6c723372c62801d9 (patch) | |
tree | bfec76ef8bb20aae6a88b20799746294a09006de /clang/lib | |
parent | 4c5888c67a5aeaf6e4558f7fe88ee99a7cb798ae (diff) | |
download | bcm5719-llvm-53f5d4c1b5310f529aed0b0c6c723372c62801d9.tar.gz bcm5719-llvm-53f5d4c1b5310f529aed0b0c6c723372c62801d9.zip |
cleanups and simplifications.
llvm-svn: 59491
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Analysis/PathDiagnostic.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/clang/lib/Analysis/PathDiagnostic.cpp b/clang/lib/Analysis/PathDiagnostic.cpp index 4c34953b17c..971e751b8dc 100644 --- a/clang/lib/Analysis/PathDiagnostic.cpp +++ b/clang/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); |