@@ -267,7 +267,8 @@ static Optional<Reloc::Model> fromRust(LLVMRustRelocMode RustReloc) {
267267#ifdef LLVM_RUSTLLVM
268268// / getLongestEntryLength - Return the length of the longest entry in the table.
269269// /
270- static size_t getLongestEntryLength (ArrayRef<SubtargetFeatureKV> Table) {
270+ template <typename T>
271+ static size_t getLongestEntryLength (ArrayRef<T> Table) {
271272 size_t MaxLen = 0 ;
272273 for (auto &I : Table)
273274 MaxLen = std::max (MaxLen, std::strlen (I.Key ));
@@ -279,7 +280,7 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) {
279280 const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo ();
280281 const Triple::ArchType HostArch = Triple (sys::getProcessTriple ()).getArch ();
281282 const Triple::ArchType TargetArch = Target->getTargetTriple ().getArch ();
282- const ArrayRef<SubtargetFeatureKV > CPUTable = MCInfo->getCPUTable ();
283+ const ArrayRef<SubtargetSubTypeKV > CPUTable = MCInfo->getCPUTable ();
283284 unsigned MaxCPULen = getLongestEntryLength (CPUTable);
284285
285286 printf (" Available CPUs for this target:\n " );
@@ -289,7 +290,7 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) {
289290 MaxCPULen, " native" , (int )HostCPU.size (), HostCPU.data ());
290291 }
291292 for (auto &CPU : CPUTable)
292- printf (" %-*s - %s. \n " , MaxCPULen, CPU.Key , CPU. Desc );
293+ printf (" %-*s\n " , MaxCPULen, CPU.Key );
293294 printf (" \n " );
294295}
295296
@@ -913,7 +914,14 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
913914 GlobalValue::LinkageTypes NewLinkage) {
914915 ResolvedODR[ModuleIdentifier][GUID] = NewLinkage;
915916 };
916- #if LLVM_VERSION_GE(8, 0)
917+ #if LLVM_VERSION_GE(9, 0)
918+ thinLTOResolvePrevailingInIndex (
919+ Ret->Index ,
920+ isPrevailing,
921+ recordNewLinkage,
922+ Ret->GUIDPreservedSymbols
923+ );
924+ #elif LLVM_VERSION_GE(8, 0)
917925 thinLTOResolvePrevailingInIndex (Ret->Index , isPrevailing, recordNewLinkage);
918926#else
919927 thinLTOResolveWeakForLinkerInIndex (Ret->Index , isPrevailing, recordNewLinkage);
0 commit comments