Dear Ted<div><br></div><div>   I added two control flow analysis algorithms: One builds the dominance tree for CFG. The other one finds all SCC components within the CFG. Attached is the patch. I integrated these algorithms within the CFG and CFGBlock classes. This is the first time I submit something, so I have some questions:</div>
<div><br></div><div>1 While I would really love to contribute, I am not sure if the code quality is enough. Please let me know any problems with the code so I shall fix them.</div><div>2 These algorithms shall work on any CFG. I am not sure what kind of special test cases should be added. I do wrote an example (in tools/clang/examples) to illustrate how to use these two algorithms. Is it necessary to submit the example into the examples/ directory?</div>
<div>3 I tried my best to follow the code standards and comments. Also, in the comments, I listed the key reference papers which described thorough details of these algorithms. They are the state of the art algorithms as far as I know, and very efficient, although I am not sure my implementation is good or not.</div>
<div><br></div><div>I am looking forward to feedback. I shall fix problems until it meets the quality for actual commit.</div><div>Thanks.</div><div><br></div><div>------------</div><div>Guoping<br><br><div class="gmail_quote">
2011/10/3 Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com">kremenek@apple.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Guoping,<br>

<br>
Additions to libAnalysis have largely been demand-driven.  I think we are fine with general contributions to this library that meeting the following criteria:<br>
<br>
(1) Meet the Clang coding conventions and quality expectations.<br>
<br>
(2) Are testable ("make test"), and tests are included in clang/test.<br>
<br>
(3) Performance is acceptable and measurable, or at least documented when algorithms are known to be expensive.<br>
<br>
(4) APIs are well-documented, which can come in the form of good doxygen comments.<br>
<br>
Source-to-source transformations are welcome, and the Clang codebase does contains tools that are source-to-source rewriters.  For example, libRewrite provides low-level functionality for doing textual rewrites of source files using Clang SourceLocations.  Other analysis algorithms are useful as well; we just prefer that they can be regression tested, and the APIs are well-documented (especially if they don't have any real clients in the codebase at present).<br>

<br>
Cheers,<br>
<font color="#888888">Ted<br>
</font><div><div></div><div class="h5"><br>
On Oct 3, 2011, at 2:40 PM, Guoping Long wrote:<br>
<br>
> Hi,<br>
><br>
>    There are some program analysis algorithms in clang/lib/Analysis directory. I am wandering if there are more algorithms to come or not. Are there some people working on this? What kind of algorithms are welcome to be part of Clang?<br>

><br>
>    I am asking this because I want to help on this part. But I am not sure if source-to-source transformation algorithms are welcome in this community, since many optimization work is done in the LLVM backend. Currently I have implemented to CFG analysis algorithms (building the dominance tree and finding the strong connected components in CFG). I plan to implement more data flow analysis or even pointer analysis algorithms. If these algorithms are useful to people in this community, I would love to submit a patch.<br>

><br>
>   I am new to Clang and this community. Hopefully these questions are not naive to you.<br>
><br>
>   Thanks.<br>
> --------<br>
> Guoping<br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
</div></div></blockquote></div><br></div>