Extend D120185 to also log the node being matched on in case of a crash.
This can help if a matcher is causing a crash or there are not enough interesting nodes bound.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This looks.... good?.... to me. :-)
Despite this complicating things by a fair amount, I don't have a better suggestion to offer. LGTM
clang/lib/ASTMatchers/ASTMatchFinder.cpp | ||
---|---|---|
771 |
This was the "nicest" cheapest way I could think to implement this, It's also why I thought it best to resubmit this for review.
Annoyingly this is now suboptimal for 64bit code, but I'm not sure it's worth writing 2 implementations for 64 and 32 bit.
Given that it has to do with crash analysis (which had better not be performance sensitive!!), I think I agree it's not worth writing two implementations for this.
(sorry to turn up a year later, just want to see if I'm missing something)
AFAICT there's only ever one CurMatchData object.
In which case squeezing the union discriminator into the low bits saves... 8 bytes of stack over the whole AST traversal.
I ran into this when I tried to add a ninth pointer type. We could use a second bit of the callback, but seems like we can just store the discriminator in an int instead?