analyzer
analyzer copied to clipboard
Detect renamed functions and global variables.
This pull requests builds on top of my pull request about detection renamed local variables.
It implements an algorithm, that can detect renamed functions and global variables on an incremental run. The algorithm is non recursive.
The following changes have been made:
- Moved eqF from compareCIL.ml to detectGlobals.ml
- Removed logic that would just compare globals with matching names with my algorithm implemented in detectRenamedFunctions.ml
- compareAST.ml is now fully functional, because it cannot have side effects when two wrong functions are compared. Previous side-effective hacks in compareAST have been moved out and are now applied after it is clear that the functions actually match.
The algorithm works like this (simplified):
- Find functions and global variables with matching names.
- Test these function pairs: 2.1. Foreach function pair detected in 1.: Compare the functions bodies of the functions. 2.2. If a function reports back that it depends on a rename of a global variable/function, those dependecies are checked in the next step. 2.3. Foreach dependency, check if they do not rely on additional dependencies themselves. If this assumption holds for all dependencies, the original function pair from 2.1 is marked as renamed, otherwise it is marked as changed.
- Report back the results to compareCIL and apply the change data correctly.
I added test cases, but they are not verified automatically, meaning they have to be verified manually.
What's the explanation for closing this without merging?
I do not have time to work on this pull request anymore and I do not want to give the impression that I will be able to work on this in the future by keeping this open. However, if someone else wants to finish this PR feel free to reopen it.
Ok, I re-opened it and assigned it to @stilscher, as she likely knows what needs to be done so it can be merged.
@stilscher: What is the plan here? Having PRs go so stale is a bit problematic. We should either merge or abandon this.
If I understand correctly, this is now finished and could be merged after another round of reviews?
Yes, another round of feedback would be great. I think I also still need to make sure that the new incremental cram tests are also automatically executed in the CI. Other than that I think it is mostly cleaned up and ready for review.
I think I also still need to make sure that the new incremental cram tests are also automatically executed in the CI.
That probably needs a step like this in the CI workflows:
- name: Test incremental cram
run: opam exec -- dune runtest tests/incremental
@stilscher should we aim to get this merged before we hit the 11 month anniversary of this PR next Monday?
I thought it would be good to wait for an approval in the reviews before merging.
:tada: