diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-07-19 00:59:08 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-07-19 00:59:08 +0000 |
commit | e9c57229f9cbcf2231779a72fa8c3614b212cae3 (patch) | |
tree | 3c467586cd856b2c6a264f646d66eec7b2bb78f0 /clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp | |
parent | 978c8393156b94317ba195b7ff5880fde6327020 (diff) | |
download | bcm5719-llvm-e9c57229f9cbcf2231779a72fa8c3614b212cae3.tar.gz bcm5719-llvm-e9c57229f9cbcf2231779a72fa8c3614b212cae3.zip |
[analyzer] Include analysis stack in crash traces.
Sample output:
0. Program arguments: ...
1. <eof> parser at end of file
2. While analyzing stack:
#0 void inlined()
#1 void test()
3. crash-trace.c:6:3: Error evaluating statement
llvm-svn: 186639
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp index 810473f1a6e..9522d1d6387 100644 --- a/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp @@ -22,6 +22,7 @@ class ExprInspectionChecker : public Checker< eval::Call > { void analyzerEval(const CallExpr *CE, CheckerContext &C) const; void analyzerCheckInlined(const CallExpr *CE, CheckerContext &C) const; + void analyzerCrash(const CallExpr *CE, CheckerContext &C) const; typedef void (ExprInspectionChecker::*FnCheck)(const CallExpr *, CheckerContext &C) const; @@ -39,6 +40,7 @@ bool ExprInspectionChecker::evalCall(const CallExpr *CE, .Case("clang_analyzer_eval", &ExprInspectionChecker::analyzerEval) .Case("clang_analyzer_checkInlined", &ExprInspectionChecker::analyzerCheckInlined) + .Case("clang_analyzer_crash", &ExprInspectionChecker::analyzerCrash) .Default(0); if (!Handler) @@ -117,6 +119,11 @@ void ExprInspectionChecker::analyzerCheckInlined(const CallExpr *CE, C.emitReport(R); } +void ExprInspectionChecker::analyzerCrash(const CallExpr *CE, + CheckerContext &C) const { + LLVM_BUILTIN_TRAP; +} + void ento::registerExprInspectionChecker(CheckerManager &Mgr) { Mgr.registerChecker<ExprInspectionChecker>(); } |