GaloisInc / cclyzerpp

cclyzer++ is a precise and scalable pointer analysis for LLVM code.
https://galoisinc.github.io/cclyzerpp/
BSD 3-Clause "New" or "Revised" License
137 stars 14 forks source link

Generalize the FactGenerator #148

Closed adrianherrera closed 1 year ago

adrianherrera commented 1 year ago

Hey @langston-barrett!

Here's my initial "refactor" PR. Hopefully the first two commits are uncontroversial:

acb78c178624c374a18c58add17c06389bd895f8 allows the FactWriter (and underlying csv-writer) to be opened in an arbitrary mode. In particular, for a dynamic analysis operating over multiple inputs, the writer must be opened in append mode to ensure the facts across all inputs are captured.

3a9e07cf5bc1a8ff8e1e9c688ac0a26e84833ae5 Just cleans things up, deleting unused code and running clang-format over the source.

09ed10f1cec568fbc9c23624c8d0fbc74ba86410 is probably the most "radical" change, focusing on the predicate registry. Rather than only defining a singleton Registry, this commit enables instantiating different predicate registries. This registry is then passed to the FactWriter, which can then initialize the different writers (in init_writers). This then allows people to define their own predicates (e.g., for dynamic analysis) and then create a new registry with those predicates (rather than forcing the user to use the default set).

Happy to discuss these ideas further! Once again thanks for the great work.

langston-barrett commented 1 year ago

Thanks @adrianherrera!