@@ -226,6 +226,13 @@ pub enum CoverageLevel {
226226 Mcdc ,
227227}
228228
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+
229236/// The different settings that the `-Z autodiff` flag can have.
230237#[ derive( Clone , PartialEq , Hash , Debug ) ]
231238pub enum AutoDiff {
@@ -2706,6 +2713,15 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
27062713 )
27072714 }
27082715
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+
27092725 let target_triple = parse_target_triple ( early_dcx, matches) ;
27102726
27112727 // Ensure `-Z unstable-options` is required when using the unstable `-C link-self-contained` and
@@ -3178,7 +3194,7 @@ pub(crate) mod dep_tracking {
31783194 AutoDiff , BranchProtection , CFGuard , CFProtection , CollapseMacroDebuginfo , CoverageOptions ,
31793195 CrateType , DebugInfo , DebugInfoCompression , ErrorOutputType , FmtDebug , FunctionReturn ,
31803196 InliningThreshold , InstrumentCoverage , InstrumentXRay , LinkerPluginLto , LocationDetail ,
3181- LtoCli , MirStripDebugInfo , NextSolverConfig , OomStrategy , OptLevel , OutFileName ,
3197+ LtoCli , MirStripDebugInfo , NextSolverConfig , Offload , OomStrategy , OptLevel , OutFileName ,
31823198 OutputType , OutputTypes , PatchableFunctionEntry , Polonius , RemapPathScopeComponents ,
31833199 ResolveDocLinks , SourceFileHashAlgorithm , SplitDwarfKind , SwitchWithOptPath ,
31843200 SymbolManglingVersion , WasiExecModel ,
@@ -3225,6 +3241,7 @@ pub(crate) mod dep_tracking {
32253241 impl_dep_tracking_hash_via_hash ! (
32263242 ( ) ,
32273243 AutoDiff ,
3244+ Offload ,
32283245 bool ,
32293246 usize ,
32303247 NonZero <usize >,
0 commit comments