[cfe-commits] [PATCH] Add Clang driver-support for directory-style precompiled headers

Tor Arne Vestbø tor.arne.vestbo at nokia.com
Fri Oct 15 03:37:24 PDT 2010

Add Clang driver-support for directory-style precompiled headers

When passed -include foo we will check if foo.pch is a directory,
and if so try to look up a precompiled header matching the current
input language in that directory.

GCC will actually search every file in this directory, regardless of
naming, and choose the first one that matches the language.


Comments? Is it okey to do this kind of simple transparent 
GCC-compatibility-trick or do we have to do what GCC does and actually 
parse each header in that directory and check if it's valid for the 

Side-note about the code: There's a condition where we "Ignore the PCH 
if not first on command line and emit warning.", but we don't actually 
ignore the argument, it's claimed and rendered as a normal -include. Is 
this intentional? In my case I chose to actually ignore the whole 
argument, does that makes sense?


Tor Arne

   include/clang/Basic/DiagnosticDriverKinds.td |    2 ++
   lib/Driver/Tools.cpp                         |   10 ++++++++++
   test/Driver/pch.c                            |   25 
   test/Driver/pth.c                            |   12 ++++++++++++
   4 files changed, 49 insertions(+), 0 deletions(-)
   create mode 100644 test/Driver/pch.c

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Add-Clang-driver-support-for-directory-style-precomp.patch
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20101015/17daf645/attachment.ksh>

More information about the cfe-commits mailing list