Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Compose FF to have vectors of FlowFunctionPtrType #710

Merged
merged 6 commits into from
Apr 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading