Sabastian,<br>You get different result than what I get. I get the debug message of the base class printed but not of the ImplicitCastExpr debug messages.<br>>> "calling the base class clone for the following: ImplicitCastExpr"<br>
  <br>this confirms that it is not the code. it is something else.<br>Can you tell me which reversion you are using for llvm & Clang<br>I am using llvm & Clang reversion 71770. and gcc 4.3.2 20081105 (Red Hat 4.3.2-7)<br>
<br>What do you think the reason for this different output? How can I debug this?<br><br>Thanks,<br>Moataz<br><br><br><div class="gmail_quote">On Sun, May 17, 2009 at 11:22 AM, Sebastian Redl <span dir="ltr"><<a href="mailto:sebastian.redl@getdesigned.at">sebastian.redl@getdesigned.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">moataz ragab wrote:<br>
> Hi Sebastian,<br>
><br>
> Thanks.<br>
><br>
> Attached 3 files: the patch "clone.diff". should be applied on the<br>
> clang directory.<br>
>                          RewriteLoopUnroll.cpp you have to put it in<br>
> the clang-cc directory.<br>
>                          test2.c: simple testcase for a forloop with<br>
> array access in the body.<br>
><br>
><br>
> you can invoke the loopunroller using:<br>
><br>
>  ../../../../Debug/bin/clang-cc -loop-unroll tests/test2.c<br>
><br>
> Currently it crashes because ImplicitCastExpr object doesn't get<br>
> cloned. The Stmt base class gets called instead of ImplicitCastExpr<br>
</div>It calls ImplicitCastExpr::Clone just fine. It crashes because it can't<br>
clone the VarDecl.<br>
<font color="#888888"><br>
Sebastian<br>
</font></blockquote></div><br>