[PATCH] D22490: Append clang system include path for offloading tool chains.

Samuel Antao via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 18 17:08:41 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL275931: Append clang system include path for offloading tool chains. (authored by sfantao).

Changed prior to commit:
  https://reviews.llvm.org/D22490?vs=64428&id=64432#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D22490

Files:
  cfe/trunk/lib/Driver/Tools.cpp

Index: cfe/trunk/lib/Driver/Tools.cpp
===================================================================
--- cfe/trunk/lib/Driver/Tools.cpp
+++ cfe/trunk/lib/Driver/Tools.cpp
@@ -314,6 +314,24 @@
   // TODO: Add support for other programming models here.
 }
 
+/// Add the C include args of other offloading toolchains. If this is a host
+/// job, the device toolchains are added. If this is a device job, the host
+/// toolchains will be added.
+static void addExtraOffloadClangSystemIncludeArgs(Compilation &C,
+                                                  const JobAction &JA,
+                                                  const ArgList &Args,
+                                                  ArgStringList &CmdArgs) {
+
+  if (JA.isHostOffloading(Action::OFK_Cuda))
+    C.getSingleOffloadToolChain<Action::OFK_Cuda>()->AddClangSystemIncludeArgs(
+        Args, CmdArgs);
+  else if (JA.isDeviceOffloading(Action::OFK_Cuda))
+    C.getSingleOffloadToolChain<Action::OFK_Host>()->AddClangSystemIncludeArgs(
+        Args, CmdArgs);
+
+  // TODO: Add support for other programming models here.
+}
+
 /// Add the include args that are specific of each offloading programming model.
 static void addExtraOffloadSpecificIncludeArgs(Compilation &C,
                                                const JobAction &JA,
@@ -612,7 +630,7 @@
   // Add system include arguments for all targets but IAMCU.
   if (!IsIAMCU) {
     getToolChain().AddClangSystemIncludeArgs(Args, CmdArgs);
-    addExtraOffloadCXXStdlibIncludeArgs(C, JA, Args, CmdArgs);
+    addExtraOffloadClangSystemIncludeArgs(C, JA, Args, CmdArgs);
   } else {
     // For IAMCU add special include arguments.
     getToolChain().AddIAMCUIncludeArgs(Args, CmdArgs);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22490.64432.patch
Type: text/x-patch
Size: 1739 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160719/9b1e7aba/attachment.bin>


More information about the cfe-commits mailing list