vbvictor wrote:

> would it be easier to use this Signature class for implementing the matching 
> code instead of hand-rolling out something custom?

It's "easier" to some extent, I think it's more readable and maintainable with 
full dedicated signature matching. I created a small PR in my LLVM fork to 
demonstrate how it can look like 
https://github.com/vbvictor/llvm-project/pull/1.

I updated this PR and implemented option 2. It has more gentle error handling, 
just avoid crushes. But it still accept all functions that "look like" 
`getline`. Note how there are false-positives with absurd functions, like in 
`TEST_GETLINE_2`.

I think it's still helpful to have strict function signature matching. Even in 
option 2 I needed to explicitly check types to avoid crush, so having a 
dedicated instrument would make it better.

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

Reply via email to