about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorJames Dietz <jamesthespeedy@gmail.com>2023-04-26 21:11:14 -0400
committerJames Dietz <jamesthespeedy@gmail.com>2023-05-04 20:29:38 -0400
commitea17aa9141cde9f26ec09b423ca2efe8aa08cc33 (patch)
treefe23ced53325da8542c689b238c254822508df22 /compiler/rustc_codegen_llvm/src
parenteb7a7434215dd9d4b7cc18746ad1d0e531c25325 (diff)
downloadrust-ea17aa9141cde9f26ec09b423ca2efe8aa08cc33.tar.gz
rust-ea17aa9141cde9f26ec09b423ca2efe8aa08cc33.zip
`--print target-cpus` shows default target cpu, updated docs
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
index 46692fd5e8b..71fe8d36132 100644
--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
@@ -329,7 +329,13 @@ pub(crate) fn print(req: PrintRequest, sess: &Session) {
     require_inited();
     let tm = create_informational_target_machine(sess);
     match req {
-        PrintRequest::TargetCPUs => unsafe { llvm::LLVMRustPrintTargetCPUs(tm) },
+        PrintRequest::TargetCPUs => {
+            println!(
+                "Default CPU for this target:\n    {}",
+                handle_native(sess.target.cpu.as_ref())
+            );
+            unsafe { llvm::LLVMRustPrintTargetCPUs(tm, handle_native(sess.target.cpu.as_ref())) };
+        }
         PrintRequest::TargetFeatures => print_target_features(sess, tm),
         _ => bug!("rustc_codegen_llvm can't handle print request: {:?}", req),
     }