From: Ted Kremenek Date: Mon, 2 Mar 2009 21:41:18 +0000 (+0000) Subject: BugReporter: Construct path-related PathDiagnosticPieces with kind "ControlFlow". X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=025fedcbb98870e7739c942cee68c6f1c512bc46;p=clang BugReporter: Construct path-related PathDiagnosticPieces with kind "ControlFlow". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65876 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp index a8cb6a9107..6f6b3c1566 100644 --- a/lib/Analysis/BugReporter.cpp +++ b/lib/Analysis/BugReporter.cpp @@ -641,7 +641,8 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, 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 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, 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 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, 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 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, 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 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, 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 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, 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; }