From: Ted Kremenek Date: Wed, 2 Apr 2008 07:03:43 +0000 (+0000) Subject: Added "description" field to PathDiagnostic. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=845ddbcd7f0eacbf59ea85e5dcccbe18eaae35eb;p=clang Added "description" field to PathDiagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49083 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/PathDiagnostic.h b/include/clang/Analysis/PathDiagnostic.h index bf855054bd..651e700bdf 100644 --- a/include/clang/Analysis/PathDiagnostic.h +++ b/include/clang/Analysis/PathDiagnostic.h @@ -33,6 +33,9 @@ public: PathDiagnosticPiece(FullSourceLoc pos, const std::string& s) : Pos(pos), str(s) {} + PathDiagnosticPiece(FullSourceLoc pos, const char* s) + : Pos(pos), str(s) {} + const std::string& getString() const { return str; } void addRange(SourceRange R) { @@ -61,13 +64,17 @@ public: class PathDiagnostic { std::list path; unsigned Size; - + std::string Desc; public: PathDiagnostic() : Size(0) {} + PathDiagnostic(const char* desc) : Desc(desc) {} + PathDiagnostic(const std::string& desc) : Desc(desc) {} ~PathDiagnostic(); + const std::string& getDescription() const { return Desc; } + void push_front(PathDiagnosticPiece* piece) { path.push_front(piece); ++Size;