diff options
| author | bors <bors@rust-lang.org> | 2023-04-24 00:05:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-04-24 00:05:59 +0000 |
| commit | 8991768e670084d97060b41410ffa2306c93d4a4 (patch) | |
| tree | 9fa4c6b76f911ba883220f497c85bacf77515d34 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | 7f94b314cead7059a71a265a8b64905ef2511796 (diff) | |
| parent | 12858d9a6154e92c6f739c00a80f021515e9b7bb (diff) | |
| download | rust-8991768e670084d97060b41410ffa2306c93d4a4.tar.gz rust-8991768e670084d97060b41410ffa2306c93d4a4.zip | |
Auto merge of #110736 - matthiaskrgr:rollup-gorv8zp, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #110661 (rustdoc: clean up settings.css and settings.js) - #110663 (Add note about change in bootstrap defaults) - #110664 (stop `x fmt` formatting untracked directories) - #110668 (Fix printing native CPU on cross-compiled compiler.) - #110689 (Fix grammar in core::hint::unreachable_unchecked() docs) - #110700 (Don't infer fn return type to return itself) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index abbe8e59770..90cce9a8650 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -310,12 +310,14 @@ static size_t getLongestEntryLength(ArrayRef<KV> Table) { extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { const TargetMachine *Target = unwrap(TM); const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); - const Triple::ArchType HostArch = Triple(sys::getProcessTriple()).getArch(); + const Triple::ArchType HostArch = Triple(sys::getDefaultTargetTriple()).getArch(); const Triple::ArchType TargetArch = Target->getTargetTriple().getArch(); const ArrayRef<SubtargetSubTypeKV> CPUTable = MCInfo->getCPUTable(); unsigned MaxCPULen = getLongestEntryLength(CPUTable); printf("Available CPUs for this target:\n"); + // Don't print the "native" entry when the user specifies --target with a + // different arch since that could be wrong or misleading. if (HostArch == TargetArch) { const StringRef HostCPU = sys::getHostCPUName(); printf(" %-*s - Select the CPU of the current host (currently %.*s).\n", |
