Community
Participate
Working Groups
Created attachment 154722 [details] Data To Parameter source code. Refactoring to transform variables declared as data in variables declared with parameter attribute, when these are intended to be constants in source code. Often, developers who want to use constants can confuse the data statement with the attribute parameter, which is the most suitable in these cases. Making the substitution can generate performance gains, because it decreases the access to variables.
Hi Gustavo, Thanks for the contribution. 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? (Please reply with a comment on this bug; you can just say, "I confirm that I wrote 100%..." and repeat these points. This is for our intellectual property review. For #1, if some of your code is borrowed from or based on someone else's code, please state that explicitly.) Thanks. Jeff
Created attachment 154730 [details] Data To Parameter source code (with EPL license header). Refactoring to transform variables declared as data in variables declared with parameter attribute, when these are intended to be constants in source code. Often, developers who want to use constants can confuse the data statement with the attribute parameter, which is the most suitable in these cases. Making the substitution can generate performance gains, because it decreases the access to variables.
(In reply to comment #1) I confirm that I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of others, and I have the right to contribute the code to Eclipse, and I have included the EPL license header in all source files. > Hi Gustavo, > > Thanks for the contribution. 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? > > (Please reply with a comment on this bug; you can just say, "I confirm that I > wrote 100%..." and repeat these points. This is for our intellectual property > review. For #1, if some of your code is borrowed from or based on someone > else's code, please state that explicitly.) > > Thanks. > Jeff
Created attachment 154735 [details] Data To Parameter source code (with correct EPL license header).
Since the contribution is fewer than 250 LOC, we will not need to go through the full IP review process for this refactoring. (Attachment is 238 LOC.)
Gustavo, Could you please add a description of this refactoring to Section 4 of the Photran 6.0 Advanced Features manual, so our users will know how to use it and what they should expect it to do? http://wiki.eclipse.org/PTP/photran/documentation/photran6advanced You can look at the descriptions of some other refactorings for examples. Thanks in advance! I will review your code and check it into CVS as soon as possible. Jeff
This refactoring has been committed to CVS, and Tim wrote some unit tests. I still need to review the code and documentation before closing this bug...
I did some heavier refactoring on this one. Nothing substantive -- the logic/AST manipulations are the same -- but I factored out some of the code into two method objects to make the field purposes/lifetimes clearer and broke it into smaller methods. Gustavo, please run a couple of tests on this to make sure I didn't break anything accidentally. I tried to not change the string and AST manipulations at all, but I might have missed something. Thanks. Still need to do doc review...
Done. Thanks again for all your work, Gustavo! We really appreciate the contribution!