From 6f97d8f69479c78ff2d687597c9e48ea59fe642a Mon Sep 17 00:00:00 2001 From: Martin Mory Date: Mon, 11 Mar 2024 22:25:03 +0100 Subject: [PATCH 1/4] Fix Compose FF to have vectors of FlowFunctionPtrType, which is necessary, since FlowFunctionTy is a virtual interface --- .../phasar/DataFlow/IfdsIde/FlowFunctions.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/phasar/DataFlow/IfdsIde/FlowFunctions.h b/include/phasar/DataFlow/IfdsIde/FlowFunctions.h index 83520ba072..46ba13379e 100644 --- a/include/phasar/DataFlow/IfdsIde/FlowFunctions.h +++ b/include/phasar/DataFlow/IfdsIde/FlowFunctions.h @@ -905,7 +905,7 @@ class [[deprecated("Use lambdaFlow() instead")]] LambdaFlow public: using typename FlowFunction::container_type; - LambdaFlow(Fn && F) : Flow(std::move(F)) {} + LambdaFlow(Fn &&F) : Flow(std::move(F)) {} LambdaFlow(const Fn &F) : Flow(F) {} ~LambdaFlow() override = default; container_type computeTargets(D Source) override { return Flow(Source); } @@ -929,13 +929,13 @@ 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 Current{Source}; + for (const FlowFunctionPtrType &Func : Funcs) { container_type Next; for (const D &Fact : Current) { container_type Target = Func.computeTargets(Fact); @@ -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; }; //===----------------------------------------------------------------------===// From 1ccf5008d5eca4376218c7047ce0a9323a40f433 Mon Sep 17 00:00:00 2001 From: Martin Mory Date: Mon, 11 Mar 2024 22:28:45 +0100 Subject: [PATCH 2/4] clang-format include/phasar/DataFlow/IfdsIde/FlowFunctions.h Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- include/phasar/DataFlow/IfdsIde/FlowFunctions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/phasar/DataFlow/IfdsIde/FlowFunctions.h b/include/phasar/DataFlow/IfdsIde/FlowFunctions.h index 46ba13379e..3576c9cee2 100644 --- a/include/phasar/DataFlow/IfdsIde/FlowFunctions.h +++ b/include/phasar/DataFlow/IfdsIde/FlowFunctions.h @@ -905,7 +905,7 @@ class [[deprecated("Use lambdaFlow() instead")]] LambdaFlow public: using typename FlowFunction::container_type; - LambdaFlow(Fn &&F) : Flow(std::move(F)) {} + LambdaFlow(Fn && F) : Flow(std::move(F)) {} LambdaFlow(const Fn &F) : Flow(F) {} ~LambdaFlow() override = default; container_type computeTargets(D Source) override { return Flow(Source); } From 184d296d2aafec106afbd1073b6fd7fcca878e1f Mon Sep 17 00:00:00 2001 From: Martin Mory Date: Tue, 12 Mar 2024 17:57:21 +0100 Subject: [PATCH 3/4] Update include/phasar/DataFlow/IfdsIde/FlowFunctions.h Co-authored-by: Fabian Schiebel <52407375+fabianbs96@users.noreply.github.com> --- include/phasar/DataFlow/IfdsIde/FlowFunctions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/phasar/DataFlow/IfdsIde/FlowFunctions.h b/include/phasar/DataFlow/IfdsIde/FlowFunctions.h index 3576c9cee2..56cc546f05 100644 --- a/include/phasar/DataFlow/IfdsIde/FlowFunctions.h +++ b/include/phasar/DataFlow/IfdsIde/FlowFunctions.h @@ -938,7 +938,7 @@ class [[deprecated]] Compose : public FlowFunction { 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; From 1a7ff6404bd380db660fc43176117954498ba38e Mon Sep 17 00:00:00 2001 From: Martin Mory Date: Tue, 12 Mar 2024 17:57:27 +0100 Subject: [PATCH 4/4] Update include/phasar/DataFlow/IfdsIde/FlowFunctions.h Co-authored-by: Fabian Schiebel <52407375+fabianbs96@users.noreply.github.com> --- include/phasar/DataFlow/IfdsIde/FlowFunctions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/phasar/DataFlow/IfdsIde/FlowFunctions.h b/include/phasar/DataFlow/IfdsIde/FlowFunctions.h index 56cc546f05..b4246db4fb 100644 --- a/include/phasar/DataFlow/IfdsIde/FlowFunctions.h +++ b/include/phasar/DataFlow/IfdsIde/FlowFunctions.h @@ -933,7 +933,7 @@ class [[deprecated]] Compose : public FlowFunction { ~Compose() override = default; - container_type computeTargets(const D &Source) override { + container_type computeTargets(D Source) override { container_type Current{Source}; for (const FlowFunctionPtrType &Func : Funcs) { container_type Next;