isuckatcs wrote:

> I have also thought about a possible different caller but I think it is very 
> unlikely. These `ExpressionHandler`s are basically visitor like classes for 
> this tracking mechanism, if I am correct. Their purpose is to track other 
> values or append `BugReporterVisitor`s to the `PathSensitiveBugReport`.

Still, here we technically want to turn a safety check into a contract between 
the function and it's caller. With an assertion added, the callers now know 
about the contract at the cost of a possible crash. However a contract is still 
a weaker guarantee than a safety check. 

I don't see why having that safety check bothers us. It's not affecting 
performance in any significant way, the code is not harder to understand 
because of it, the function is not less maintainable, etc.

For now, I would like to know what the others think about this change too.

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

Reply via email to