secure-software-engineering / phasar

A LLVM-based static analysis framework.
Other
933 stars 140 forks source link

Make NToString and friends free functions #652

Closed fabianbs96 closed 1 year ago

fabianbs96 commented 1 year ago

Currently, the printers NToString, DToString, etc. are pure virtual functions that have to be implemented by each analysis problem. However, the vast majority of all implementations of these functions is exactly the same (delegating to either llvmIRToString() or to operator<<) and independent from the analysis problem instance.

To simplify the usage of these functions as well as to simplify implementations of IDETabulationProblem, these printer functions are now free functions directly within the namespace psr. They now have a useful default implementation and can be easily extended via normal function overloading.

Note: The only painpoint currently is the Typestate Analysis -- the only analysis where LToString really depends on the analysis. This PR, thus, slightly adapts the l_t type of the TSA to cope with this issue. A better solution is welcome and may come in its own PR.