-
Notifications
You must be signed in to change notification settings - Fork 25
WI #2039 Compute cyclic call using transitive closure. #2052
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
Open
mayanje
wants to merge
9
commits into
develop
Choose a base branch
from
2039_Store_cycles_recursive_perform
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5b3c0d6
WI #2039 Compute cyclic call using transitive closure.
mayanje 9bf7eb1
WI #2039 Use PerformTarget class.
mayanje d80af72
WI #2039 Remove old diagnostics
mayanje c5f891a
WI #2039 Change review
mayanje 4b969b9
WI #2039 Change review
mayanje 5ce94ee
WI #2039 Refactor the Perform Call relation.
mayanje 35d0734
WI #2039 Change Review
mayanje 49d4035
WI #2039 Change review
mayanje 99deb05
WI #2039 Change review
mayanje File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
TypeCobol.Analysis.Test/BasicCfgInstrs/CyclicPerformRecursive.cbl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
IDENTIFICATION DIVISION. | ||
PROGRAM-ID. TCOMFL06. | ||
PROCEDURE DIVISION. | ||
main. | ||
perform a | ||
goback | ||
. | ||
a. | ||
perform b | ||
. | ||
b. | ||
perform c | ||
. | ||
c. | ||
perform a | ||
. | ||
END PROGRAM TCOMFL06. |
11 changes: 11 additions & 0 deletions
11
TypeCobol.Analysis.Test/BasicCfgInstrs/CyclicPerformRecursive.diag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- Diagnostics --- | ||
Line 5[12,20] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM a', recursive instruction is ' perform b' at line 9. | ||
Line 5[12,20] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM a', recursive instruction is ' perform c' at line 12. | ||
Line 5[12,20] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM a', recursive instruction is ' perform a' at line 15. | ||
Line 6[12,17] <37, Warning, General> - Warning: Unreachable code detected | ||
Line 9[12,20] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM b', recursive instruction is ' perform c' at line 12. | ||
Line 9[12,20] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM b', recursive instruction is ' perform a' at line 15. | ||
Line 9[12,20] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM b', recursive instruction is ' perform b' at line 9. | ||
Line 12[12,20] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM c', recursive instruction is ' perform a' at line 15. | ||
Line 12[12,20] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM c', recursive instruction is ' perform b' at line 9. | ||
Line 12[12,20] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM c', recursive instruction is ' perform c' at line 12. |
51 changes: 51 additions & 0 deletions
51
TypeCobol.Analysis.Test/BasicCfgInstrs/CyclicPerformRecursive.dot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
digraph Cfg { | ||
compound=true; | ||
node [ | ||
shape = "record" | ||
] | ||
|
||
edge [ | ||
arrowtail = "empty" | ||
] | ||
Block0 [ | ||
label = "{START|}" | ||
] | ||
Block1 [ | ||
label = "{MAIN. Block1|}" | ||
] | ||
Block2 [ | ||
label = "{Block2| perform a\l}" | ||
] | ||
Block14 [ | ||
label = "{A. Block14|}" | ||
] | ||
Block15 [ | ||
label = "{Block15| perform b\l}" | ||
] | ||
Block25 [ | ||
label = "{B. Block25|}" | ||
] | ||
Block18 [ | ||
label = "{Block18| perform c\l}" | ||
] | ||
Block27 [ | ||
label = "{C. Block27|}" | ||
] | ||
Block21 [ | ||
label = "{Block21| perform a\l}" | ||
] | ||
Block29 [ | ||
label = "{A. Block29|}" | ||
] | ||
Block0 -> Block1 | ||
Block1 -> Block2 | ||
Block2 -> Block14 | ||
Block14 -> Block15 | ||
Block15 -> Block25 | ||
Block25 -> Block18 | ||
Block18 -> Block27 | ||
Block27 -> Block21 | ||
Block21 -> Block29 | ||
Block29 -> Block15 | ||
|
||
} |
13 changes: 12 additions & 1 deletion
13
TypeCobol.Analysis.Test/BasicCfgInstrs/ExtendedPerformProc3Recursive0.diag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
--- Diagnostics --- | ||
Line 28[15,29] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec2'. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec2' at line 16. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec3' at line 20. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec' at line 28. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec2' at line 39. | ||
Line 16[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec' at line 28. | ||
Line 16[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec2' at line 16. | ||
Line 16[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec3' at line 20. | ||
Line 16[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec2' at line 39. | ||
Line 20[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec2' at line 39. | ||
Line 20[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec' at line 28. | ||
Line 20[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec2' at line 16. | ||
Line 20[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec3' at line 20. | ||
Line 29[15,57] <37, Warning, General> - Warning: Unreachable code detected |
31 changes: 28 additions & 3 deletions
31
TypeCobol.Analysis.Test/BasicCfgInstrs/ExtendedPerformProc4Recursive0.diag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,30 @@ | ||
--- Diagnostics --- | ||
Line 31[15,29] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec2'. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec2' at line 17. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec3' at line 21. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec4' at line 23. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec' at line 31. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec2' at line 42. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec3 test after varying n from 1 by 1 until n' at line 53. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec4 varying n from 1 by 1 until n > 5' at line 57. | ||
Line 9[12,27] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec4', recursive instruction is ' perform pararec3 test after varying n from 1 by 1 until n' at line 53. | ||
Line 9[12,27] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec4', recursive instruction is ' perform pararec4 varying n from 1 by 1 until n > 5' at line 57. | ||
Line 9[12,27] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec4', recursive instruction is ' perform pararec2' at line 42. | ||
Line 9[12,27] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec4', recursive instruction is ' perform pararec' at line 31. | ||
Line 9[12,27] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec4', recursive instruction is ' perform pararec2' at line 17. | ||
Line 9[12,27] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec4', recursive instruction is ' perform pararec3' at line 21. | ||
Line 9[12,27] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec4', recursive instruction is ' perform pararec4' at line 23. | ||
Line 17[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec' at line 31. | ||
Line 17[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec2' at line 17. | ||
Line 17[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec3' at line 21. | ||
Line 17[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec4' at line 23. | ||
Line 17[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec2' at line 42. | ||
Line 17[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec3 test after varying n from 1 by 1 until n' at line 53. | ||
Line 17[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec4 varying n from 1 by 1 until n > 5' at line 57. | ||
Line 21[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec2' at line 42. | ||
Line 21[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec' at line 31. | ||
Line 21[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec2' at line 17. | ||
Line 21[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec3' at line 21. | ||
Line 21[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec4' at line 23. | ||
Line 21[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec3 test after varying n from 1 by 1 until n' at line 53. | ||
Line 21[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec4 varying n from 1 by 1 until n > 5' at line 57. | ||
Line 32[15,57] <37, Warning, General> - Warning: Unreachable code detected | ||
Line 57[15,64] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec4', recursive instruction is ' perform pararec4 varying n from 1 by 1 until n > 5'. | ||
Line 57[15,64] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec4', recursive instruction is ' perform pararec3 test after varying n from 1 by 1 until n'. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- Diagnostics --- | ||
Line 6[12,23] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM main', recursive instruction is ' PERFORM main'. | ||
Line 6[12,23] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM main', recursive instruction is ' PERFORM main' at line 6. |
2 changes: 1 addition & 1 deletion
2
TypeCobol.Analysis.Test/BasicCfgInstrs/PerformProc1Recursive0.diag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- Diagnostics --- | ||
Line 16[15,29] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec'. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec' at line 16. |
5 changes: 4 additions & 1 deletion
5
TypeCobol.Analysis.Test/BasicCfgInstrs/PerformProc2Recursive0.diag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
--- Diagnostics --- | ||
Line 27[15,29] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec2'. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec2' at line 16. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec' at line 27. | ||
Line 16[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec' at line 27. | ||
Line 16[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec2' at line 16. |
13 changes: 12 additions & 1 deletion
13
TypeCobol.Analysis.Test/BasicCfgInstrs/PerformProc3Recursive0.diag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
--- Diagnostics --- | ||
Line 28[15,29] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec2'. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec2' at line 16. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec3' at line 20. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec' at line 28. | ||
Line 8[12,26] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec', recursive instruction is ' perform pararec2' at line 39. | ||
Line 16[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec' at line 28. | ||
Line 16[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec2' at line 16. | ||
Line 16[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec3' at line 20. | ||
Line 16[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec2', recursive instruction is ' perform pararec2' at line 39. | ||
Line 20[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec2' at line 39. | ||
Line 20[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec' at line 28. | ||
Line 20[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec2' at line 16. | ||
Line 20[15,30] <37, Warning, General> - Warning: A recursive loop has been encountered while analyzing 'PERFORM pararec3', recursive instruction is ' perform pararec3' at line 20. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't possible to report the full perform chain ?
Like
perform a, Line 5 > perform b, Line 9 > perform c, Line 12 > perform a, Line 15
?With the current diagnostics, the Cobol developer have to manualy group error message together to understand what the cycle is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact this the current way of reporting, but the Perform Call Chain contains all information to do that.