Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318172 - Control Flow Graph - CQ 4295 (approved)
Summary: Control Flow Graph - CQ 4295 (approved)
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Photran.Refactoring Engine (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 7.0   Edit
Assignee: Jeffrey Overbey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-28 08:43 EDT by Matthew Fotzler CLA
Modified: 2010-07-14 17:40 EDT (History)
1 user (show)

See Also:


Attachments
control flow graph patch (71.37 KB, patch)
2010-06-28 08:44 EDT, Matthew Fotzler CLA
com-eclipse-dot-org: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Fotzler CLA 2010-06-28 08:43:24 EDT
Build Identifier: 

The attached patch provides support for a control flow graph through the VPG.

Note: The select case, if, do, and where constructs are not structured correctly in the AST.  For this patch, If/where should work correctly, but select case/old style do loops should not.

Reproducible: Always
Comment 1 Matthew Fotzler CLA 2010-06-28 08:44:10 EDT
Created attachment 172898 [details]
control flow graph patch
Comment 2 Jeffrey Overbey CLA 2010-06-28 10:39:20 EDT
Thanks.  Can you please confirm that

1. you wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of others,

2. you have the right to contribute the code to Eclipse, and

3. you have included the EPL license header in all source files?
Comment 3 Matthew Fotzler CLA 2010-06-28 10:59:41 EDT
Yes, I confirm that I wrote 100% of the code without incorporating content from elsewhere or
relying on the intellectual property of others, I have the right to contribute the code to Eclipse, and I have included the EPL license header in all source files.
Comment 4 Jeffrey Overbey CLA 2010-06-28 11:03:40 EDT
This is significantly more than 250 LOC, so I will need to file a CQ.
Comment 5 Jeffrey Overbey CLA 2010-06-28 11:36:14 EDT
Filed CQ 4295 - https://dev.eclipse.org/ipzilla/show_bug.cgi?id=4295
Comment 6 Matthew Fotzler CLA 2010-06-29 09:05:19 EDT
It might be good to have a class comment for the CFG code for anyone trying to understand it later.

"This implementation performs two passes over the AST.  The first pass collects all labels, assigned labels, and loops mapped to the exit statement nodes contained in their body.  This data is necessary for constructs which behave similarly to a GOTO.  The second pass builds the Control Flow Graph."
Comment 7 Jeffrey Overbey CLA 2010-07-02 01:15:10 EDT
I noticed a small problem with the handling of if constructs: It works correctly when there is an else clause, but when there isn't an else clause, there should also be an edge from the if-then statement to the statement following the if construct.  (This will be easy to fix after I fix the AST.)
Comment 8 Jeffrey Overbey CLA 2010-07-09 12:07:21 EDT
The CQ was approved subject to the following:

"I note the contributor's name is not contained in the copyright and license
header. I realize the author tag is contained further down in the code. 
However, ideally the Initial Author's name should be contained in the
Contributor Section as follows:

+ * Contributors:
+ *    Matthew Fotzler, UIUC - Initial API and implementation

If you could make that change prior to checkin would be appreciated."
Comment 9 Jeffrey Overbey CLA 2010-07-14 17:40:45 EDT
Committed to CVS.  Limitations noted in JavaDoc.