[cfe-dev] Using clang for c code control flow manipulations

mats petersson via cfe-dev cfe-dev at lists.llvm.org
Mon Mar 20 07:27:58 PDT 2017


With this sort of thing, "the devil is in the detail". Yes, clang has tools
to do things to source-code, and there are other tools to do things with
the intermediate form in llvm.

But without fully understanding more in detail what changes you are wanting
to do, and how those are meant to interact with the overall source code,
it's hard to say exactly what is the best approach.

(I'm far from sure I can give any appropriate advice, but I know enough
about the subject to know that there can be difficulties, and the exact
details is what makes the difference between "approach A is good",
"approach B" is good and "it's impossible no matter what".)

--
Mats

On 19 March 2017 at 13:07, Rachel HaCohen (rahacohe) via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hello all,
>
> In a project we’re working on, we wish to build a tool that automatically
> manipulates c code.
>
> We wish to be able to track the control flow of the program and
> manipulate it (flattening, adding blocks of code etc.).
>
> We want the tool to be very general and automatic and be able to work
> properly for every c file and generate compilable code.
>
>
>
> Do you think this is achievable using clang? Do you have any tips for
> implementing this tool?
>
> Many thanks,
>
> Rachel.
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170320/0e3e24e0/attachment.html>


More information about the cfe-dev mailing list