summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BugReporter.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-02 21:41:18 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-02 21:41:18 +0000
commitc7b663120e5ed59145d07ab6b1e869f6543fc210 (patch)
treef5fceebc39e5eb88c6ad8b072f107957036fbc4e /clang/lib/Analysis/BugReporter.cpp
parent592ca2c4ab2f6172dc6f959d6530e1eafc607104 (diff)
downloadbcm5719-llvm-c7b663120e5ed59145d07ab6b1e869f6543fc210.tar.gz
bcm5719-llvm-c7b663120e5ed59145d07ab6b1e869f6543fc210.zip
BugReporter: Construct path-related PathDiagnosticPieces with kind "ControlFlow".
llvm-svn: 65876
Diffstat (limited to 'clang/lib/Analysis/BugReporter.cpp')
-rw-r--r--clang/lib/Analysis/BugReporter.cpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp
index a8cb6a9107a..6f6b3c15663 100644
--- a/clang/lib/Analysis/BugReporter.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud