diff options
author | Balazs Benics <balazs.benics@sigmatechnology.se> | 2022-06-10 12:21:17 +0200 |
---|---|---|
committer | Balazs Benics <balazs.benics@sigmatechnology.se> | 2022-06-10 12:21:17 +0200 |
commit | 07a7fd314a118393e6ca5e4dbcc9c3d91ff96172 (patch) | |
tree | a57a71309c3d352dd0b4c5407b7ea50d3c9b77a6 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 007917b95ce2b569a8e5e90cd9b819676a6bb364 (diff) | |
download | llvm-07a7fd314a118393e6ca5e4dbcc9c3d91ff96172.zip llvm-07a7fd314a118393e6ca5e4dbcc9c3d91ff96172.tar.gz llvm-07a7fd314a118393e6ca5e4dbcc9c3d91ff96172.tar.bz2 |
[analyzer] Print the offending function at EndAnalysis crash
I've faced crashes in the past multiple times when some
`check::EndAnalysis` callback caused some crash.
It's really anoying that it doesn't tell which function triggered this
callback.
This patch adds the well-known trace for that situation as well.
Example:
1. <eof> parser at end of file
2. While analyzing stack:
#0 Calling test11
Note that this does not have tests.
I've considered `unittests` for this purpose, by using the
`ASSERT_DEATH()` similarly how we check double eval called functions in
`ConflictingEvalCallsTest.cpp`, however, that the testsuite won't invoke
the custom handlers. Only the message of the `llvm_unreachable()` will
be printed. Consequently, it's not applicable for us testing this
feature.
I've also considered using an end-to-end LIT test for this.
For that, we would need to somehow overload the `clang_analyzer_crash()`
`ExprInspection` handler, to get triggered by other events than the
`EvalCall`. I'm not saying that we could not come up with a generic way
of causing crash in a specific checker callback, but I'm not sure if
that would worth the effort.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D127389
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions