aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Huber <huberjn@outlook.com>2024-03-18 12:10:19 -0500
committerJoseph Huber <huberjn@outlook.com>2024-03-18 12:12:17 -0500
commit280c7a9526a9ae7f959117c9cec94f8c8887f15c (patch)
tree0adbe1136cf631653b56a28ababbfefefef5c3e1
parentece2903ce730392e5236d27f1f387fa8067fcb1b (diff)
downloadllvm-280c7a9526a9ae7f959117c9cec94f8c8887f15c.zip
llvm-280c7a9526a9ae7f959117c9cec94f8c8887f15c.tar.gz
llvm-280c7a9526a9ae7f959117c9cec94f8c8887f15c.tar.bz2
[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.
-rw-r--r--clang/lib/Driver/Driver.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 5015ce9..1daf588 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)))