[Static Analyzer] New checker hook: checkInitialState

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 30 07:38:16 PST 2015


Hmm. I once thought about creating a 'checkBeginAnalysis()' callback to 
match 'checkEndAnalysis()'; this one's more powerful, and matches 
'checkEndFunction()' in a similar manner.

At a glance, I wonder if it's worth it to provide a CheckerContext 
inside this callback and then handle transitions properly (which would 
allow the checker to split the program state at the very beginning of 
the function). I cannot instantly think of a use-case (hmm, maybe 
somebody would like to eagerly discriminate between a NULL and non-NULL 
pointer argument of the function), but at the same time I don't see any 
obvious problems with adding it, especially because it'd be hard to 
change the API when the use-case appears.


More information about the cfe-commits mailing list