<div dir="ltr"><div><div>And how does the parser know from the preprocessed output that it is CL rather than C that it's parsing? I suspect it's the ".cl" part of the name of "<a href="http://filename.cl">filename.cl</a>" that determines that it's CL code in the first place, if that gets replaced with "filename.i", the parser will just say "Ah, it's C-code and has already been preprocessed".<br><br></div>Maybe the parser needs a `-x cl` or similar to ensure that the parser knows it's CL-code?<br><br></div><div>I know that many of the CL parsing things have `if (langOpts.OpenCL) ...` in the parser and various other places. If we have a multi-pass way of running the compiler, it will potentially lose that information when it gets to the next step, is my thinking. I may of course be wrong, and the problem is with something else.<br></div><div><br>--<br></div>Mats<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 6 November 2016 at 11:04, Joerg Sonnenberger 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"><span class="">On Sun, Nov 06, 2016 at 10:01:05AM +0000, mats petersson via cfe-dev wrote:<br>
> My guess, and it's only a guess, is that -save-temps causes the compiler to<br>
> run each step on those files, by executing independent processes, rather<br>
> than the usual "run all steps in parallel" - in my understanding, Clang<br>
> doesn't actually work in the "old style cc way" and running several<br>
> processes with files produced between each step.<br>
<br>
</span>Yes and no. -svae-temps will run the parser on the preprocessed output,<br>
so all macro-expansion knowledge is missing. That changes the impact of<br>
a number of warnings like redundant braces. Pragmas are still preserved<br>
in the code though. It would be a bug in the OpenCL integration if the<br>
pragmas are no longer processed OR if pragmas are silently attached to<br>
macros by position.<br>
<br>
Joerg<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<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/<wbr>mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>