From ea17aa9141cde9f26ec09b423ca2efe8aa08cc33 Mon Sep 17 00:00:00 2001 From: James Dietz Date: Wed, 26 Apr 2023 21:11:14 -0400 Subject: `--print target-cpus` shows default target cpu, updated docs --- compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp') diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 1acdc95ca8d..b6578034275 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -307,7 +307,7 @@ static size_t getLongestEntryLength(ArrayRef Table) { return MaxLen; } -extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { +extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, &Char[]) { const TargetMachine *Target = unwrap(TM); const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); const Triple::ArchType HostArch = Triple(sys::getDefaultTargetTriple()).getArch(); @@ -324,7 +324,14 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { MaxCPULen, "native", (int)HostCPU.size(), HostCPU.data()); } for (auto &CPU : CPUTable) - printf(" %-*s\n", MaxCPULen, CPU.Key); + + printf(" %-*s", MaxCPULen, CPU.Key); + if (CPU.Key == Target->getTargetTriple().getArch()) { + printf(" default target\n"); + } + else { + printf("\n"); + } printf("\n"); } -- cgit 1.4.1-3-g733a5