@@ -3844,6 +3844,9 @@ class OffloadingActionBuilder final {
3844
3844
// / Flag set to true if all valid builders allow file bundling/unbundling.
3845
3845
bool CanUseBundler;
3846
3846
3847
+ // / Flag set to false if an argument turns off bundling.
3848
+ bool ShouldUseBundler;
3849
+
3847
3850
public:
3848
3851
OffloadingActionBuilder (Compilation &C, DerivedArgList &Args,
3849
3852
const Driver::InputList &Inputs)
@@ -3878,6 +3881,9 @@ class OffloadingActionBuilder final {
3878
3881
}
3879
3882
CanUseBundler =
3880
3883
ValidBuilders && ValidBuilders == ValidBuildersSupportingBundling;
3884
+
3885
+ ShouldUseBundler = Args.hasFlag (options::OPT_gpu_bundle_output,
3886
+ options::OPT_no_gpu_bundle_output, true );
3881
3887
}
3882
3888
3883
3889
~OffloadingActionBuilder () {
@@ -4029,11 +4035,11 @@ class OffloadingActionBuilder final {
4029
4035
SB->appendTopLevelActions (OffloadAL);
4030
4036
}
4031
4037
4032
- // If we can use the bundler, replace the host action by the bundling one in
4033
- // the resulting list. Otherwise, just append the device actions. For
4034
- // device only compilation, HostAction is a null pointer, therefore only do
4035
- // this when HostAction is not a null pointer.
4036
- if (CanUseBundler && HostAction &&
4038
+ // If we can and should use the bundler, replace the host action by the
4039
+ // bundling one in the resulting list. Otherwise, just append the device
4040
+ // actions. For device only compilation, HostAction is a null pointer,
4041
+ // therefore only do this when HostAction is not a null pointer.
4042
+ if (CanUseBundler && ShouldUseBundler && HostAction &&
4037
4043
HostAction->getType () != types::TY_Nothing && !OffloadAL.empty ()) {
4038
4044
// Add the host action to the list in order to create the bundling action.
4039
4045
OffloadAL.push_back (HostAction);
0 commit comments