[PATCH] D120185: [ASTMatchers] Output currently processing match and nodes on crash

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 19 04:30:45 PST 2022


njames93 created this revision.
njames93 added reviewers: klimek, aaron.ballman, LegalizeAdulthood.
Herald added a subscriber: mgorny.
njames93 requested review of this revision.
Herald added projects: clang, clang-tools-extra.
Herald added a subscriber: cfe-commits.

Create a PrettyStackTraceEvent that will dump the current `MatchCallback` id as well as the `BoundNodes` if the 'run' method of a `MatchCallback` results in a crash.
The purpose of this is sometimes clang-tidy checks can crash in the `check` method. And in a large codebase with alot of checks enabled and in a release build, it can be near impossible to figure out which check as well as the source code that caused the crash. Without that information a reproducer is very hard to create.
This is a more generalised version of D118520 <https://reviews.llvm.org/D118520> which has a nicer integration and should be useful to clients other than clang-tidy.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120185

Files:
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/test/CMakeLists.txt
  clang-tools-extra/test/clang-tidy/CTCrashTestTrace.cpp
  clang-tools-extra/test/clang-tidy/infrastructure/crash-trace.c
  clang-tools-extra/test/lit.cfg.py
  clang/lib/ASTMatchers/ASTMatchFinder.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120185.410080.patch
Type: text/x-patch
Size: 11064 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220219/3ee87476/attachment.bin>


More information about the cfe-commits mailing list