diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -4095,16 +4095,15 @@ Current = NewCurrent; - // Use the current host action in any of the offloading actions, if - // required. - if (!UseNewOffloadingDriver) - if (OffloadBuilder->addHostDependenceToDeviceActions(Current, InputArg)) - break; - // Try to build the offloading actions and add the result as a dependency // to the host. if (UseNewOffloadingDriver) Current = BuildOffloadingActions(C, Args, I, Current); + // Use the current host action in any of the offloading actions, if + // required. + else if (OffloadBuilder->addHostDependenceToDeviceActions(Current, + InputArg)) + break; if (Current->getType() == types::TY_Nothing) break;