<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in pchfile.cpp</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>2ca4be97 - clang-cl: Implement initial limited support for precompiled headers.</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/clang/test/Driver/Inputs/pchfile.cpp#2ca4be97</link>
        <description>clang-cl: Implement initial limited support for precompiled headers.In the gcc precompiled header model, one explicitly runs clang with `-xc++-header` on a .h file to produce a gch file, and then includes the headerwith `-include foo.h` and if a .gch file exists for that header it gets used.This is documented athttp://clang.llvm.org/docs/UsersManual.html#precompiled-headerscl.exe&apos;s model is fairly different, and controlled by the two flags /Yc and/Yu. A pch file is generated as a side effect of a regular compilation when/Ycheader.h is passed. While the compilation is running, the compiler keepstrack of #include lines in the main translation unit and writes everything upto an `#include &quot;header.h&quot;` line into a pch file. Conversely, /Yuheader.h tellsthe compiler to skip all code in the main TU up to and including `#include&quot;header.h&quot;` and instead load header.pch. (It&apos;s also possible to use /Yc and /Yuwithout an argument, in that case a `#pragma hrdstop` takes the role ofcontrolling the point where pch ends and real code begins.)This patch implements limited support for this in that it requires the pchheader to be passed as a /FI force include flag &#8211; with this restriction,it can be implemented almost completely in the driver with fairly small amountsof code. For /Yu, this is trivial, and for /Yc a separate pch action is addedthat runs before the actual compilation. After r261774, the first failingcommand makes a compilation stop &#8211;&#160;this means if the pch fails to build themain compilation won&apos;t run, which is what we want. However, in /fallback buildswe need to run the main compilation even if the pch build fails so that themain compilation&apos;s fallback can run. To achieve this, add a ForceSuccessCommandthat pretends that the pch build always succeeded in /fallback builds (the maincompilation will then fail to open the pch and run the fallback cl.exeinvocation).If /Yc /Yu are used in a setup that clang-cl doesn&apos;t implement yet, clang-clwill now emit a &quot;not implemented yet; flag ignored&quot; warning that can bedisabled using -Wno-clang-cl-pch.Since clang-cl doesn&apos;t yet serialize some important things (most notably`pragma comment(lib, ...)`, this feature is disabled by default and onlyenabled by an internal driver flag. Once it&apos;s more stable, this internal flagwill disappear.(The default stdafx.h setup passes stdafx.h as explicit argument to /Yc but notas /FI &#8211;&#160;instead every single TU has to `#include &lt;stdafx.h&gt;` as first thing itdoes. Implementing support for this should be possible with the approach inthis patch with minimal frontend changes by passing a --stop-at / --start-atflag from the driver to the frontend. This is left for a follow-up. I don&apos;tthink we ever want to support `#pragma hdrstop`, and supporting it with thisapproach isn&apos;t easy: This approach relies on the driver knowing the pchfilename in advance, and `#pragma hdrstop(out.pch)` can set the outputfilename, so the driver can&apos;t know about it in advance.)clang-cl now also honors /Fp and puts pch files in the same spot that cl.exewould put them, but the pch file format is of course incompatible. This hasramifications on /fallback, so /Yc /Yu aren&apos;t passed through to cl.exe in/fallback builds.http://reviews.llvm.org/D17695llvm-svn: 262420

            List of files:
            /llvm-project-15.0.7/clang/test/Driver/Inputs/pchfile.cpp</description>
        <pubDate>Tue, 01 Mar 2016 23:16:44 +0000</pubDate>
        <dc:creator>Nico Weber &lt;nicolasweber@gmx.de&gt;</dc:creator>
    </item>
</channel>
</rss>
