diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-11 02:41:36 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-11 02:41:36 +0000 |
commit | 0bed8a12f2878d3cd94fb8bdba55b593d92dd11a (patch) | |
tree | a1b8d42e3242c3fee99405dfee7ce30012f8c83f /lib/Analysis/GRExprEngine.cpp | |
parent | 7de20fe9aac00705dd943690563db66fa4b35b5b (diff) |
GRExprEngine: Add pretty-stack trace printing for crashes and assertion failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66629 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 8bc84d4bf5..c6457d9be3 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -18,6 +18,7 @@ #include "clang/Analysis/PathSensitive/BugReporter.h" #include "clang/Basic/SourceManager.h" +#include "clang/Basic/PrettyStackTrace.h" #include "llvm/Support/Streams.h" #include "llvm/ADT/ImmutableList.h" #include "llvm/Support/Compiler.h" @@ -152,6 +153,10 @@ const GRState* GRExprEngine::getInitialState() { void GRExprEngine::ProcessStmt(Stmt* S, StmtNodeBuilder& builder) { + PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(), + S->getLocStart(), + "Error evaluating statement"); + Builder = &builder; EntryNode = builder.getLastNode(); @@ -221,8 +226,11 @@ void GRExprEngine::ProcessStmt(Stmt* S, StmtNodeBuilder& builder) { Builder = NULL; } -void GRExprEngine::Visit(Stmt* S, NodeTy* Pred, NodeSet& Dst) { - +void GRExprEngine::Visit(Stmt* S, NodeTy* Pred, NodeSet& Dst) { + PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(), + S->getLocStart(), + "Error evaluating statement"); + // FIXME: add metadata to the CFG so that we can disable // this check when we KNOW that there is no block-level subexpression. // The motivation is that this check requires a hashtable lookup. @@ -534,6 +542,10 @@ const GRState* GRExprEngine::MarkBranch(const GRState* state, void GRExprEngine::ProcessBranch(Stmt* Condition, Stmt* Term, BranchNodeBuilder& builder) { + + PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(), + Condition->getLocStart(), + "Error evaluating branch"); // Remove old bindings for subexpressions. const GRState* PrevState = |