diff --git a/.gitmodules b/.gitmodules index dd74d49828f75..d3a322a2f7649 100644 --- a/.gitmodules +++ b/.gitmodules @@ -42,8 +42,8 @@ url = https://github.com/rust-lang-nursery/edition-guide.git [submodule "src/llvm-project"] path = src/llvm-project - url = https://github.com/rust-lang/llvm-project.git - branch = rustc/8.0-2019-03-18 + url = https://github.com/alexcrichton/llvm-project.git + branch = rustc/9.0-2019-06-28 [submodule "src/doc/embedded-book"] path = src/doc/embedded-book url = https://github.com/rust-embedded/book.git diff --git a/src/llvm-project b/src/llvm-project index 1bbe0b3e1d756..78a950ee7e10e 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit 1bbe0b3e1d756116cbf1fcf049555066ef929008 +Subproject commit 78a950ee7e10ea4af21fc7e2a32572219c3401b9 diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 0ebef82d37680..c08860ed15e3e 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -267,7 +267,8 @@ static Optional fromRust(LLVMRustRelocMode RustReloc) { #ifdef LLVM_RUSTLLVM /// getLongestEntryLength - Return the length of the longest entry in the table. /// -static size_t getLongestEntryLength(ArrayRef Table) { +template +static size_t getLongestEntryLength(ArrayRef Table) { size_t MaxLen = 0; for (auto &I : Table) MaxLen = std::max(MaxLen, std::strlen(I.Key)); @@ -279,7 +280,7 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); const Triple::ArchType HostArch = Triple(sys::getProcessTriple()).getArch(); const Triple::ArchType TargetArch = Target->getTargetTriple().getArch(); - const ArrayRef CPUTable = MCInfo->getCPUTable(); + const ArrayRef CPUTable = MCInfo->getCPUTable(); unsigned MaxCPULen = getLongestEntryLength(CPUTable); printf("Available CPUs for this target:\n"); @@ -289,7 +290,7 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM) { MaxCPULen, "native", (int)HostCPU.size(), HostCPU.data()); } for (auto &CPU : CPUTable) - printf(" %-*s - %s.\n", MaxCPULen, CPU.Key, CPU.Desc); + printf(" %-*s\n", MaxCPULen, CPU.Key); printf("\n"); } @@ -913,7 +914,14 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules, GlobalValue::LinkageTypes NewLinkage) { ResolvedODR[ModuleIdentifier][GUID] = NewLinkage; }; -#if LLVM_VERSION_GE(8, 0) +#if LLVM_VERSION_GE(9, 0) + thinLTOResolvePrevailingInIndex( + Ret->Index, + isPrevailing, + recordNewLinkage, + Ret->GUIDPreservedSymbols + ); +#elif LLVM_VERSION_GE(8, 0) thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage); #else thinLTOResolveWeakForLinkerInIndex(Ret->Index, isPrevailing, recordNewLinkage);