[cfe-dev] a question about source to source transformation

David Blaikie dblaikie at gmail.com
Wed Nov 13 08:38:38 PST 2013


One example you might want to look at is the clang-modernize tool which is
designed to do project-wide refactoring.


On Wed, Nov 13, 2013 at 1:58 AM, Rambo <hunanlwm at sina.cn> wrote:

> Hi everyone,
> Now I am troubled in source to source transformation.please see a example:
> file name:  a.c                                              b.c
>                 #include"b.c"                               ..........
>                   .......                                         sum2[i];
>                   sum1[i];                                    ........
>                   .......
> Now I want to transform them as followed:
> a.c                                              b.c
> #include"b.c"                               ..........
> .........                                         sum2[i,j];
> sum1[i,j];                                    ..........
> ........
> The general method is transform them one by one,but if the count of files
> is
> not just two,there are many many files need to transformed,like organized
> by
> makefile.the general method is infeasible.
> Of course,there are some approaches to deal with it.
> One approach is that we transform them by the trace of include,as long as
> we
> meet a #include"**.*",we suspend the current transformation and jump to the
> include for transforming.This method is feasible but also have many
> disadvantages such as the same variables.
> Another approach is to merge relate files to a single file,and if relate
> files is too much,the final file would be very large.other questions also
> need to solved.
> I believe the all two methods are difficult to implement.What do you think?
> any body have a good Implementation scheme or other approaches?Thank you
> very much!
>
> Rambo
>
>
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/a-question-about-source-to-source-transformation-tp4036002.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131113/747edf70/attachment.html>


More information about the cfe-dev mailing list