]> granicus.if.org Git - clang/commitdiff
[CUDA] Unswitch enumerators in the selection of the offloading tool chain.
authorSamuel Antao <sfantao@us.ibm.com>
Thu, 28 Jul 2016 22:42:42 +0000 (22:42 +0000)
committerSamuel Antao <sfantao@us.ibm.com>
Thu, 28 Jul 2016 22:42:42 +0000 (22:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277064 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index 7a764056294f193693f436894e1fb45bb5c89c9c..f5110731db4fbdcc75c3539701cf4522b51ec6fc 100644 (file)
@@ -308,9 +308,9 @@ forAllAssociatedToolChains(Compilation &C, const JobAction &JA,
   // Apply Work on all the offloading tool chains associated with the current
   // action.
   if (JA.isHostOffloading(Action::OFK_Cuda))
-    Work(*C.getSingleOffloadToolChain<Action::OFK_Host>());
-  else if (JA.isDeviceOffloading(Action::OFK_Cuda))
     Work(*C.getSingleOffloadToolChain<Action::OFK_Cuda>());
+  else if (JA.isDeviceOffloading(Action::OFK_Cuda))
+    Work(*C.getSingleOffloadToolChain<Action::OFK_Host>());
 
   //
   // TODO: Add support for other offloading programming models here.