From 7267cc108ee623b2ef92ad1862a07c45ac8d9f3a Mon Sep 17 00:00:00 2001
From: Samuel Antao <sfantao@us.ibm.com>
Date: Thu, 28 Jul 2016 22:42:42 +0000
Subject: [PATCH] [CUDA] Unswitch enumerators in the selection of the
 offloading tool chain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277064 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Driver/Tools.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 7a764056294..f5110731db4 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -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.
-- 
GitLab