<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 16, 2014 at 3:05 AM, Robert Ankeney <span dir="ltr"><<a href="mailto:rrankene@gmail.com" target="_blank">rrankene@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Ping -<br>
<br>
A bit more information about the following - Since preprocessor<br>
arguments passed can affect what the preprocessor does, is there a way<br>
to get these arguments to DoPrintPreprocessedInput()? For example<br>
optimization or the -fno-inline flag affect whether or not<br>
__NO_INLINE__ is defined.</blockquote><div><br></div><div>We could handle this in the driver by adding -D__NO_INLINE__ I suppose.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Also I see no way to pass something like the<br>
-ftraditional_cpp flag which affects whitespace handling.<br></blockquote><div><br></div><div>$ clang --help | grep tradi</div><div>  -traditional-cpp        Enable some traditional CPP emulation</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

I am using the DoPrintPreprocessedInput() function to preprocess some<br>
source code, and see a difference from using clang -E -P to do the<br>
same preprocessing. Using a simple test file:<br>
#include <stdio.h><br>
#include <stdlib.h><br>
<br>
The difference I see is that the predefined macro __NO_INLINE__ is not<br>
set when calling DoPrintPreprocessedInput. Is there a way to do this<br>
other than by calling addMacroDef? Setting UsePredefines to 1 in<br>
PreprocessorOptions didn't seem to help. Are there other predefines I<br>
should be concerned with?<br>
<br>
Another thing I noticed is the slow speed of preprocessing the above<br>
with clang on a Window7 x64 box with MinGW:<br>
<br>
real    0m3.249s<br>
user    0m0.016s<br>
sys     0m0.046s<br>
<br>
versus gcc:<br>
<br>
real    0m0.109s<br>
user    0m0.015s<br>
sys     0m0.000s<br>
<br>
This is with clang version 3.3 (trunk 176785).<br></blockquote><div><br></div><div>With clang TOT built by MSVC with optimizations and assertions I get:</div><div><div><br></div><div>$ time clang -E t.cpp -P > t</div>
<div>real    0m0.226s</div><div>user    0m0.000s</div><div>sys     0m0.077s</div></div><div><br></div><div>Did you compile with optimizations?  Clang, being C++-y, relies pretty heavily on compiler optimizations in order to get reasonable performance.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Thanks,<br>
Robert Ankeney<br>
_______________________________________________<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>
</blockquote></div><br></div></div>