<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV></DIV><BR>在2008-04-29,"Chris Lattner" <clattner@apple.com> 写道:<BR>
<BLOCKQUOTE id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><PRE>On Apr 28, 2008, at 10:39 PM, caiwei wrote:
> Hi all,
> I am new to the list and have been lurking a few days. I am interested
> in clang mainly as a possible tool for optimization.If there are any  
> suggestions
> for small tasks (TODOs) that may give me  a good introduction to
> developing for clang, that would be nice.how can I modify the AST  
> for my project?
>
> for example,After changing the AST code of Clang, the clang compiler  
> optimize  x *2 to x << 2.
> and how to use of the clang AST interface ?

>What sort of optimization are you trying to do?  Are you working with  
>native code generation, or trying to do a source to source optimizer?

>If you are focused on native code generation, it is much better to  
>implement optimizations in the llvm optimizer and/or backend.  If you  
>are interested in source to source transformations (e.g. outputting a  
>modified C file), you can use the AST interfaces and rewriter to do  
>this.  Take a look at the ObjC Rewriter for examples.  If you have a  
>specific question, I'd be happy to try to help.

>-Chris</PRE><PRE>Thanks Chris,</PRE><PRE>I need to do AST transformations about inerting nodes and setting existing ones,thus getting optimum code(source to modified source code).</PRE><PRE>cai<EM> </EM></PRE><PRE> </PRE><PRE> </PRE></BLOCKQUOTE><br><!-- footer --><br> 
<hr>
<font style="font-size:12px;line-height:15px;">送!送!送!</font><a style="font-size:12px;line-height:15px; color:blue; text-decoration:underline;" href="http://popme.163.com/link/004290_0422_5595.html">瑞星2008正版半年免费!</a>