Skip to content

Commit

Permalink
Fix Compose FF to have vectors of FlowFunctionPtrType, which is neces…
Browse files Browse the repository at this point in the history
…sary, since FlowFunctionTy is a virtual interface
  • Loading branch information
Martin Mory committed Mar 11, 2024
1 parent d5bd11d commit 6f97d8f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions include/phasar/DataFlow/IfdsIde/FlowFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ class [[deprecated("Use lambdaFlow() instead")]] LambdaFlow
public:
using typename FlowFunction<D, Container>::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); }
Expand All @@ -929,13 +929,13 @@ class [[deprecated]] Compose : public FlowFunction<D, Container> {

using typename FlowFunction<D, Container>::container_type;

Compose(const std::vector<FlowFunction<D>> &Funcs) : Funcs(Funcs) {}
Compose(const std::vector<FlowFunctionPtrType> &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);
Expand All @@ -947,11 +947,11 @@ class [[deprecated]] Compose : public FlowFunction<D, Container> {
}

static FlowFunctionPtrType
compose(const std::vector<FlowFunctionType> &Funcs) {
std::vector<FlowFunctionType> Vec;
for (const FlowFunctionType &Func : Funcs) {
compose(const std::vector<FlowFunctionPtrType> &Funcs) {
std::vector<FlowFunctionPtrType> Vec;
for (const FlowFunctionPtrType &Func : Funcs) {
if (Func != Identity<D, Container>::getInstance()) {
Vec.insert(Func);
Vec.push_back(Func);
}
}
if (Vec.size() == 1) { // NOLINT(readability-container-size-empty)
Expand All @@ -964,7 +964,7 @@ class [[deprecated]] Compose : public FlowFunction<D, Container> {
}

protected:
const std::vector<FlowFunctionType> Funcs;
const std::vector<FlowFunctionPtrType> Funcs;
};

//===----------------------------------------------------------------------===//
Expand Down

0 comments on commit 6f97d8f

Please sign in to comment.