diff --git a/.gitmodules b/.gitmodules index a327aaa8d5a34..8f4d3768c21e8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -37,7 +37,7 @@ [submodule "src/llvm-project"] path = src/llvm-project url = https://github.com/rust-lang/llvm-project.git - branch = rustc/10.0-2020-05-05 + branch = rustc/11.0-2020-08-20 [submodule "src/doc/embedded-book"] path = src/doc/embedded-book url = https://github.com/rust-embedded/book.git diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh index 2c00a628a1d35..d6ce2806e390f 100755 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh @@ -18,17 +18,7 @@ cd clang-build # For whatever reason the default set of include paths for clang is different # than that of gcc. As a result we need to manually include our sysroot's # include path, /rustroot/include, to clang's default include path. -# -# Alsow there's this weird oddity with gcc where there's an 'include-fixed' -# directory that it generates. It turns out [1] that Centos 5's headers are so -# old that they're incompatible with modern C semantics. While gcc automatically -# fixes that clang doesn't account for this. Tell clang to manually include the -# fixed headers so we can successfully compile code later on. -# -# [1]: https://sourceware.org/ml/crossgcc/2008-11/msg00028.html -INC="/rustroot/include" -INC="$INC:/rustroot/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/include-fixed" -INC="$INC:/usr/include" +INC="/rustroot/include:/usr/include" hide_output \ cmake ../llvm \ diff --git a/src/llvm-project b/src/llvm-project index 86b120e6f302d..45790d79496be 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit 86b120e6f302d39cd6973b6391fb299d7bc22122 +Subproject commit 45790d79496be37fbce6ec57abad5af8fa7a34d7 diff --git a/src/rustllvm/CoverageMappingWrapper.cpp b/src/rustllvm/CoverageMappingWrapper.cpp index 4d15e31df15a3..81aba0cbf7d42 100644 --- a/src/rustllvm/CoverageMappingWrapper.cpp +++ b/src/rustllvm/CoverageMappingWrapper.cpp @@ -3,6 +3,7 @@ #include "llvm/ProfileData/Coverage/CoverageMappingWriter.h" #include "llvm/ProfileData/InstrProf.h" #include "llvm/ADT/ArrayRef.h" +#include "llvm/Support/LEB128.h" #include @@ -12,14 +13,15 @@ extern "C" void LLVMRustCoverageWriteFilenamesSectionToBuffer( const char* const Filenames[], size_t FilenamesLen, RustStringRef BufferOut) { - SmallVector FilenameRefs; + // LLVM 11's CoverageFilenamesSectionWriter uses its new `Version4` format, + // so we're manually writing the `Version3` format ourselves. + RawRustStringOstream OS(BufferOut); + encodeULEB128(FilenamesLen, OS); for (size_t i = 0; i < FilenamesLen; i++) { - FilenameRefs.push_back(StringRef(Filenames[i])); + StringRef Filename(Filenames[i]); + encodeULEB128(Filename.size(), OS); + OS << Filename; } - auto FilenamesWriter = coverage::CoverageFilenamesSectionWriter( - makeArrayRef(FilenameRefs)); - RawRustStringOstream OS(BufferOut); - FilenamesWriter.write(OS); } extern "C" void LLVMRustCoverageWriteMappingToBuffer( @@ -64,5 +66,5 @@ extern "C" void LLVMRustCoverageWriteMappingVarNameToString(RustStringRef Str) { } extern "C" uint32_t LLVMRustCoverageMappingVersion() { - return coverage::CovMapVersion::CurrentVersion; + return coverage::CovMapVersion::Version3; } diff --git a/src/test/assembly/asm/riscv-types.rs b/src/test/assembly/asm/riscv-types.rs index 6b6e582442cbc..67dda1024fc24 100644 --- a/src/test/assembly/asm/riscv-types.rs +++ b/src/test/assembly/asm/riscv-types.rs @@ -55,7 +55,8 @@ pub unsafe fn sym_fn() { // CHECK-LABEL: sym_static: // CHECK: #APP -// CHECK: lb t0, extern_static +// CHECK: auipc t0, %pcrel_hi(extern_static) +// CHECK: lb t0, %pcrel_lo(.Lpcrel_hi0)(t0) // CHECK: #NO_APP #[no_mangle] pub unsafe fn sym_static() { @@ -98,45 +99,45 @@ macro_rules! check_reg { // CHECK-LABEL: reg_i8: // CHECK: #APP -// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}} +// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}} // CHECK: #NO_APP check!(reg_i8 i8 reg "mv"); // CHECK-LABEL: reg_i16: // CHECK: #APP -// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}} +// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}} // CHECK: #NO_APP check!(reg_i16 i16 reg "mv"); // CHECK-LABEL: reg_i32: // CHECK: #APP -// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}} +// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}} // CHECK: #NO_APP check!(reg_i32 i32 reg "mv"); // CHECK-LABEL: reg_f32: // CHECK: #APP -// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}} +// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}} // CHECK: #NO_APP check!(reg_f32 f32 reg "mv"); // riscv64-LABEL: reg_i64: // riscv64: #APP -// riscv64: mv {{[a-z0-9]+}}, {{[a-z0-9]+}} +// riscv64: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}} // riscv64: #NO_APP #[cfg(riscv64)] check!(reg_i64 i64 reg "mv"); // riscv64-LABEL: reg_f64: // riscv64: #APP -// riscv64: mv {{[a-z0-9]+}}, {{[a-z0-9]+}} +// riscv64: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}} // riscv64: #NO_APP #[cfg(riscv64)] check!(reg_f64 f64 reg "mv"); // CHECK-LABEL: reg_ptr: // CHECK: #APP -// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}} +// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}} // CHECK: #NO_APP check!(reg_ptr ptr reg "mv"); @@ -154,45 +155,45 @@ check!(freg_f64 f64 freg "fmv.d"); // CHECK-LABEL: a0_i8: // CHECK: #APP -// CHECK: mv a0, a0 +// CHECK: add a0, zero, a0 // CHECK: #NO_APP check_reg!(a0_i8 i8 "a0" "mv"); // CHECK-LABEL: a0_i16: // CHECK: #APP -// CHECK: mv a0, a0 +// CHECK: add a0, zero, a0 // CHECK: #NO_APP check_reg!(a0_i16 i16 "a0" "mv"); // CHECK-LABEL: a0_i32: // CHECK: #APP -// CHECK: mv a0, a0 +// CHECK: add a0, zero, a0 // CHECK: #NO_APP check_reg!(a0_i32 i32 "a0" "mv"); // CHECK-LABEL: a0_f32: // CHECK: #APP -// CHECK: mv a0, a0 +// CHECK: add a0, zero, a0 // CHECK: #NO_APP check_reg!(a0_f32 f32 "a0" "mv"); // riscv64-LABEL: a0_i64: // riscv64: #APP -// riscv64: mv a0, a0 +// riscv64: add a0, zero, a0 // riscv64: #NO_APP #[cfg(riscv64)] check_reg!(a0_i64 i64 "a0" "mv"); // riscv64-LABEL: a0_f64: // riscv64: #APP -// riscv64: mv a0, a0 +// riscv64: add a0, zero, a0 // riscv64: #NO_APP #[cfg(riscv64)] check_reg!(a0_f64 f64 "a0" "mv"); // CHECK-LABEL: a0_ptr: // CHECK: #APP -// CHECK: mv a0, a0 +// CHECK: add a0, zero, a0 // CHECK: #NO_APP check_reg!(a0_ptr ptr "a0" "mv"); diff --git a/src/test/codegen/scalar-pair-bool.rs b/src/test/codegen/scalar-pair-bool.rs index d91ee7f816ded..4704c8ad797d8 100644 --- a/src/test/codegen/scalar-pair-bool.rs +++ b/src/test/codegen/scalar-pair-bool.rs @@ -24,8 +24,9 @@ pub fn pair_i32_bool(pair: (i32, bool)) -> (i32, bool) { #[no_mangle] pub fn pair_and_or((a, b): (bool, bool)) -> (bool, bool) { // Make sure it can operate directly on the unpacked args - // CHECK: and i1 %_1.0, %_1.1 - // CHECK: or i1 %_1.0, %_1.1 + // (but it might not be using simple and/or instructions) + // CHECK-DAG: %_1.0 + // CHECK-DAG: %_1.1 (a && b, a || b) } diff --git a/src/test/run-make-fulldeps/instrument-coverage/expected_export_coverage.json b/src/test/run-make-fulldeps/instrument-coverage/expected_export_coverage.json index 5881cf4b7dbbc..75bec80bdf886 100644 --- a/src/test/run-make-fulldeps/instrument-coverage/expected_export_coverage.json +++ b/src/test/run-make-fulldeps/instrument-coverage/expected_export_coverage.json @@ -55,5 +55,5 @@ } ], "type": "llvm.coverage.json.export", - "version": "2.0.0" + "version": "2.0.1" }