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

Detect renamed functions and global variables. #774

Merged
merged 102 commits into from
May 31, 2023
Merged
Changes from 1 commit
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
4256428
Added basic test cases for changed variable names.
TimOrtel Mar 17, 2022
27dd10f
Rename detection works for simple cases
TimOrtel Mar 18, 2022
6bc0fca
Rename detection for method parameters, too
TimOrtel Apr 3, 2022
ca6670b
Renaming of method params should work now.
TimOrtel Apr 5, 2022
c1e165c
Renaming of results does work for the log files.
TimOrtel Apr 18, 2022
d589278
Added multiple incremental runs test
TimOrtel Apr 19, 2022
9eb3f87
Renamed local vars are now also shown in g2html.
TimOrtel Apr 20, 2022
d652715
Added incremental aware print statements and replaced traditional pri…
TimOrtel May 3, 2022
08da3fb
Renamed variable names are now displayed with their new name in g2html
TimOrtel May 4, 2022
3a11fb9
Cleanup print statements and added some docu.
TimOrtel May 9, 2022
26d0702
Merge remote-tracking branch 'upstream/master' into dev-local-var-rename
TimOrtel May 9, 2022
b7fac89
Renamed context to rename_mapping
TimOrtel May 9, 2022
abf871b
Replaced rename mapping lists with Hashtbls for increased performance
TimOrtel May 9, 2022
4745a3f
cleanup print statements and code.
TimOrtel May 14, 2022
7d702f7
Merge upstream master
TimOrtel May 14, 2022
c645c68
cherry picked context -> rename mapping
TimOrtel May 14, 2022
aed7a3a
Replaced rename mapping lists with Hashtbls for increased performance
TimOrtel May 9, 2022
9e95ddb
Old locals are now renamed to the new local names.
TimOrtel May 14, 2022
7e89ec2
Fixed duplicate id tests
TimOrtel May 16, 2022
e4df2ca
Added some test cases
TimOrtel May 16, 2022
2c86411
Added first functions for rename detection.
TimOrtel May 17, 2022
182db42
Replaced Hashtbl in compare functions with Map
TimOrtel May 17, 2022
11de365
CompareAST functions now propagate updated rename_mappings in their r…
TimOrtel May 17, 2022
d900e7e
eqF now returns the method rename dependencies
TimOrtel May 17, 2022
49caf8c
Implemented rename detection of method. Not tested.
TimOrtel May 18, 2022
abef116
Removed obsolete method and smaller changes
TimOrtel May 25, 2022
b9ad6db
Implemented simple rename detection for methods
TimOrtel May 25, 2022
1855a5a
Added more docu
TimOrtel May 25, 2022
c71e29c
Added more test cases for method rename
TimOrtel May 25, 2022
874519c
Added json and patch files for method rename tests.
TimOrtel Jun 6, 2022
b75a19f
Global var renames are now also detected in compareAST
TimOrtel Jun 6, 2022
9e80fc1
Cleaned up and improved detectRenamedFunctions.
TimOrtel Jun 7, 2022
fae1e5e
Moved multiple incremental run tests to subdirectory.
TimOrtel Jun 8, 2022
0c6b9c4
Moved multiple incremental run tests to subdirectory.
TimOrtel Jun 8, 2022
d5979f1
Merge Branch Without Rename Mapping
TimOrtel Jun 10, 2022
37e5703
Merged upstream master
TimOrtel Jun 10, 2022
a9a2e65
Now also uses VarinfoMap for method rename assumptions
TimOrtel Jun 14, 2022
ed605ff
Now uses varinfo#vGlob to check if a variable is global
TimOrtel Jun 14, 2022
3b60fb7
Removed unused currentFunctionName global state.
TimOrtel Jun 15, 2022
e9494eb
Removed useless global state cherry pick
TimOrtel Jun 15, 2022
1eae9c3
Removed nothing test case
TimOrtel Jun 15, 2022
1921299
Fixed analysis.ml
TimOrtel Jun 15, 2022
fd691c5
Removed nothing test case
TimOrtel Jun 15, 2022
686a3da
Added include assert to tests. Removed useless test.c
TimOrtel Jun 15, 2022
0a0ee34
Replaced tupletostring with fancy syntax.
TimOrtel Jun 15, 2022
8b28e89
Hashtbl.add is now replaced by Hashtbl.replace in many places.
TimOrtel Jun 15, 2022
77bd926
List optimization.
TimOrtel Jun 15, 2022
938fcb0
Removed compinfo and enum rename hack from compareAST and replaced it…
TimOrtel Jun 17, 2022
2cf1a03
Merge remote-tracking branch 'refs/remotes/origin/dev-method-rename-s…
TimOrtel Jun 17, 2022
7371dc9
method_rename_assumptions now uses varinfo map instead of string hash…
TimOrtel Jun 20, 2022
7b320c9
Removed RenameMapping.
TimOrtel Jun 20, 2022
18938a3
Fixed crash in forward_list_equal on lists with altering list lengths.
TimOrtel Jun 21, 2022
40281fe
Added documentation to tests in 04-var-rename
TimOrtel Jun 21, 2022
60468d4
Add comment to test-incremental-multiple.sh
TimOrtel Jun 15, 2022
9c8e226
Merge remote-tracking branch 'upstream/master' into dev-local-var-rename
TimOrtel Jun 22, 2022
a9d297c
Removed syntactic noise introduced by addition and removal of RenameM…
TimOrtel Jun 22, 2022
31283c9
Removed diffs directory in tests/incremental/04-var-rename
TimOrtel Jun 22, 2022
f04651b
Removed diffs directory in tests/incremental/04-var-rename
TimOrtel Jun 22, 2022
4d8098e
Add comment to test-incremental-multiple.sh
TimOrtel Jun 15, 2022
4535039
Added documentation to tests in 04-var-rename
TimOrtel Jun 21, 2022
55133d2
Replaced printf with tracing in compareCIL
TimOrtel Jun 22, 2022
51590ee
Removed parameter renames and instead disabled the name checking for …
TimOrtel Jul 1, 2022
c2a807e
Merged upstream/master
TimOrtel Jul 4, 2022
b3487ba
Merge remote-tracking branch 'upstream/master' into dev-local-var-rename
TimOrtel Jul 4, 2022
c4f6d66
Merged with dev-local-var-rename
TimOrtel Jul 4, 2022
1caaa79
Removed diffs.
TimOrtel Jul 4, 2022
b9785ab
Applied changes requested in PR #731. compareCFG now propagates renam…
TimOrtel Jul 12, 2022
1f7b7bb
detecting renames can now be disabled using the option incremental.de…
TimOrtel Jul 12, 2022
ad0103f
merge upstream/master
TimOrtel Jul 12, 2022
ae506cb
Added test script. function rename detection now supports renamed rec…
TimOrtel Jul 13, 2022
f8dba3e
Added doc on how to support library headers.
TimOrtel Jul 16, 2022
d9a7c93
Fixed a couple of bugs
TimOrtel Jul 26, 2022
abe372b
Merge branch 'master' into dev-method-rename-simple-impl
stilscher Mar 6, 2023
fa9747b
remove GlobalElemMap
stilscher Mar 6, 2023
8884a9b
fix merge mistake
stilscher Mar 7, 2023
ef2a721
cleanup compareCilFiles
stilscher Mar 7, 2023
68ed7e0
remove redundant global in output map
stilscher Mar 7, 2023
b959c3c
fix updating of compinfo names and ckeys for comparison without renam…
stilscher Mar 7, 2023
abdfe66
remove extra output type and avoid another mapping between types
stilscher Mar 7, 2023
c0aaa81
cleanup eqF: same handling for cfg and ast comparison
stilscher Mar 7, 2023
55da723
make detection of renamed globals more concise
stilscher Mar 8, 2023
009f457
refactor
stilscher Mar 8, 2023
5d90ad0
fixes in rename detection
stilscher Mar 13, 2023
f736366
add cram tests for rename detection
stilscher Mar 13, 2023
5e1963f
remove superflous tests and those without clear expected result
stilscher Mar 13, 2023
b90d0bc
fix patches
stilscher Mar 13, 2023
7c365ba
re-establish consecutive test ids
stilscher Mar 13, 2023
4bb775a
move rename detection and CompareGlobals back to CompareCIL
stilscher Mar 13, 2023
2620cfc
remove debugging functions
stilscher Mar 13, 2023
442b6d9
merge comparison with and without rename detection
stilscher Mar 13, 2023
6ba71fc
make semgrep happy
stilscher Mar 13, 2023
aeaf301
add incremental cram tests to CI
stilscher Mar 23, 2023
033555a
refine implementation based on review comments
stilscher Mar 23, 2023
e293a7f
missing propagation of change_info and final_matches
stilscher Mar 23, 2023
e8ce672
remove test script because of restricted parser and few working cases
stilscher Mar 23, 2023
af79fb2
no structural comparison when looking through collected final_matches
stilscher Mar 23, 2023
7d68cf2
fix check whether already matched as unchanged
stilscher Mar 23, 2023
79873fe
fix: already matched check needs to consider change_info
stilscher Mar 23, 2023
06502b5
remove polymorphic comparison of global_col
stilscher Apr 17, 2023
61d15d1
fix new and old global mix-up
stilscher May 2, 2023
72065a5
handle functions without definitions in exact comparison
stilscher May 3, 2023
2a8bce5
Merge branch 'master' into dev-method-rename-simple-impl
stilscher May 16, 2023
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
Next Next commit
Added basic test cases for changed variable names.
TimOrtel committed Mar 17, 2022
commit 42564280244a7de4b69f16f4de0796faf12784ef
4 changes: 4 additions & 0 deletions tests/incremental/04-var-rename/00-unused_rename.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int main() {
int a = 0;
return 0;
}
3 changes: 3 additions & 0 deletions tests/incremental/04-var-rename/00-unused_rename.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{

}
8 changes: 8 additions & 0 deletions tests/incremental/04-var-rename/00-unused_rename.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--- tests/incremental/04-var-rename/00-unused_rename.c
+++ tests/incremental/04-var-rename/00-unused_rename.c
@@ -1,4 +1,4 @@
int main() {
- int a = 0;
+ int b = 0;
return 0;
}
4 changes: 4 additions & 0 deletions tests/incremental/04-var-rename/01-nothing.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int main() {
int x = 0;
return 0;
}
3 changes: 3 additions & 0 deletions tests/incremental/04-var-rename/01-nothing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{

}
8 changes: 8 additions & 0 deletions tests/incremental/04-var-rename/01-nothing.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--- tests/incremental/04-var-rename/01-nothing.c
+++ tests/incremental/04-var-rename/01-nothing.c
@@ -1,4 +1,5 @@
int main() {
int x = 0;
+
return 0;
}
4 changes: 4 additions & 0 deletions tests/incremental/04-var-rename/diffs/00-unused_rename.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int main() {
int b = 0;
return 0;
}
5 changes: 5 additions & 0 deletions tests/incremental/04-var-rename/diffs/01-nothing.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
int main() {
int x = 0;

return 0;
}