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

Chandler Carruth chandlerc at gmail.com
Mon Nov 7 01:01:17 PST 2011


Author: chandlerc
Date: Mon Nov  7 03:01:17 2011
New Revision: 143916

URL: http://llvm.org/viewvc/llvm-project?rev=143916&view=rev
Log:
Fix Linux libc++ usage. Somehow this slipped through during the port.

Test cases for this and all the rest of the port are still in the works,
but will wait for a fixed computer and post 3.0 merging...

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=143916&r1=143915&r2=143916&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Mon Nov  7 03:01:17 2011
@@ -2010,6 +2010,14 @@
       DriverArgs.hasArg(options::OPT_nostdincxx))
     return;
 
+  // Check if libc++ has been enabled and provide its include paths if so.
+  if (GetCXXStdlibType(DriverArgs) == ToolChain::CST_Libcxx) {
+    // libc++ is always installed at a fixed path on Linux currently.
+    addSystemInclude(DriverArgs, CC1Args,
+                     getDriver().SysRoot + "/usr/include/c++/v1");
+    return;
+  }
+
   const llvm::Triple &TargetTriple = getTriple();
 
   StringRef CxxIncludeRoot(CXX_INCLUDE_ROOT);





More information about the cfe-commits mailing list