Closed Baltoli closed 7 years ago
A single static analysis will run as a component part of the module pass. This probably means that each one gets at least the module in question, as well as whatever extra stuff it needs to run (e.g. a call graph). The return value of these analyses is probably a boolean, to be interpreted by the calling pass as appropriate.
First step should probably be to factor out the call graph analysis into one of these self-contained modules. It will need to be given:
It can then walk the call graph itself and work out if there is any static path to an acquire / release call.
This also means that the stuff about walking the call graph and checking functions etc. can be removed from the pass itself, which will become a dispatcher to several analyses.
These analyses should also be responsible for generating an error or warning message when appropriate.
Currently the
AcquireReleaseCheck
structure is quite ad-hoc. Maybe worth investigating how a single static analysis could be split out of it and run generically?