[clang] 280c7a9 - [Clang] Fix preprocessing device only in HIP mode

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 18 10:12:56 PDT 2024


Author: Joseph Huber
Date: 2024-03-18T12:12:17-05:00
New Revision: 280c7a9526a9ae7f959117c9cec94f8c8887f15c

URL: https://github.com/llvm/llvm-project/commit/280c7a9526a9ae7f959117c9cec94f8c8887f15c
DIFF: https://github.com/llvm/llvm-project/commit/280c7a9526a9ae7f959117c9cec94f8c8887f15c.diff

LOG: [Clang] Fix preprocessing device only in HIP mode

Summary:
A recent change made the HIP compilation bundle by default. However we
don't want to do this for `-E`, which silently broke some handling.

Added: 
    

Modified: 
    clang/lib/Driver/Driver.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 5015ce9f6d68e0..1daf588142b3b4 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -4647,7 +4647,8 @@ Action *Driver::BuildOffloadingActions(Compilation &C,
 
   // All kinds exit now in device-only mode except for non-RDC mode HIP.
   if (offloadDeviceOnly() &&
-      (!C.isOffloadingHostKind(Action::OFK_HIP) ||
+      (getFinalPhase(Args) == phases::Preprocess ||
+       !C.isOffloadingHostKind(Action::OFK_HIP) ||
        !Args.hasFlag(options::OPT_gpu_bundle_output,
                      options::OPT_no_gpu_bundle_output, true) ||
        Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false)))


        


More information about the cfe-commits mailing list