@@ -226,6 +226,13 @@ pub enum CoverageLevel {
226
226
Mcdc ,
227
227
}
228
228
229
+ // The different settings that the `-Z offload` flag can have.
230
+ #[ derive( Clone , Copy , PartialEq , Hash , Debug ) ]
231
+ pub enum Offload {
232
+ /// Enable the llvm offload pipeline
233
+ Enable ,
234
+ }
235
+
229
236
/// The different settings that the `-Z autodiff` flag can have.
230
237
#[ derive( Clone , PartialEq , Hash , Debug ) ]
231
238
pub enum AutoDiff {
@@ -2706,6 +2713,15 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
2706
2713
)
2707
2714
}
2708
2715
2716
+ if !nightly_options:: is_unstable_enabled ( matches)
2717
+ && unstable_opts. offload . contains ( & Offload :: Enable )
2718
+ {
2719
+ early_dcx. early_fatal (
2720
+ "`-Zoffload=Enable` also requires `-Zunstable-options` \
2721
+ and a nightly compiler",
2722
+ )
2723
+ }
2724
+
2709
2725
let target_triple = parse_target_triple ( early_dcx, matches) ;
2710
2726
2711
2727
// Ensure `-Z unstable-options` is required when using the unstable `-C link-self-contained` and
@@ -3178,7 +3194,7 @@ pub(crate) mod dep_tracking {
3178
3194
AutoDiff , BranchProtection , CFGuard , CFProtection , CollapseMacroDebuginfo , CoverageOptions ,
3179
3195
CrateType , DebugInfo , DebugInfoCompression , ErrorOutputType , FmtDebug , FunctionReturn ,
3180
3196
InliningThreshold , InstrumentCoverage , InstrumentXRay , LinkerPluginLto , LocationDetail ,
3181
- LtoCli , MirStripDebugInfo , NextSolverConfig , OomStrategy , OptLevel , OutFileName ,
3197
+ LtoCli , MirStripDebugInfo , NextSolverConfig , Offload , OomStrategy , OptLevel , OutFileName ,
3182
3198
OutputType , OutputTypes , PatchableFunctionEntry , Polonius , RemapPathScopeComponents ,
3183
3199
ResolveDocLinks , SourceFileHashAlgorithm , SplitDwarfKind , SwitchWithOptPath ,
3184
3200
SymbolManglingVersion , WasiExecModel ,
@@ -3225,6 +3241,7 @@ pub(crate) mod dep_tracking {
3225
3241
impl_dep_tracking_hash_via_hash ! (
3226
3242
( ) ,
3227
3243
AutoDiff ,
3244
+ Offload ,
3228
3245
bool ,
3229
3246
usize ,
3230
3247
NonZero <usize >,
0 commit comments