diff options
| author | Loïc BRANSTETT <lolo.branstett@numericable.fr> | 2022-04-03 18:42:39 +0200 |
|---|---|---|
| committer | Loïc BRANSTETT <lolo.branstett@numericable.fr> | 2022-04-03 21:29:57 +0200 |
| commit | 1a1f5b89a4acf44fc4720c097b4bbcebcfa26818 (patch) | |
| tree | 38936a74b195682852c20a6dca322bb4d762bfa2 /compiler/rustc_codegen_gcc/src | |
| parent | c16a558f245cdf363ede29bed0d682434885f826 (diff) | |
| download | rust-1a1f5b89a4acf44fc4720c097b4bbcebcfa26818.tar.gz rust-1a1f5b89a4acf44fc4720c097b4bbcebcfa26818.zip | |
Cleanup after some refactoring in rustc_target
Diffstat (limited to 'compiler/rustc_codegen_gcc/src')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/lib.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_gcc/src/lib.rs b/compiler/rustc_codegen_gcc/src/lib.rs index eac4a06226c..497a28354d8 100644 --- a/compiler/rustc_codegen_gcc/src/lib.rs +++ b/compiler/rustc_codegen_gcc/src/lib.rs @@ -287,8 +287,10 @@ fn handle_native(name: &str) -> &str { } pub fn target_cpu(sess: &Session) -> &str { - let name = sess.opts.cg.target_cpu.as_ref().unwrap_or(&sess.target.cpu); - handle_native(name) + match sess.opts.cg.target_cpu { + Some(ref name) => handle_native(name), + None => handle_native(sess.target.cpu.as_ref()), + } } pub fn target_features(sess: &Session) -> Vec<Symbol> { |
