Skip to content

Commit

Permalink
Fix Compose FF to have vectors of FlowFunctionPtrType (#710)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Update include/phasar/DataFlow/IfdsIde/FlowFunctions.h

Co-authored-by: Fabian Schiebel <[email protected]>

---------

Co-authored-by: Martin Mory <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Fabian Schiebel <[email protected]>
  • Loading branch information
4 people authored Apr 7, 2024
1 parent 5c037c2 commit e02d90c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions include/phasar/DataFlow/IfdsIde/FlowFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -929,16 +929,16 @@ 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 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;
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 e02d90c

Please sign in to comment.