Like PathDiagnosticPieces, strip trailing periods at the end of PathDiagnostic descriptions

llvm-svn: 66263
This commit is contained in:
Ted Kremenek 2009-03-06 07:08:50 +00:00
parent 25b625165f
commit 5b9e7b833b
2 changed files with 18 additions and 6 deletions

View File

@ -94,21 +94,19 @@ public:
class PathDiagnostic {
std::list<PathDiagnosticPiece*> path;
unsigned Size;
std::string BugType;
std::string Desc;
std::string Category;
std::string BugType;
std::vector<std::string> OtherDesc;
public:
PathDiagnostic() : Size(0) {}
PathDiagnostic(const char* bugtype, const char* desc, const char* category)
: Size(0), Desc(desc), Category(category), BugType(bugtype) {}
PathDiagnostic(const char* bugtype, const char* desc, const char* category);
PathDiagnostic(const std::string& bugtype, const std::string& desc,
const std::string& category)
: Size(0), Desc(desc), Category(category), BugType(bugtype) {}
const std::string& category);
~PathDiagnostic();
const std::string& getDescription() const { return Desc; }

View File

@ -47,6 +47,20 @@ PathDiagnostic::~PathDiagnostic() {
for (iterator I = begin(), E = end(); I != E; ++I) delete &*I;
}
PathDiagnostic::PathDiagnostic(const char* bugtype, const char* desc,
const char* category)
: BugType(bugtype, GetNumCharsToLastNonPeriod(bugtype)),
Desc(desc, GetNumCharsToLastNonPeriod(desc)),
Category(category, GetNumCharsToLastNonPeriod(category)) {}
PathDiagnostic::PathDiagnostic(const std::string& bugtype,
const std::string& desc,
const std::string& category)
: BugType(bugtype, 0, GetNumCharsToLastNonPeriod(bugtype)),
Desc(desc, 0, GetNumCharsToLastNonPeriod(desc)),
Category(category, 0, GetNumCharsToLastNonPeriod(category)) {}
void PathDiagnosticClient::HandleDiagnostic(Diagnostic::Level DiagLevel,
const DiagnosticInfo &Info) {