1919
2020#include < map>
2121#include < set>
22+ #include < type_traits>
2223#include < unordered_map>
2324
2425#include < phasar/PhasarLLVM/Utils/BinaryDomain.h>
@@ -35,7 +36,7 @@ template <typename N, typename D, typename L> class SolverResults {
3536 SolverResults (Table<N, D, L> &res_tab, D zv)
3637 : results(res_tab), zeroValue(zv) {}
3738
38- L valueAt (N stmt, D node) const { return results.get (stmt, node); }
39+ L resultAt (N stmt, D node) const { return results.get (stmt, node); }
3940
4041 std::unordered_map<D, L> resultsAt (N stmt, bool stripZero = false ) const {
4142 std::unordered_map<D, L> result = results.row (stmt);
@@ -51,13 +52,18 @@ template <typename N, typename D, typename L> class SolverResults {
5152 return result;
5253 }
5354
55+ // this function only exists for IFDS problems which use BinaryDomain as their
56+ // value domain L
57+ template <typename ValueDomain = L,
58+ typename = typename std::enable_if_t <
59+ std::is_same_v<ValueDomain, BinaryDomain>>>
5460 std::set<D> ifdsResultsAt (N stmt) const {
55- std::set<D> keyset ;
56- std::unordered_map<D, BinaryDomain> map = this ->resultsAt (stmt);
57- for (auto d : map ) {
58- keyset .insert (d .first );
61+ std::set<D> KeySet ;
62+ std::unordered_map<D, BinaryDomain> ResultMap = this ->resultsAt (stmt);
63+ for (auto FlowFact : ResultMap ) {
64+ KeySet .insert (FlowFact .first );
5965 }
60- return keyset ;
66+ return KeySet ;
6167 }
6268};
6369
0 commit comments