[cfe-commits] r65876 - /cfe/trunk/lib/Analysis/BugReporter.cpp

Ted Kremenek kremenek at apple.com
Mon Mar 2 13:41:18 PST 2009


Author: kremenek
Date: Mon Mar  2 15:41:18 2009
New Revision: 65876

URL: http://llvm.org/viewvc/llvm-project?rev=65876&view=rev
Log:
BugReporter: Construct path-related PathDiagnosticPieces with kind "ControlFlow".

Modified:
    cfe/trunk/lib/Analysis/BugReporter.cpp

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

==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Mon Mar  2 15:41:18 2009
@@ -641,7 +641,8 @@
           os << "Control jumps to line "
              << SMgr.getInstantiationLineNumber(S->getLocStart()) << ".\n";
           
-          PD.push_front(new PathDiagnosticPiece(L, os.str()));
+          PD.push_front(new PathDiagnosticPiece(L, os.str(), 
+                                             PathDiagnosticPiece::ControlFlow));
           break;
         }
           
@@ -709,7 +710,8 @@
             ExecutionContinues(os, SMgr, N, getStateManager().getCodeDecl());
           }
           
-          PD.push_front(new PathDiagnosticPiece(L, os.str()));
+          PD.push_front(new PathDiagnosticPiece(L, os.str(),
+                                             PathDiagnosticPiece::ControlFlow));
           break;
         }
           
@@ -718,7 +720,8 @@
           std::string sbuf;
           llvm::raw_string_ostream os(sbuf);
           ExecutionContinues(os, SMgr, N, getStateManager().getCodeDecl());
-          PD.push_front(new PathDiagnosticPiece(L, os.str()));
+          PD.push_front(new PathDiagnosticPiece(L, os.str(),
+                                            PathDiagnosticPiece::ControlFlow));
           break;
         }
 
@@ -732,7 +735,8 @@
           else
             os << "true.";
           
-          PD.push_front(new PathDiagnosticPiece(L, os.str()));          
+          PD.push_front(new PathDiagnosticPiece(L, os.str(),
+                                            PathDiagnosticPiece::ControlFlow));          
           break;
         }
           
@@ -745,11 +749,13 @@
             os << "Loop condition is true. ";
             ExecutionContinues(os, SMgr, N, getStateManager().getCodeDecl());
             
-            PD.push_front(new PathDiagnosticPiece(L, os.str()));
+            PD.push_front(new PathDiagnosticPiece(L, os.str(),
+                                             PathDiagnosticPiece::ControlFlow));
           }
           else
             PD.push_front(new PathDiagnosticPiece(L,
-                              "Loop condition is false.  Exiting loop."));
+                              "Loop condition is false.  Exiting loop.",
+                              PathDiagnosticPiece::ControlFlow));
           
           break;
         }
@@ -764,20 +770,24 @@
             os << "Loop condition is false. ";
             ExecutionContinues(os, SMgr, N, getStateManager().getCodeDecl());
 
-            PD.push_front(new PathDiagnosticPiece(L, os.str()));
+            PD.push_front(new PathDiagnosticPiece(L, os.str(),
+                                             PathDiagnosticPiece::ControlFlow));
           }
           else
             PD.push_front(new PathDiagnosticPiece(L,
-                            "Loop condition is true.  Entering loop body."));
+                            "Loop condition is true.  Entering loop body.",
+                            PathDiagnosticPiece::ControlFlow));
           
           break;
         }
           
         case Stmt::IfStmtClass: {          
           if (*(Src->succ_begin()+1) == Dst)
-            PD.push_front(new PathDiagnosticPiece(L, "Taking false branch."));
-          else 
-            PD.push_front(new PathDiagnosticPiece(L, "Taking true branch."));
+            PD.push_front(new PathDiagnosticPiece(L, "Taking false branch.",
+                            PathDiagnosticPiece::ControlFlow));
+          else  
+            PD.push_front(new PathDiagnosticPiece(L, "Taking true branch.",
+                            PathDiagnosticPiece::ControlFlow));
           
           break;
         }





More information about the cfe-commits mailing list