Skip to content

Commit

Permalink
Update LLVM
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Jul 2, 2019
1 parent ef064d2 commit ad683ca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/llvm-project
Submodule llvm-project updated 35353 files
16 changes: 12 additions & 4 deletions src/rustllvm/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ static Optional<Reloc::Model> fromRust(LLVMRustRelocMode RustReloc) {
#ifdef LLVM_RUSTLLVM
/// getLongestEntryLength - Return the length of the longest entry in the table.
///
static size_t getLongestEntryLength(ArrayRef<SubtargetFeatureKV> Table) {
template<typename T>
static size_t getLongestEntryLength(ArrayRef<T> Table) {
size_t MaxLen = 0;
for (auto &I : Table)
MaxLen = std::max(MaxLen, std::strlen(I.Key));
Expand All @@ -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<SubtargetFeatureKV> CPUTable = MCInfo->getCPUTable();
const ArrayRef<SubtargetSubTypeKV> CPUTable = MCInfo->getCPUTable();
unsigned MaxCPULen = getLongestEntryLength(CPUTable);

printf("Available CPUs for this target:\n");
Expand All @@ -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");
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ad683ca

Please sign in to comment.