Skip to content

Commit 280c7a9

Browse files
committed
[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.
1 parent ece2903 commit 280c7a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4647,7 +4647,8 @@ Action *Driver::BuildOffloadingActions(Compilation &C,
46474647

46484648
// All kinds exit now in device-only mode except for non-RDC mode HIP.
46494649
if (offloadDeviceOnly() &&
4650-
(!C.isOffloadingHostKind(Action::OFK_HIP) ||
4650+
(getFinalPhase(Args) == phases::Preprocess ||
4651+
!C.isOffloadingHostKind(Action::OFK_HIP) ||
46514652
!Args.hasFlag(options::OPT_gpu_bundle_output,
46524653
options::OPT_no_gpu_bundle_output, true) ||
46534654
Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false)))

0 commit comments

Comments
 (0)