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

Optimiser logic addition. Functions elimination #64

Open
NickSettler opened this issue Nov 21, 2022 · 0 comments
Open

Optimiser logic addition. Functions elimination #64

NickSettler opened this issue Nov 21, 2022 · 0 comments
Assignees
Labels
feature New feature or request optimiser Changes in optimiser code

Comments

@NickSettler
Copy link
Owner

Code optimiser must be able to remove unused functions declaration. Function is unused when it is not used anywhere in the code except its own scope. For example, the fib function can be removed from the example below. It is used in its own block of code, but it is not used anywhere else in the code, so it is unused.

function fib(int $x): int {
  if (x == 1 || x == 0) {
      return(x);
   } else {
      return fib(x - 1) + fib(x - 2);
   }
}

$a = 2;
write($a);
@NickSettler NickSettler added feature New feature or request optimiser Changes in optimiser code labels Nov 21, 2022
@NickSettler NickSettler added this to VUT Nov 21, 2022
@NickSettler NickSettler moved this to Todo in VUT Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request optimiser Changes in optimiser code
Projects
Status: Todo
Development

No branches or pull requests

2 participants