[cfe-commits] r144089 - /cfe/trunk/lib/Driver/ToolChains.cpp

Chandler Carruth chandlerc at gmail.com
Tue Nov 8 09:19:47 PST 2011


Author: chandlerc
Date: Tue Nov  8 11:19:47 2011
New Revision: 144089

URL: http://llvm.org/viewvc/llvm-project?rev=144089&view=rev
Log:
Add a default system include of '/include'. This isn't particularly
useful when using Clang as a system-compiler, but its harmless. When
using Clang as a cross-compiler, this can be very handy as quite a few
toolchains ship their libc headers here rather than under
'/usr/include'.

For reference, this is the beginning of my work to also make the Clang
driver more suitable as a cross-compiler.

Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=144089&r1=144088&r2=144089&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Tue Nov  8 11:19:47 2011
@@ -1987,6 +1987,11 @@
   if (getTriple().getOS() == llvm::Triple::RTEMS)
     return;
 
+  // Add an include of '/include' directly. This isn't provided by default by
+  // system GCCs, but is often used with cross-compiling GCCs, and harmless to
+  // add even when Clang is acting as-if it were a system compiler.
+  addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include");
+
   addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/include");
 }
 





More information about the cfe-commits mailing list