steakhal wrote:

> Hello @steakhal, I have just looked through the changes again. What is the 
> advantage of using checkPreCall instead of checkLocation? I would very much 
> appreciate some background information. Thanks for your help!

Oh yes, I should have explained.
So, `checkLocation` can be triggered for all loads and store operations. Each 
time in the AST you have a `LValueToRValue` cast for reads, and others for 
write operations. This means that you can't really define a test where you have 
clear control of what region you wanted to dump.

Using `PreCall`, you can have your own API, that does what you think, exactly 
when it encounters that call.
This is similar to what we do in the `ExprInspection` checker, where we have 
analyzer debug intrinsics defined. Such as `clang_analyzer_dump(T)`. Search for 
it in the tests, and you will see what I'm talking about.

There is one more benefit of doing this way: There is already a communication 
channel for the stringified descriptive name: diagnostics.
One can easily capture and compare the diagnostics, like in the rest of the 
tests.

I was happy to help as I don't expect new contributors to be really involved 
with our specific testing.
To me what moved the needle was: well described expectation, well described and 
reproducible actual outcome. You even provided a fix, so I figured I'll help 
out with the rest.

Ask me if there is anything I left out.

https://github.com/llvm/llvm-project/pull/85104
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to