Skip to content

Commit d6c818e

Browse files
committed
Update CPU printing for SubtargetSubTypeKV
CPUs now use SubtargetSubTypeKV rather than SubtargetFeatureKV and no longer have a description.
1 parent 624fca6 commit d6c818e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/rustllvm/PassWrapper.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ static Optional<Reloc::Model> fromRust(LLVMRustRelocMode RustReloc) {
266266

267267
#ifdef LLVM_RUSTLLVM
268268
/// getLongestEntryLength - Return the length of the longest entry in the table.
269-
///
270-
static size_t getLongestEntryLength(ArrayRef<SubtargetFeatureKV> Table) {
269+
template<typename KV>
270+
static size_t getLongestEntryLength(ArrayRef<KV> Table) {
271271
size_t MaxLen = 0;
272272
for (auto &I : Table)
273273
MaxLen = std::max(MaxLen, std::strlen(I.Key));
@@ -279,7 +279,7 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) {
279279
const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo();
280280
const Triple::ArchType HostArch = Triple(sys::getProcessTriple()).getArch();
281281
const Triple::ArchType TargetArch = Target->getTargetTriple().getArch();
282-
const ArrayRef<SubtargetFeatureKV> CPUTable = MCInfo->getCPUTable();
282+
const ArrayRef<SubtargetSubTypeKV> CPUTable = MCInfo->getCPUTable();
283283
unsigned MaxCPULen = getLongestEntryLength(CPUTable);
284284

285285
printf("Available CPUs for this target:\n");
@@ -289,7 +289,7 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) {
289289
MaxCPULen, "native", (int)HostCPU.size(), HostCPU.data());
290290
}
291291
for (auto &CPU : CPUTable)
292-
printf(" %-*s - %s.\n", MaxCPULen, CPU.Key, CPU.Desc);
292+
printf(" %-*s\n", MaxCPULen, CPU.Key);
293293
printf("\n");
294294
}
295295

0 commit comments

Comments
 (0)