diff options
| author | James Dietz <jamesthespeedy@gmail.com> | 2023-04-26 21:11:14 -0400 |
|---|---|---|
| committer | James Dietz <jamesthespeedy@gmail.com> | 2023-05-04 20:29:38 -0400 |
| commit | ea17aa9141cde9f26ec09b423ca2efe8aa08cc33 (patch) | |
| tree | fe23ced53325da8542c689b238c254822508df22 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | eb7a7434215dd9d4b7cc18746ad1d0e531c25325 (diff) | |
| download | rust-ea17aa9141cde9f26ec09b423ca2efe8aa08cc33.tar.gz rust-ea17aa9141cde9f26ec09b423ca2efe8aa08cc33.zip | |
`--print target-cpus` shows default target cpu, updated docs
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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<KV> 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"); } |
