[clang] 8e3a5a9 - [Driver][NFC] Simplify code.

Jianjian GUAN via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 22 19:56:49 PDT 2023


Author: Jianjian GUAN
Date: 2023-04-23T10:56:27+08:00
New Revision: 8e3a5a965a14f3d40c0ef07456e244509358abd7

URL: https://github.com/llvm/llvm-project/commit/8e3a5a965a14f3d40c0ef07456e244509358abd7
DIFF: https://github.com/llvm/llvm-project/commit/8e3a5a965a14f3d40c0ef07456e244509358abd7.diff

LOG: [Driver][NFC] Simplify code.

Reviewed By: benshi001, jhuber6

Differential Revision: https://reviews.llvm.org/D148908

Added: 
    

Modified: 
    clang/lib/Driver/Driver.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 591025cc10c4b..2e924960eda37 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;


        


More information about the cfe-commits mailing list