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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66263 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/PathDiagnostic.cpp b/lib/Analysis/PathDiagnostic.cpp
index 818c548..c078b6d 100644
--- a/lib/Analysis/PathDiagnostic.cpp
+++ b/lib/Analysis/PathDiagnostic.cpp
@@ -47,6 +47,20 @@
   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) {