From e02d90c45fc1cf7fa71f5e567bb6f8e098818289 Mon Sep 17 00:00:00 2001 From: Martin Mory Date: Sun, 7 Apr 2024 13:20:49 +0200 Subject: [PATCH] Fix Compose FF to have vectors of FlowFunctionPtrType (#710) * Fix Compose FF to have vectors of FlowFunctionPtrType, which is necessary, since FlowFunctionTy is a virtual interface * clang-format include/phasar/DataFlow/IfdsIde/FlowFunctions.h Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update include/phasar/DataFlow/IfdsIde/FlowFunctions.h Co-authored-by: Fabian Schiebel <52407375+fabianbs96@users.noreply.github.com> * Update include/phasar/DataFlow/IfdsIde/FlowFunctions.h Co-authored-by: Fabian Schiebel <52407375+fabianbs96@users.noreply.github.com> --------- Co-authored-by: Martin Mory Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Fabian Schiebel <52407375+fabianbs96@users.noreply.github.com> --- .../phasar/DataFlow/IfdsIde/FlowFunctions.h | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/phasar/DataFlow/IfdsIde/FlowFunctions.h b/include/phasar/DataFlow/IfdsIde/FlowFunctions.h index 83520ba07..b4246db4f 100644 --- a/include/phasar/DataFlow/IfdsIde/FlowFunctions.h +++ b/include/phasar/DataFlow/IfdsIde/FlowFunctions.h @@ -929,16 +929,16 @@ class [[deprecated]] Compose : public FlowFunction { using typename FlowFunction::container_type; - Compose(const std::vector> &Funcs) : Funcs(Funcs) {} + Compose(const std::vector &Funcs) : Funcs(Funcs) {} ~Compose() override = default; - container_type computeTargets(const D &Source) override { - container_type Current(Source); - for (const FlowFunctionType &Func : Funcs) { + container_type computeTargets(D Source) override { + container_type Current{Source}; + for (const FlowFunctionPtrType &Func : Funcs) { container_type Next; for (const D &Fact : Current) { - container_type Target = Func.computeTargets(Fact); + container_type Target = Func->computeTargets(Fact); Next.insert(Target.begin(), Target.end()); } Current = Next; @@ -947,11 +947,11 @@ class [[deprecated]] Compose : public FlowFunction { } static FlowFunctionPtrType - compose(const std::vector &Funcs) { - std::vector Vec; - for (const FlowFunctionType &Func : Funcs) { + compose(const std::vector &Funcs) { + std::vector Vec; + for (const FlowFunctionPtrType &Func : Funcs) { if (Func != Identity::getInstance()) { - Vec.insert(Func); + Vec.push_back(Func); } } if (Vec.size() == 1) { // NOLINT(readability-container-size-empty) @@ -964,7 +964,7 @@ class [[deprecated]] Compose : public FlowFunction { } protected: - const std::vector Funcs; + const std::vector Funcs; }; //===----------------------------------------------------------------------===//