[cfe-commits] r66263 - in /cfe/trunk: include/clang/Analysis/PathDiagnostic.h lib/Analysis/PathDiagnostic.cpp

Ted Kremenek kremenek at apple.com
Thu Mar 5 23:08:50 PST 2009


Author: kremenek
Date: Fri Mar  6 01:08:50 2009
New Revision: 66263

URL: http://llvm.org/viewvc/llvm-project?rev=66263&view=rev
Log:
Like PathDiagnosticPieces, strip trailing periods at the end of PathDiagnostic descriptions

Modified:
    cfe/trunk/include/clang/Analysis/PathDiagnostic.h
    cfe/trunk/lib/Analysis/PathDiagnostic.cpp

Modified: cfe/trunk/include/clang/Analysis/PathDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathDiagnostic.h?rev=66263&r1=66262&r2=66263&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathDiagnostic.h (original)
+++ cfe/trunk/include/clang/Analysis/PathDiagnostic.h Fri Mar  6 01:08:50 2009
@@ -94,21 +94,19 @@
 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; }

Modified: cfe/trunk/lib/Analysis/PathDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/PathDiagnostic.cpp?rev=66263&r1=66262&r2=66263&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/PathDiagnostic.cpp (original)
+++ cfe/trunk/lib/Analysis/PathDiagnostic.cpp Fri Mar  6 01:08:50 2009
@@ -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) {
   





More information about the cfe-commits mailing list