<div dir="ltr">Look at OpenMP and CapturedStmt:<div><a href="http://clang.llvm.org/doxygen/classclang_1_1CapturedStmt.html#details">http://clang.llvm.org/doxygen/classclang_1_1CapturedStmt.html#details</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 9, 2016 at 2:13 AM, David Kretzmer via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm currently trying to build a clang tool that extracts a Stmt into a new function. For this I need a<br>
way to get all variables that are read from/written to but not declared inside the statement. These<br>
variables would then become the functions arguments/return value.<br>
<br>
llvm::CodeExtractor seems to do this on a lower level. Is there a clang equivalent that works on the<br>
clang AST so it can be used for source-to-source transformation? I could just manually traverse the<br>
AST and check for any reads/writes to variables not declared in the statement, but I got the feeling<br>
that I would probably overlook lots of legitimate cases.<br>
<br>
Thanks in advance!<br>
David<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>