From 8e3a5a965a14f3d40c0ef07456e244509358abd7 Mon Sep 17 00:00:00 2001 From: Jianjian GUAN Date: Fri, 21 Apr 2023 10:27:17 +0800 Subject: [PATCH] [Driver][NFC] Simplify code. Reviewed By: benshi001, jhuber6 Differential Revision: https://reviews.llvm.org/D148908 --- clang/lib/Driver/Driver.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 591025c..2e92496 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -4095,16 +4095,15 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args, 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; -- 2.7.4