Hello community, here is the log from the commit of package llvm10 for openSUSE:Factory checked in at 2020-07-29 17:14:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/llvm10 (Old) and /work/SRC/openSUSE:Factory/.llvm10.new.3592 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "llvm10" Wed Jul 29 17:14:24 2020 rev:4 rq:822551 version:10.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/llvm10/llvm10.changes 2020-07-16 12:08:19.582350420 +0200 +++ /work/SRC/openSUSE:Factory/.llvm10.new.3592/llvm10.changes 2020-07-29 17:15:05.024291184 +0200 @@ -1,0 +2,22 @@ +Wed Jul 22 21:54:01 UTC 2020 - Aaron Puchert <aaronpuch...@alice-dsl.net> + +- Update to version 10.0.1. + * This release contains bug-fixes for the LLVM 10.0.0 release. + This release is API and ABI compatible with 10.0.0. +- Rebase llvm-do-not-install-static-libraries.patch. +- Replace ValueLattice-Add-new-state-for-undef-constants.patch, + which landed upstream in a modified version, by + restore-llvm10-abi.patch that resets the ABI to our 10.0.0. +- Rewrite lld-default-sha1.patch to be version-independent. +- Set flags consistently, so that we don't lose -DNDEBUG on 32-bit + architectures. Also we don't need the opt flags twice. This leads + to a significant reduction in binary sizes on 32-bit arches. +- Make it easier to package release candidates. +- Enable most tests on 32-bit ARM, but not for libcxx. +- Add fix-atomics-test.patch for architectures where native atomics + are not available. +- Lower build constraints for riscv64 a bit to allow building on + more workers. +- Allow more compile jobs in stage 2. + +------------------------------------------------------------------- @@ -18,0 +41,6 @@ + * For details, see the release notes: + - https://releases.llvm.org/10.0.0/docs/ReleaseNotes.html + - https://releases.llvm.org/10.0.0/tools/clang/docs/ReleaseNotes.html + - https://releases.llvm.org/10.0.0/tools/clang/tools/extra/docs/ReleaseNotes.html + - https://releases.llvm.org/10.0.0/projects/libcxx/docs/ReleaseNotes.html + - https://releases.llvm.org/10.0.0/tools/lld/docs/ReleaseNotes.html Old: ---- ValueLattice-Add-new-state-for-undef-constants.patch clang-10.0.0.src.tar.xz clang-docs-10.0.0.src.tar.xz clang-tools-extra-10.0.0.src.tar.xz compiler-rt-10.0.0.src.tar.xz libcxx-10.0.0.src.tar.xz libcxxabi-10.0.0.src.tar.xz lld-10.0.0.src.tar.xz lldb-10.0.0.src.tar.xz llvm-10.0.0.src.tar.xz llvm-docs-10.0.0.src.tar.xz openmp-10.0.0.src.tar.xz polly-10.0.0.src.tar.xz New: ---- clang-10.0.1.src.tar.xz clang-docs-10.0.1.src.tar.xz clang-tools-extra-10.0.1.src.tar.xz compiler-rt-10.0.1.src.tar.xz fix-atomics-test.patch libcxx-10.0.1.src.tar.xz libcxxabi-10.0.1.src.tar.xz lld-10.0.1.src.tar.xz lldb-10.0.1.src.tar.xz llvm-10.0.1.src.tar.xz llvm-docs-10.0.1.src.tar.xz openmp-10.0.1.src.tar.xz polly-10.0.1.src.tar.xz restore-llvm10-abi.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ llvm10.spec ++++++ --- /var/tmp/diff_new_pack.sKFGzU/_old 2020-07-29 17:15:18.200302659 +0200 +++ /var/tmp/diff_new_pack.sKFGzU/_new 2020-07-29 17:15:18.200302659 +0200 @@ -16,11 +16,13 @@ # -%define _relver 10.0.0 +%define _relver 10.0.1 +%define _version %_relver%{?_rc:rc%_rc} +%define _tagver %_relver%{?_rc:-rc%_rc} %define _minor 10.0 %define _sonum 10 # Integer version used by update-alternatives -%define _uaver 1000 +%define _uaver 1001 %define _socxx 1 %ifarch x86_64 aarch64 %arm @@ -78,26 +80,26 @@ fi Name: llvm10 -Version: 10.0.0 +Version: %_relver%{?_rc:~rc%_rc} Release: 0 Summary: Low Level Virtual Machine License: Apache-2.0 WITH LLVM-exception OR NCSA Group: Development/Languages/Other URL: https://www.llvm.org/ # NOTE: please see README.packaging in the llvm package for details on how to update this package -Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/llvm-%{version}.src.tar.xz -Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-%{version}.src.tar.xz -Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-tools-extra-%{version}.src.tar.xz -Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/compiler-rt-%{version}.src.tar.xz -Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/libcxx-%{version}.src.tar.xz -Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/libcxxabi-%{version}.src.tar.xz -Source6: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/openmp-%{version}.src.tar.xz -Source7: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lld-%{version}.src.tar.xz -Source8: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lldb-%{version}.src.tar.xz -Source9: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/polly-%{version}.src.tar.xz +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{_tagver}/llvm-%{_version}.src.tar.xz +Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{_tagver}/clang-%{_version}.src.tar.xz +Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{_tagver}/clang-tools-extra-%{_version}.src.tar.xz +Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{_tagver}/compiler-rt-%{_version}.src.tar.xz +Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{_tagver}/libcxx-%{_version}.src.tar.xz +Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{_tagver}/libcxxabi-%{_version}.src.tar.xz +Source6: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{_tagver}/openmp-%{_version}.src.tar.xz +Source7: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{_tagver}/lld-%{_version}.src.tar.xz +Source8: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{_tagver}/lldb-%{_version}.src.tar.xz +Source9: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{_tagver}/polly-%{_version}.src.tar.xz # Docs are created manually, see below -Source50: llvm-docs-%{version}.src.tar.xz -Source51: clang-docs-%{version}.src.tar.xz +Source50: llvm-docs-%{_version}.src.tar.xz +Source51: clang-docs-%{_version}.src.tar.xz Source100: %{name}-rpmlintrc Source101: baselibs.conf # PATCH-FIX-OPENSUSE lto-disable-cache.patch -- Disable ThinLTO cache @@ -124,10 +126,14 @@ Patch21: tests-use-python3.patch Patch22: llvm-better-detect-64bit-atomics-support.patch Patch24: opt-viewer-Find-style-css-in-usr-share.patch -# Proposed fix for https://bugs.llvm.org/show_bug.cgi?id=45272. -Patch25: ValueLattice-Add-new-state-for-undef-constants.patch +# A patch in 10.0.0 changed the ABI vs upstream, but the upstream patch that +# landed in 10.0.1 is ABI stable, so to be ABI-compatible with our 10.0.0 we +# need to make sure we go with our 10.0.0 enum value order. +Patch25: restore-llvm10-abi.patch # PATCH-FIX-OPENSUSE lld-default-sha1.patch Patch26: lld-default-sha1.patch +# PATCH-FIX-UPSTREAM fix-atomics-test.patch -- Fix Clang test for arches without native atomics. +Patch27: fix-atomics-test.patch BuildRequires: binutils-devel >= 2.21.90 BuildRequires: cmake BuildRequires: fdupes @@ -537,7 +543,7 @@ %endif %prep -%setup -q -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -a 7 -a 8 -a 9 -b 50 -a 51 -n llvm-%{version}.src +%setup -q -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -a 7 -a 8 -a 9 -b 50 -a 51 -n llvm-%{_version}.src %patch0 -p2 %patch5 -p1 @@ -548,16 +554,16 @@ %patch21 -p1 %patch22 -p1 %patch24 -p1 -%patch25 -p2 -%patch26 -p1 +%patch25 -p1 -pushd clang-%{version}.src +pushd clang-%{_version}.src %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch6 -p1 %patch8 -p1 %patch9 -p2 +%patch27 -p1 # We hardcode openSUSE rm unittests/Driver/DistroTest.cpp @@ -567,18 +573,22 @@ rm test/Driver/nacl-direct.c popd -pushd clang-tools-extra-%{version}.src +pushd clang-tools-extra-%{_version}.src %patch10 -p2 popd +pushd lld-%{_version}.src +%patch26 -p1 +popd + %if %{with lldb} -pushd lldb-%{version}.src +pushd lldb-%{_version}.src %patch11 -p1 popd %endif %if %{with libcxx} -pushd libcxx-%{version}.src +pushd libcxx-%{_version}.src rm test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp rm test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp rm test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp @@ -588,32 +598,32 @@ popd %endif -pushd polly-%{version}.src +pushd polly-%{_version}.src %patch12 -p2 popd # Move into right place -mv clang-%{version}.src tools/clang -mv compiler-rt-%{version}.src projects/compiler-rt -mv clang-tools-extra-%{version}.src tools/clang/tools/extra +mv clang-%{_version}.src tools/clang +mv compiler-rt-%{_version}.src projects/compiler-rt +mv clang-tools-extra-%{_version}.src tools/clang/tools/extra %if %{with lld} -mv lld-%{version}.src tools/lld +mv lld-%{_version}.src tools/lld %endif %if %{with polly} -mv polly-%{version}.src tools/polly +mv polly-%{_version}.src tools/polly %endif %if %{with lldb} -mv lldb-%{version}.src tools/lldb +mv lldb-%{_version}.src tools/lldb %endif %if %{with openmp} -mv openmp-%{version}.src projects/openmp +mv openmp-%{_version}.src projects/openmp %endif %if %{with libcxx} -mv libcxx-%{version}.src projects/libcxx -mv libcxxabi-%{version}.src projects/libcxxabi +mv libcxx-%{_version}.src projects/libcxx +mv libcxxabi-%{_version}.src projects/libcxxabi %endif %build @@ -633,6 +643,9 @@ flags+=" -mfloat-abi=hard -march=armv7-a -mtune=cortex-a15 -mfpu=vfpv3-d16" %endif +CFLAGS=$flags +CXXFLAGS=$flags + # By default build everything TARGETS_TO_BUILD="all" %ifarch s390 s390x @@ -657,10 +670,6 @@ # 32-bit arches need less memory than 64-bit arches. mem_per_compile_job=600000 %endif -%ifarch riscv64 -# RISCV needs more because of emulation overhead. -mem_per_compile_job=1000000 -%endif mem_per_link_job=3000000 %ifarch riscv64 @@ -682,8 +691,6 @@ %cmake \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS:BOOL=OFF \ - -DCMAKE_C_FLAGS="$flags -g0" \ - -DCMAKE_CXX_FLAGS="$flags -g0" \ -DLLVM_BUILD_LLVM_DYLIB:BOOL=OFF \ -DLLVM_LINK_LLVM_DYLIB:BOOL=OFF \ -DLLVM_PARALLEL_COMPILE_JOBS="$max_compile_jobs" \ @@ -723,8 +730,10 @@ find ./stage1 \( -name '*.o' -or -name '*.a' \) -delete # Clang uses a bit less memory. -%ifarch x86_64 -mem_per_compile_job=800000 +mem_per_compile_job=700000 +%ifarch i586 ppc armv6hl armv7hl +# 32-bit arches need less memory than 64-bit arches. +mem_per_compile_job=500000 %endif %set_jobs compile $mem_per_compile_job @@ -745,8 +754,6 @@ -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \ -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ -DCLANG_LINK_CLANG_DYLIB:BOOL=ON \ - -DCMAKE_C_FLAGS="$flags" \ - -DCMAKE_CXX_FLAGS="$flags" \ -DLLVM_PARALLEL_COMPILE_JOBS="$max_compile_jobs" \ -DLLVM_PARALLEL_LINK_JOBS="$max_link_jobs" \ %if %{with thin_lto} @@ -755,8 +762,8 @@ -DCMAKE_RANLIB="${LLVM_RANLIB}" \ %endif %ifarch %arm ppc s390 %{ix86} - -DCMAKE_C_FLAGS_RELWITHDEBINFO="$flags -g1" \ - -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$flags -g1" \ + -DCMAKE_C_FLAGS_RELWITHDEBINFO="-g1" \ + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-g1" \ %endif -DENABLE_LINKER_BUILD_ID=ON \ -DLLVM_TABLEGEN="${LLVM_TABLEGEN}" \ @@ -821,16 +828,16 @@ # Docs are prebuilt due to sphinx dependency # -# tar xf llvm-10.0.0.src.tar.xz -# tar xf clang-10.0.0.src.tar.xz -# pushd llvm-10.0.0.src/docs +# tar xf llvm-%{_version}.src.tar.xz +# tar xf clang-%{_version}.src.tar.xz +# pushd llvm-%{_version}.src/docs # make -f Makefile.sphinx man html # popd -# pushd clang-10.0.0.src/docs +# pushd clang-%{_version}.src/docs # make -f Makefile.sphinx man html # popd -# tar cvJf llvm-docs-10.0.0.src.tar.xz llvm-10.0.0.src/docs/_build/{man,html} -# tar cvJf clang-docs-10.0.0.src.tar.xz clang-10.0.0.src/docs/_build/{man,html} +# tar cvJf llvm-docs-%{_version}.src.tar.xz llvm-%{_version}.src/docs/_build/{man,html} +# tar cvJf clang-docs-%{_version}.src.tar.xz clang-%{_version}.src/docs/_build/{man,html} # Build man/html pages pushd docs @@ -980,7 +987,7 @@ # # Version information -%_llvm_version %{_relver} +%_llvm_version %{version} %_llvm_relver %{_relver} %_llvm_minorver %{_minor} %_llvm_sonum %{_sonum} @@ -1042,24 +1049,27 @@ # NOTE: We're not running the tests via ninja, because we've removed object # files and static libraries already. pushd build -%ifnarch %{arm} %if !0%{?qemu_user_space_build:1} # we just do not have enough memory with qemu emulation +# On armv6l, fpext frem(12.0f, 5.0f) to double = inf for some reason. +sed -i '1i; XFAIL: armv6' ../test/ExecutionEngine/frem.ll # Tests are disabled on ppc because of sporadic hangs. Also some tests fail. %ifnarch ppc python3 bin/llvm-lit -sv test/ -%else -python3 bin/llvm-lit -sv test/ || echo "Ignore failures" %endif python3 bin/llvm-lit -sv --param clang_site_config=tools/clang/test/lit.site.cfg \ --param USE_Z3_SOLVER=0 tools/clang/test/ %if %{with libcxx} +# libcxx tests take too long on ARM. +%ifnarch %{arm} python3 bin/llvm-lit -sv projects/libcxx/test/ -python3 bin/llvm-lit -sv projects/libcxxabi/test/ %endif +# There are undefined references to __cxa_* functions and "typeinfo for int". +sed -i '1i@ XFAIL: arm' ../projects/libcxxabi/test/native/arm-linux-eabi/ttype-encoding-{0,9}0.pass.sh.s +python3 bin/llvm-lit -sv projects/libcxxabi/test/ %endif %endif popd ++++++ _constraints ++++++ --- /var/tmp/diff_new_pack.sKFGzU/_old 2020-07-29 17:15:18.248302701 +0200 +++ /var/tmp/diff_new_pack.sKFGzU/_new 2020-07-29 17:15:18.248302701 +0200 @@ -57,10 +57,10 @@ </conditions> <hardware> <disk> - <size unit="G">55</size> + <size unit="G">50</size> </disk> <memory> - <size unit="M">14000</size> + <size unit="M">10000</size> </memory> </hardware> </overwrite> ++++++ clang-10.0.0.src.tar.xz -> clang-10.0.1.src.tar.xz ++++++ /work/SRC/openSUSE:Factory/llvm10/clang-10.0.0.src.tar.xz /work/SRC/openSUSE:Factory/.llvm10.new.3592/clang-10.0.1.src.tar.xz differ: char 25, line 1 ++++++ clang-docs-10.0.0.src.tar.xz -> clang-docs-10.0.1.src.tar.xz ++++++ ++++ 35903 lines of diff (skipped) ++++++ clang-tools-extra-10.0.0.src.tar.xz -> clang-tools-extra-10.0.1.src.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clang-tidy/modernize/LoopConvertCheck.cpp new/clang-tools-extra-10.0.1.src/clang-tidy/modernize/LoopConvertCheck.cpp --- old/clang-tools-extra-10.0.0.src/clang-tidy/modernize/LoopConvertCheck.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clang-tidy/modernize/LoopConvertCheck.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -522,13 +522,11 @@ const ValueDecl *MaybeContainer, const UsageResult &Usages, const DeclStmt *AliasDecl, bool AliasUseRequired, bool AliasFromForInit, const ForStmt *Loop, RangeDescriptor Descriptor) { - auto Diag = diag(Loop->getForLoc(), "use range-based for loop instead"); - std::string VarName; bool VarNameFromAlias = (Usages.size() == 1) && AliasDecl; bool AliasVarIsRef = false; bool CanCopy = true; - + std::vector<FixItHint> FixIts; if (VarNameFromAlias) { const auto *AliasVar = cast<VarDecl>(AliasDecl->getSingleDecl()); VarName = AliasVar->getName().str(); @@ -560,8 +558,8 @@ getAliasRange(Context->getSourceManager(), ReplaceRange); } - Diag << FixItHint::CreateReplacement( - CharSourceRange::getTokenRange(ReplaceRange), ReplacementText); + FixIts.push_back(FixItHint::CreateReplacement( + CharSourceRange::getTokenRange(ReplaceRange), ReplacementText)); // No further replacements are made to the loop, since the iterator or index // was used exactly once - in the initialization of AliasVar. } else { @@ -606,8 +604,8 @@ Usage.Kind == Usage::UK_CaptureByCopy ? "&" + VarName : VarName; } TUInfo->getReplacedVars().insert(std::make_pair(Loop, IndexVar)); - Diag << FixItHint::CreateReplacement( - CharSourceRange::getTokenRange(Range), ReplaceText); + FixIts.push_back(FixItHint::CreateReplacement( + CharSourceRange::getTokenRange(Range), ReplaceText)); } } @@ -645,8 +643,9 @@ std::string Range = ("(" + TypeString + " " + VarName + " : " + MaybeDereference + Descriptor.ContainerString + ")") .str(); - Diag << FixItHint::CreateReplacement( - CharSourceRange::getTokenRange(ParenRange), Range); + FixIts.push_back(FixItHint::CreateReplacement( + CharSourceRange::getTokenRange(ParenRange), Range)); + diag(Loop->getForLoc(), "use range-based for loop instead") << FixIts; TUInfo->getGeneratedDecls().insert(make_pair(Loop, VarName)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/AST.cpp new/clang-tools-extra-10.0.1.src/clangd/AST.cpp --- old/clang-tools-extra-10.0.0.src/clangd/AST.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/AST.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -473,5 +473,12 @@ }); } +bool hasUnstableLinkage(const Decl *D) { + // Linkage of a ValueDecl depends on the type. + // If that's not deduced yet, deducing it may change the linkage. + auto *VD = llvm::dyn_cast_or_null<ValueDecl>(D); + return VD && !VD->getType().isNull() && VD->getType()->isUndeducedType(); +} + } // namespace clangd } // namespace clang diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/AST.h new/clang-tools-extra-10.0.1.src/clangd/AST.h --- old/clang-tools-extra-10.0.0.src/clangd/AST.h 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/AST.h 2020-07-07 18:21:37.000000000 +0200 @@ -148,6 +148,21 @@ const NamedDecl *ND, llvm::ArrayRef<std::string> VisibleNamespaces); +/// Whether we must avoid computing linkage for D during code completion. +/// Clang aggressively caches linkage computation, which is stable after the AST +/// is built. Unfortunately the AST is incomplete during code completion, so +/// linkage may still change. +/// +/// Example: `auto x = []{^}` at file scope. +/// During code completion, the initializer for x hasn't been parsed yet. +/// x has type `undeduced auto`, and external linkage. +/// If we compute linkage at this point, the external linkage will be cached. +/// +/// After code completion the initializer is attached, and x has a lambda type. +/// This means x has "unique external" linkage. If we computed linkage above, +/// the cached value is incorrect. (clang catches this with an assertion). +bool hasUnstableLinkage(const Decl *D); + } // namespace clangd } // namespace clang diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/CodeComplete.cpp new/clang-tools-extra-10.0.1.src/clangd/CodeComplete.cpp --- old/clang-tools-extra-10.0.0.src/clangd/CodeComplete.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/CodeComplete.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -489,6 +489,9 @@ switch (R.Kind) { case CodeCompletionResult::RK_Declaration: case CodeCompletionResult::RK_Pattern: { + // Computing USR caches linkage, which may change after code completion. + if (hasUnstableLinkage(R.Declaration)) + return llvm::None; return clang::clangd::getSymbolID(R.Declaration); } case CodeCompletionResult::RK_Macro: @@ -1001,10 +1004,12 @@ ScoredSignature Result; Result.Signature = std::move(Signature); Result.Quality = Signal; - Result.IDForDoc = - Result.Signature.documentation.empty() && Candidate.getFunction() - ? clangd::getSymbolID(Candidate.getFunction()) - : None; + const FunctionDecl *Func = Candidate.getFunction(); + if (Func && Result.Signature.documentation.empty()) { + // Computing USR caches linkage, which may change after code completion. + if (!hasUnstableLinkage(Func)) + Result.IDForDoc = clangd::getSymbolID(Func); + } return Result; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/Compiler.cpp new/clang-tools-extra-10.0.1.src/clangd/Compiler.cpp --- old/clang-tools-extra-10.0.0.src/clangd/Compiler.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/Compiler.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -41,8 +41,7 @@ } std::unique_ptr<CompilerInvocation> -buildCompilerInvocation(const ParseInputs &Inputs, - clang::DiagnosticConsumer &D, +buildCompilerInvocation(const ParseInputs &Inputs, clang::DiagnosticConsumer &D, std::vector<std::string> *CC1Args) { std::vector<const char *> ArgStrs; for (const auto &S : Inputs.CompileCommand.CommandLine) @@ -65,6 +64,24 @@ CI->getFrontendOpts().DisableFree = false; CI->getLangOpts()->CommentOpts.ParseAllComments = true; CI->getLangOpts()->RetainCommentsFromSystemHeaders = true; + + // Disable any dependency outputting, we don't want to generate files or write + // to stdout/stderr. + CI->getDependencyOutputOpts().ShowIncludesDest = + ShowIncludesDestination::None; + CI->getDependencyOutputOpts().OutputFile.clear(); + CI->getDependencyOutputOpts().HeaderIncludeOutputFile.clear(); + CI->getDependencyOutputOpts().DOTOutputFile.clear(); + CI->getDependencyOutputOpts().ModuleDependencyOutputDir.clear(); + + // Disable any pch generation/usage operations. Since serialized preamble + // format is unstable, using an incompatible one might result in unexpected + // behaviours, including crashes. + CI->getPreprocessorOpts().ImplicitPCHInclude.clear(); + CI->getPreprocessorOpts().PrecompiledPreambleBytes = {0, false}; + CI->getPreprocessorOpts().PCHThroughHeader.clear(); + CI->getPreprocessorOpts().PCHWithHdrStop = false; + CI->getPreprocessorOpts().PCHWithHdrStopCreate = false; return CI; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/FindSymbols.cpp new/clang-tools-extra-10.0.1.src/clangd/FindSymbols.cpp --- old/clang-tools-extra-10.0.0.src/clangd/FindSymbols.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/FindSymbols.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -193,8 +193,11 @@ enum class VisitKind { No, OnlyDecl, DeclAndChildren }; void traverseDecl(Decl *D, std::vector<DocumentSymbol> &Results) { - if (auto *Templ = llvm::dyn_cast<TemplateDecl>(D)) - D = Templ->getTemplatedDecl(); + if (auto *Templ = llvm::dyn_cast<TemplateDecl>(D)) { + // TemplatedDecl might be null, e.g. concepts. + if (auto *TD = Templ->getTemplatedDecl()) + D = TD; + } auto *ND = llvm::dyn_cast<NamedDecl>(D); if (!ND) return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/FindTarget.cpp new/clang-tools-extra-10.0.1.src/clangd/FindTarget.cpp --- old/clang-tools-extra-10.0.0.src/clangd/FindTarget.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/FindTarget.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -229,7 +229,7 @@ } void add(const Decl *Dcl, RelSet Flags) { - const NamedDecl *D = llvm::dyn_cast<NamedDecl>(Dcl); + const NamedDecl *D = llvm::dyn_cast_or_null<NamedDecl>(Dcl); if (!D) return; debug(*D, Flags); @@ -373,6 +373,15 @@ void VisitTagType(const TagType *TT) { Outer.add(TT->getAsTagDecl(), Flags); } + + void VisitElaboratedType(const ElaboratedType *ET) { + Outer.add(ET->desugar(), Flags); + } + + void VisitInjectedClassNameType(const InjectedClassNameType *ICNT) { + Outer.add(ICNT->getDecl(), Flags); + } + void VisitDecltypeType(const DecltypeType *DTT) { Outer.add(DTT->getUnderlyingType(), Flags | Rel::Underlying); } @@ -750,15 +759,17 @@ // TemplateArgumentLoc is the only way to get locations for references to // template template parameters. bool TraverseTemplateArgumentLoc(TemplateArgumentLoc A) { + llvm::SmallVector<const NamedDecl *, 1> Targets; switch (A.getArgument().getKind()) { case TemplateArgument::Template: case TemplateArgument::TemplateExpansion: + if (const auto *D = A.getArgument() + .getAsTemplateOrTemplatePattern() + .getAsTemplateDecl()) + Targets.push_back(D); reportReference(ReferenceLoc{A.getTemplateQualifierLoc(), A.getTemplateNameLoc(), - /*IsDecl=*/false, - {A.getArgument() - .getAsTemplateOrTemplatePattern() - .getAsTemplateDecl()}}, + /*IsDecl=*/false, Targets}, DynTypedNode::create(A.getArgument())); break; case TemplateArgument::Declaration: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/Hover.cpp new/clang-tools-extra-10.0.1.src/clangd/Hover.cpp --- old/clang-tools-extra-10.0.0.src/clangd/Hover.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/Hover.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -249,6 +249,20 @@ Req, [&](const Symbol &S) { Hover.Documentation = S.Documentation; }); } +// Default argument might exist but be unavailable, in the case of unparsed +// arguments for example. This function returns the default argument if it is +// available. +const Expr *getDefaultArg(const ParmVarDecl *PVD) { + // Default argument can be unparsed or uninstatiated. For the former we + // can't do much, as token information is only stored in Sema and not + // attached to the AST node. For the latter though, it is safe to proceed as + // the expression is still valid. + if (!PVD->hasDefaultArg() || PVD->hasUnparsedDefaultArg()) + return nullptr; + return PVD->hasUninstantiatedDefaultArg() ? PVD->getUninstantiatedDefaultArg() + : PVD->getDefaultArg(); +} + // Populates Type, ReturnType, and Parameters for function-like decls. void fillFunctionTypeAndParams(HoverInfo &HI, const Decl *D, const FunctionDecl *FD, @@ -268,10 +282,10 @@ } if (!PVD->getName().empty()) P.Name = PVD->getNameAsString(); - if (PVD->hasDefaultArg()) { + if (const Expr *DefArg = getDefaultArg(PVD)) { P.Default.emplace(); llvm::raw_string_ostream Out(*P.Default); - PVD->getDefaultArg()->printPretty(Out, nullptr, Policy); + DefArg->printPretty(Out, nullptr, Policy); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/Quality.cpp new/clang-tools-extra-10.0.1.src/clangd/Quality.cpp --- old/clang-tools-extra-10.0.0.src/clangd/Quality.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/Quality.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -275,8 +275,9 @@ } if (InClass) return SymbolRelevanceSignals::ClassScope; - // This threshold could be tweaked, e.g. to treat module-visible as global. - if (D->getLinkageInternal() < ExternalLinkage) + // ExternalLinkage threshold could be tweaked, e.g. module-visible as global. + // Avoid caching linkage if it may change after enclosing code completion. + if (hasUnstableLinkage(D) || D->getLinkageInternal() < ExternalLinkage) return SymbolRelevanceSignals::FileScope; return SymbolRelevanceSignals::GlobalScope; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/QueryDriverDatabase.cpp new/clang-tools-extra-10.0.1.src/clangd/QueryDriverDatabase.cpp --- old/clang-tools-extra-10.0.0.src/clangd/QueryDriverDatabase.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/QueryDriverDatabase.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -85,9 +85,10 @@ return SystemIncludes; } -std::vector<std::string> extractSystemIncludes(PathRef Driver, - llvm::StringRef Lang, - llvm::Regex &QueryDriverRegex) { +std::vector<std::string> +extractSystemIncludes(PathRef Driver, llvm::StringRef Lang, + llvm::ArrayRef<std::string> CommandLine, + llvm::Regex &QueryDriverRegex) { trace::Span Tracer("Extract system includes"); SPAN_ATTACH(Tracer, "driver", Driver); SPAN_ATTACH(Tracer, "lang", Lang); @@ -120,14 +121,43 @@ llvm::Optional<llvm::StringRef> Redirects[] = { {""}, {""}, llvm::StringRef(StdErrPath)}; - // Should we also preserve flags like "-sysroot", "-nostdinc" ? - const llvm::StringRef Args[] = {Driver, "-E", "-x", Lang, "-", "-v"}; + llvm::SmallVector<llvm::StringRef, 12> Args = {Driver, "-E", "-x", + Lang, "-", "-v"}; + + // These flags will be preserved + const llvm::StringRef FlagsToPreserve[] = { + "-nostdinc", "--no-standard-includes", "-nostdinc++", "-nobuiltininc"}; + // Preserves these flags and their values, either as separate args or with an + // equalsbetween them + const llvm::StringRef ArgsToPreserve[] = {"--sysroot", "-isysroot"}; + + for (size_t I = 0, E = CommandLine.size(); I < E; ++I) { + llvm::StringRef Arg = CommandLine[I]; + if (llvm::any_of(FlagsToPreserve, + [&Arg](llvm::StringRef S) { return S == Arg; })) { + Args.push_back(Arg); + } else { + const auto *Found = + llvm::find_if(ArgsToPreserve, [&Arg](llvm::StringRef S) { + return Arg.startswith(S); + }); + if (Found == std::end(ArgsToPreserve)) + continue; + Arg.consume_front(*Found); + if (Arg.empty() && I + 1 < E) { + Args.push_back(CommandLine[I]); + Args.push_back(CommandLine[++I]); + } else if (Arg.startswith("=")) { + Args.push_back(CommandLine[I]); + } + } + } if (int RC = llvm::sys::ExecuteAndWait(Driver, Args, /*Env=*/llvm::None, Redirects)) { elog("System include extraction: driver execution failed with return code: " - "{0}", - llvm::to_string(RC)); + "{0}. Args: ['{1}']", + llvm::to_string(RC), llvm::join(Args, "', '")); return {}; } @@ -237,7 +267,7 @@ llvm::SmallString<128> Driver(Cmd->CommandLine.front()); llvm::sys::fs::make_absolute(Cmd->Directory, Driver); - auto Key = std::make_pair(Driver.str(), Lang); + auto Key = std::make_pair(Driver.str().str(), Lang.str()); std::vector<std::string> SystemIncludes; { @@ -247,8 +277,8 @@ if (It != DriverToIncludesCache.end()) SystemIncludes = It->second; else - DriverToIncludesCache[Key] = SystemIncludes = - extractSystemIncludes(Key.first, Key.second, QueryDriverRegex); + DriverToIncludesCache[Key] = SystemIncludes = extractSystemIncludes( + Key.first, Key.second, Cmd->CommandLine, QueryDriverRegex); } return addSystemIncludes(*Cmd, SystemIncludes); @@ -278,7 +308,7 @@ if (QueryDriverGlobs.empty()) return Base; return std::make_unique<QueryDriverDatabase>(QueryDriverGlobs, - std::move(Base)); + std::move(Base)); } } // namespace clangd diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/Selection.cpp new/clang-tools-extra-10.0.1.src/clangd/Selection.cpp --- old/clang-tools-extra-10.0.0.src/clangd/Selection.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/Selection.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -10,6 +10,7 @@ #include "Logger.h" #include "SourceCode.h" #include "clang/AST/ASTTypeTraits.h" +#include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" @@ -594,13 +595,23 @@ // Usually empty, but sometimes children cover tokens but shouldn't own them. SourceRange earlySourceRange(const DynTypedNode &N) { if (const Decl *D = N.get<Decl>()) { + // We want constructor name to be claimed by TypeLoc not the constructor + // itself. Similar for deduction guides, we rather want to select the + // underlying TypeLoc. + // FIXME: Unfortunately this doesn't work, even though RecursiveASTVisitor + // traverses the underlying TypeLoc inside DeclarationName, it is null for + // constructors. + if (isa<CXXConstructorDecl>(D) || isa<CXXDeductionGuideDecl>(D)) + return SourceRange(); + // This will capture Field, Function, MSProperty, NonTypeTemplateParm and + // VarDecls. We want the name in the declarator to be claimed by the decl + // and not by any children. For example: // void [[foo]](); - if (auto *FD = llvm::dyn_cast<FunctionDecl>(D)) - return FD->getNameInfo().getSourceRange(); // int (*[[s]])(); - else if (auto *VD = llvm::dyn_cast<VarDecl>(D)) - return VD->getLocation(); - } else if (const auto* CCI = N.get<CXXCtorInitializer>()) { + // struct X { int [[hash]] [32]; [[operator]] int();} + if (const auto *DD = llvm::dyn_cast<DeclaratorDecl>(D)) + return DD->getLocation(); + } else if (const auto *CCI = N.get<CXXCtorInitializer>()) { // : [[b_]](42) return CCI->getMemberLocation(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/Threading.cpp new/clang-tools-extra-10.0.1.src/clangd/Threading.cpp --- old/clang-tools-extra-10.0.0.src/clangd/Threading.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/Threading.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -1,5 +1,6 @@ #include "Threading.h" #include "Trace.h" +#include "clang/Basic/Stack.h" #include "llvm/ADT/ScopeExit.h" #include "llvm/Support/FormatVariadic.h" #include "llvm/Support/Threading.h" @@ -84,16 +85,16 @@ } }); - std::thread( - [](std::string Name, decltype(Action) Action, decltype(CleanupTask)) { - llvm::set_thread_name(Name); - Action(); - // Make sure function stored by Action is destroyed before CleanupTask - // is run. - Action = nullptr; - }, - Name.str(), std::move(Action), std::move(CleanupTask)) - .detach(); + auto Task = [Name = Name.str(), Action = std::move(Action), + Cleanup = std::move(CleanupTask)]() mutable { + llvm::set_thread_name(Name); + Action(); + // Make sure function stored by ThreadFunc is destroyed before Cleanup runs. + Action = nullptr; + }; + + // Ensure our worker threads have big enough stacks to run clang. + llvm::llvm_execute_on_thread_async(std::move(Task), clang::DesiredStackSize); } Deadline timeoutSeconds(llvm::Optional<double> Seconds) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/refactor/tweaks/DefineOutline.cpp new/clang-tools-extra-10.0.1.src/clangd/refactor/tweaks/DefineOutline.cpp --- old/clang-tools-extra-10.0.0.src/clangd/refactor/tweaks/DefineOutline.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/refactor/tweaks/DefineOutline.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -306,18 +306,16 @@ const syntax::TokenBuffer &TokBuf) { auto DeletionRange = FD->getBody()->getSourceRange(); if (auto *CD = llvm::dyn_cast<CXXConstructorDecl>(FD)) { - const auto &SM = TokBuf.sourceManager(); // AST doesn't contain the location for ":" in ctor initializers. Therefore // we find it by finding the first ":" before the first ctor initializer. SourceLocation InitStart; // Find the first initializer. for (const auto *CInit : CD->inits()) { - // We don't care about in-class initializers. - if (CInit->isInClassMemberInitializer()) + // SourceOrder is -1 for implicit initializers. + if (CInit->getSourceOrder() != 0) continue; - if (InitStart.isInvalid() || - SM.isBeforeInTranslationUnit(CInit->getSourceLocation(), InitStart)) - InitStart = CInit->getSourceLocation(); + InitStart = CInit->getSourceLocation(); + break; } if (InitStart.isValid()) { auto Toks = TokBuf.expandedTokens(CD->getSourceRange()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/test/dependency-output.test new/clang-tools-extra-10.0.1.src/clangd/test/dependency-output.test --- old/clang-tools-extra-10.0.0.src/clangd/test/dependency-output.test 1970-01-01 01:00:00.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/test/dependency-output.test 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,13 @@ +# UNSUPPORTED: windows-gnu,windows-msvc +# RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s +{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}} +--- +{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"compilationDatabaseChanges":{"/clangd-test/foo.c": +{"workingDirectory":"/clangd-test", "compilationCommand": ["clang", "-c", "-Xclang", "--show-includes", "-Xclang", "-sys-header-deps", "foo.c"]}}}}} +--- +{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///foo.c","languageId":"cpp","version":1,"text":"int a;\n#include <stddef.h>"}}} +#CHECK-NOT: Note: including file +--- +{"jsonrpc":"2.0","id":3,"method":"shutdown"} +--- +{"jsonrpc":"2.0","method":"exit"} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/test/system-include-extractor.test new/clang-tools-extra-10.0.1.src/clangd/test/system-include-extractor.test --- old/clang-tools-extra-10.0.0.src/clangd/test/system-include-extractor.test 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/test/system-include-extractor.test 2020-07-07 18:21:37.000000000 +0200 @@ -5,13 +5,17 @@ # Generate a mock-driver that will print %temp_dir%/my/dir and # %temp_dir%/my/dir2 as include search paths. -# RUN: echo '#!/bin/bash' >> %t.dir/my_driver.sh +# RUN: echo '#!/bin/sh' >> %t.dir/my_driver.sh # RUN: echo '[ "$0" = "%t.dir/my_driver.sh" ] || exit' >> %t.dir/my_driver.sh +# RUN: echo 'args="$*"' >> %t.dir/my_driver.sh +# RUN: echo '[ -z "${args##*"-nostdinc"*}" ] || exit' >> %t.dir/my_driver.sh +# RUN: echo '[ -z "${args##*"-isysroot=/isysroot"*}" ] || exit' >> %t.dir/my_driver.sh +# RUN: echo 'echo " $* " | grep " --sysroot /my/sysroot/path " || exit' >> %t.dir/my_driver.sh # RUN: echo 'echo line to ignore >&2' >> %t.dir/my_driver.sh -# RUN: echo 'echo -e "#include <...> search starts here:\r" >&2' >> %t.dir/my_driver.sh +# RUN: echo 'printf "#include <...> search starts here:\r\n" >&2' >> %t.dir/my_driver.sh # RUN: echo 'echo %t.dir/my/dir/ >&2' >> %t.dir/my_driver.sh # RUN: echo 'echo %t.dir/my/dir2/ >&2' >> %t.dir/my_driver.sh -# RUN: echo 'echo -e "End of search list.\r" >&2' >> %t.dir/my_driver.sh +# RUN: echo 'printf "End of search list.\r\n" >&2' >> %t.dir/my_driver.sh # RUN: chmod +x %t.dir/my_driver.sh # Create header files my/dir/a.h and my/dir2/b.h @@ -22,7 +26,7 @@ # Generate a compile_commands.json that will query the mock driver we've # created. Which should add a.h and b.h into include search path. -# RUN: echo '[{"directory": "%/t.dir", "command": "%/t.dir/my_driver.sh the-file.cpp", "file": "the-file.cpp"}]' > %t.dir/compile_commands.json +# RUN: echo '[{"directory": "%/t.dir", "command": "%/t.dir/my_driver.sh the-file.cpp -nostdinc --sysroot /my/sysroot/path -isysroot=/isysroot", "file": "the-file.cpp"}]' > %t.dir/compile_commands.json # RUN: sed -e "s|INPUT_DIR|%/t.dir|g" %s > %t.test.1 # On Windows, we need the URI in didOpen to look like "uri":"file:///C:/..." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/unittests/ClangdTests.cpp new/clang-tools-extra-10.0.1.src/clangd/unittests/ClangdTests.cpp --- old/clang-tools-extra-10.0.0.src/clangd/unittests/ClangdTests.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/unittests/ClangdTests.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -1063,6 +1063,27 @@ Field(&CodeCompletion::Scope, "ns::")))); } +TEST_F(ClangdVFSTest, TestStackOverflow) { + MockFSProvider FS; + ErrorCheckingDiagConsumer DiagConsumer; + MockCompilationDatabase CDB; + ClangdServer Server(CDB, FS, DiagConsumer, ClangdServer::optsForTest()); + + const char *SourceContents = R"cpp( + constexpr int foo() { return foo(); } + static_assert(foo()); + )cpp"; + + auto FooCpp = testPath("foo.cpp"); + FS.Files[FooCpp] = SourceContents; + + Server.addDocument(FooCpp, SourceContents); + ASSERT_TRUE(Server.blockUntilIdleForTest()) << "Waiting for diagnostics"; + // check that we got a constexpr depth error, and not crashed by stack + // overflow + EXPECT_TRUE(DiagConsumer.hadErrorInLastDiags()); +} + } // namespace } // namespace clangd } // namespace clang diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/unittests/CodeCompleteTests.cpp new/clang-tools-extra-10.0.1.src/clangd/unittests/CodeCompleteTests.cpp --- old/clang-tools-extra-10.0.0.src/clangd/unittests/CodeCompleteTests.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/unittests/CodeCompleteTests.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -2681,6 +2681,17 @@ ElementsAre(AllOf(ReturnType("int"), Named("size")))); } +TEST(CompletionTest, NoCrashWithIncompleteLambda) { + auto Completions = completions("auto&& x = []{^").Completions; + // The completion of x itself can cause a problem: in the code completion + // callback, its type is not known, which affects the linkage calculation. + // A bad linkage value gets cached, and subsequently updated. + EXPECT_THAT(Completions, Contains(Named("x"))); + + auto Signatures = signatures("auto x() { x(^").signatures; + EXPECT_THAT(Signatures, Contains(Sig("x() -> auto"))); +} + TEST(NoCompileCompletionTest, Basic) { auto Results = completionsNoCompile(R"cpp( void func() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/unittests/DiagnosticsTests.cpp new/clang-tools-extra-10.0.1.src/clangd/unittests/DiagnosticsTests.cpp --- old/clang-tools-extra-10.0.0.src/clangd/unittests/DiagnosticsTests.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/unittests/DiagnosticsTests.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -266,6 +266,33 @@ )); } +TEST(DiagnosticTest, NoMultipleDiagnosticInFlight) { + Annotations Main(R"cpp( + template <typename T> struct Foo { + T *begin(); + T *end(); + }; + struct LabelInfo { + int a; + bool b; + }; + + void f() { + Foo<LabelInfo> label_info_map; + [[for]] (auto it = label_info_map.begin(); it != label_info_map.end(); ++it) { + auto S = *it; + } + } + )cpp"); + TestTU TU = TestTU::withCode(Main.code()); + TU.ClangTidyChecks = "modernize-loop-convert"; + EXPECT_THAT( + TU.build().getDiagnostics(), + UnorderedElementsAre(::testing::AllOf( + Diag(Main.range(), "use range-based for loop instead"), + DiagSource(Diag::ClangTidy), DiagName("modernize-loop-convert")))); +} + TEST(DiagnosticTest, ClangTidySuppressionComment) { Annotations Main(R"cpp( int main() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/unittests/FindSymbolsTests.cpp new/clang-tools-extra-10.0.1.src/clangd/unittests/FindSymbolsTests.cpp --- old/clang-tools-extra-10.0.0.src/clangd/unittests/FindSymbolsTests.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/unittests/FindSymbolsTests.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -449,6 +449,15 @@ SymNameRange(Main.range("def"))))); } +TEST_F(DocumentSymbolsTest, Concepts) { + CDB.ExtraClangFlags = {"-std=c++2a"}; + std::string FilePath = testPath("foo.cpp"); + addFile(FilePath, + "template <typename T> concept C = requires(T t) { t.foo(); };"); + + EXPECT_THAT(getSymbols(FilePath), ElementsAre(WithName("C"))); +} + TEST_F(DocumentSymbolsTest, ExternSymbol) { std::string FilePath = testPath("foo.cpp"); addFile(testPath("foo.h"), R"cpp( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/unittests/FindTargetTests.cpp new/clang-tools-extra-10.0.1.src/clangd/unittests/FindTargetTests.cpp --- old/clang-tools-extra-10.0.0.src/clangd/unittests/FindTargetTests.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/unittests/FindTargetTests.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -242,6 +242,13 @@ )cpp"; EXPECT_DECLS("TypedefTypeLoc", {"typedef S X", Rel::Alias}, {"struct S", Rel::Underlying}); + Code = R"cpp( + namespace ns { struct S{}; } + typedef ns::S X; + [[X]] x; + )cpp"; + EXPECT_DECLS("TypedefTypeLoc", {"typedef ns::S X", Rel::Alias}, + {"struct S", Rel::Underlying}); // FIXME: Auto-completion in a template requires disabling delayed template // parsing. @@ -286,6 +293,14 @@ )cpp"; // FIXME: We don't do a good job printing TemplateTypeParmDecls, apparently! EXPECT_DECLS("SizeOfPackExpr", ""); + + Code = R"cpp( + template <typename T> + class Foo { + void f([[Foo]] x); + }; + )cpp"; + EXPECT_DECLS("InjectedClassNameTypeLoc", "class Foo"); } TEST_F(TargetDeclTest, ClassTemplate) { @@ -574,12 +589,21 @@ auto *TestDecl = &findDecl(AST, "foo"); if (auto *T = llvm::dyn_cast<FunctionTemplateDecl>(TestDecl)) TestDecl = T->getTemplatedDecl(); - auto &Func = llvm::cast<FunctionDecl>(*TestDecl); std::vector<ReferenceLoc> Refs; - findExplicitReferences(Func.getBody(), [&Refs](ReferenceLoc R) { - Refs.push_back(std::move(R)); - }); + if (const auto *Func = llvm::dyn_cast<FunctionDecl>(TestDecl)) + findExplicitReferences(Func->getBody(), [&Refs](ReferenceLoc R) { + Refs.push_back(std::move(R)); + }); + else if (const auto *NS = llvm::dyn_cast<NamespaceDecl>(TestDecl)) + findExplicitReferences(NS, [&Refs, &NS](ReferenceLoc R) { + // Avoid adding the namespace foo decl to the results. + if (R.Targets.size() == 1 && R.Targets.front() == NS) + return; + Refs.push_back(std::move(R)); + }); + else + ADD_FAILURE() << "Failed to find ::foo decl for test"; auto &SM = AST.getSourceManager(); llvm::sort(Refs, [&](const ReferenceLoc &L, const ReferenceLoc &R) { @@ -969,7 +993,24 @@ } )cpp", "0: targets = {Test}\n" - "1: targets = {a}, decl\n"}}; + "1: targets = {a}, decl\n"}, + // unknown template name should not crash. + // duplicate $1$2 is fixed on master. + {R"cpp( + template <template <typename> typename T> + struct Base {}; + namespace foo { + template <typename $0^T> + struct $1^$2^Derive : $3^Base<$4^T::template $5^Unknown> {}; + } + )cpp", + "0: targets = {foo::Derive::T}, decl\n" + "1: targets = {foo::Derive}, decl\n" + "2: targets = {foo::Derive}, decl\n" + "3: targets = {Base}\n" + "4: targets = {foo::Derive::T}\n" + "5: targets = {}, qualifier = 'T::'\n"}, + }; for (const auto &C : Cases) { llvm::StringRef ExpectedCode = C.first; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/unittests/HoverTests.cpp new/clang-tools-extra-10.0.1.src/clangd/unittests/HoverTests.cpp --- old/clang-tools-extra-10.0.0.src/clangd/unittests/HoverTests.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/unittests/HoverTests.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -339,7 +339,7 @@ HI.Definition = "~X()"; HI.Parameters.emplace(); }}, - {"class X { operator [[in^t]](); };", + {"class X { [[op^erator]] int(); };", [](HoverInfo &HI) { HI.NamespaceScope = ""; HI.Name = "operator int"; @@ -348,6 +348,13 @@ HI.Definition = "operator int()"; HI.Parameters.emplace(); }}, + {"class X { operator [[^X]]*(); };", + [](HoverInfo &HI) { + HI.NamespaceScope = ""; + HI.Name = "X"; + HI.Kind = index::SymbolKind::Class; + HI.Definition = "class X {}"; + }}, // auto on lambda {R"cpp( @@ -1615,6 +1622,22 @@ HI.Type = "unsigned long"; HI.Value = "1"; }}, + { + R"cpp( + template <typename T = int> + void foo(const T& = T()) { + [[f^oo]]<>(3); + })cpp", + [](HoverInfo &HI) { + HI.Name = "foo"; + HI.Kind = index::SymbolKind::Function; + HI.Type = "void (const int &)"; + HI.ReturnType = "void"; + HI.Parameters = { + {std::string("const int &"), llvm::None, std::string("T()")}}; + HI.Definition = "template <> void foo<int>(const int &)"; + HI.NamespaceScope = ""; + }}, }; // Create a tiny index, so tests above can verify documentation is fetched. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/unittests/SelectionTests.cpp new/clang-tools-extra-10.0.1.src/clangd/unittests/SelectionTests.cpp --- old/clang-tools-extra-10.0.0.src/clangd/unittests/SelectionTests.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/unittests/SelectionTests.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -329,6 +329,12 @@ decltype([[^a]] + a) b; )cpp", "DeclRefExpr"}, + + {"struct foo { [[int has^h<:32:>]]; };", "FieldDecl"}, + {"struct foo { [[op^erator int()]]; };", "CXXConversionDecl"}, + {"struct foo { [[^~foo()]]; };", "CXXDestructorDecl"}, + // FIXME: The following to should be class itself instead. + {"struct foo { [[fo^o(){}]] };", "CXXConstructorDecl"}, }; for (const Case &C : Cases) { Annotations Test(C.Code); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clang-tools-extra-10.0.0.src/clangd/unittests/TweakTests.cpp new/clang-tools-extra-10.0.1.src/clangd/unittests/TweakTests.cpp --- old/clang-tools-extra-10.0.0.src/clangd/unittests/TweakTests.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/clang-tools-extra-10.0.1.src/clangd/unittests/TweakTests.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -2047,21 +2047,57 @@ "void foo(int x, int y = 5, int = 2, int (*foo)(int) = nullptr) ;", "void foo(int x, int y , int , int (*foo)(int) ) {}", }, - // Ctor initializers. + // Constructors + { + R"cpp( + class Foo {public: Foo(); Foo(int);}; + class Bar { + Ba^r() {} + Bar(int x) : f1(x) {} + Foo f1; + Foo f2 = 2; + };)cpp", + R"cpp( + class Foo {public: Foo(); Foo(int);}; + class Bar { + Bar() ; + Bar(int x) : f1(x) {} + Foo f1; + Foo f2 = 2; + };)cpp", + "Bar::Bar() {}\n", + }, + // Ctor with initializer. + { + R"cpp( + class Foo {public: Foo(); Foo(int);}; + class Bar { + Bar() {} + B^ar(int x) : f1(x), f2(3) {} + Foo f1; + Foo f2 = 2; + };)cpp", + R"cpp( + class Foo {public: Foo(); Foo(int);}; + class Bar { + Bar() {} + Bar(int x) ; + Foo f1; + Foo f2 = 2; + };)cpp", + "Bar::Bar(int x) : f1(x), f2(3) {}\n", + }, + // Ctor initializer with attribute. { R"cpp( class Foo { - int y = 2; F^oo(int z) __attribute__((weak)) : bar(2){} int bar; - int z = 2; };)cpp", R"cpp( class Foo { - int y = 2; Foo(int z) __attribute__((weak)) ; int bar; - int z = 2; };)cpp", "Foo::Foo(int z) __attribute__((weak)) : bar(2){}\n", }, ++++++ compiler-rt-10.0.0.src.tar.xz -> compiler-rt-10.0.1.src.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compiler-rt-10.0.0.src/lib/builtins/riscv/int_mul_impl.inc new/compiler-rt-10.0.1.src/lib/builtins/riscv/int_mul_impl.inc --- old/compiler-rt-10.0.0.src/lib/builtins/riscv/int_mul_impl.inc 1970-01-01 01:00:00.000000000 +0100 +++ new/compiler-rt-10.0.1.src/lib/builtins/riscv/int_mul_impl.inc 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,31 @@ +//===-- int_mul_impl.inc - Integer multiplication -------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// Helpers used by __mulsi3, __muldi3. +// +//===----------------------------------------------------------------------===// + +#if !defined(__riscv_mul) + .text + .align 2 + + .globl __mulxi3 + .type __mulxi3, @function +__mulxi3: + mv a2, a0 + mv a0, zero +.L1: + andi a3, a1, 1 + beqz a3, .L2 + add a0, a0, a2 +.L2: + srli a1, a1, 1 + slli a2, a2, 1 + bnez a1, .L1 + ret +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compiler-rt-10.0.0.src/lib/builtins/riscv/muldi3.S new/compiler-rt-10.0.1.src/lib/builtins/riscv/muldi3.S --- old/compiler-rt-10.0.0.src/lib/builtins/riscv/muldi3.S 1970-01-01 01:00:00.000000000 +0100 +++ new/compiler-rt-10.0.1.src/lib/builtins/riscv/muldi3.S 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,11 @@ +//===--- muldi3.S - Integer multiplication routines -----------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#if __riscv_xlen == 64 +#define __mulxi3 __muldi3 +#include "int_mul_impl.inc" +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compiler-rt-10.0.0.src/lib/builtins/riscv/mulsi3.S new/compiler-rt-10.0.1.src/lib/builtins/riscv/mulsi3.S --- old/compiler-rt-10.0.0.src/lib/builtins/riscv/mulsi3.S 2020-03-23 16:01:02.000000000 +0100 +++ new/compiler-rt-10.0.1.src/lib/builtins/riscv/mulsi3.S 2020-07-07 18:21:37.000000000 +0200 @@ -1,4 +1,4 @@ -//===--- mulsi3.S - Integer multiplication routines routines ---===// +//===--- mulsi3.S - Integer multiplication routines -----------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -6,22 +6,7 @@ // //===----------------------------------------------------------------------===// -#if !defined(__riscv_mul) && __riscv_xlen == 32 - .text - .align 2 - - .globl __mulsi3 - .type __mulsi3, @function -__mulsi3: - mv a2, a0 - mv a0, zero -.L1: - andi a3, a1, 1 - beqz a3, .L2 - add a0, a0, a2 -.L2: - srli a1, a1, 1 - slli a2, a2, 1 - bnez a1, .L1 - ret +#if __riscv_xlen == 32 +#define __mulxi3 __mulsi3 +#include "int_mul_impl.inc" #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compiler-rt-10.0.0.src/lib/profile/GCDAProfiling.c new/compiler-rt-10.0.1.src/lib/profile/GCDAProfiling.c --- old/compiler-rt-10.0.0.src/lib/profile/GCDAProfiling.c 2020-03-23 16:01:02.000000000 +0100 +++ new/compiler-rt-10.0.1.src/lib/profile/GCDAProfiling.c 2020-07-07 18:21:37.000000000 +0200 @@ -32,8 +32,10 @@ #include <windows.h> #include "WindowsMMap.h" #else -#include <sys/mman.h> #include <sys/file.h> +#include <sys/mman.h> +#include <sys/types.h> +#include <unistd.h> #endif #if defined(__FreeBSD__) && defined(__i386__) @@ -119,6 +121,11 @@ */ struct fn_list flush_fn_list; +/* + * A list of reset functions, shared between all dynamic objects. + */ +struct fn_list reset_fn_list; + static void fn_list_insert(struct fn_list* list, fn_ptr fn) { struct fn_node* new_node = malloc(sizeof(struct fn_node)); new_node->fn = fn; @@ -634,7 +641,46 @@ } COMPILER_RT_VISIBILITY -void llvm_gcov_init(fn_ptr wfn, fn_ptr ffn) { +void llvm_register_reset_function(fn_ptr fn) { + fn_list_insert(&reset_fn_list, fn); +} + +COMPILER_RT_VISIBILITY +void llvm_delete_reset_function_list(void) { fn_list_remove(&reset_fn_list); } + +COMPILER_RT_VISIBILITY +void llvm_reset_counters(void) { + struct fn_node *curr = reset_fn_list.head; + + while (curr) { + if (curr->id == CURRENT_ID) { + curr->fn(); + } + curr = curr->next; + } +} + +#if !defined(_WIN32) +COMPILER_RT_VISIBILITY +pid_t __gcov_fork() { + pid_t parent_pid = getpid(); + pid_t pid = fork(); + + if (pid == 0) { + pid_t child_pid = getpid(); + if (child_pid != parent_pid) { + // The pid changed so we've a fork (one could have its own fork function) + // Just reset the counters for this child process + // threads. + llvm_reset_counters(); + } + } + return pid; +} +#endif + +COMPILER_RT_VISIBILITY +void llvm_gcov_init(fn_ptr wfn, fn_ptr ffn, fn_ptr rfn) { static int atexit_ran = 0; if (wfn) @@ -643,10 +689,14 @@ if (ffn) llvm_register_flush_function(ffn); + if (rfn) + llvm_register_reset_function(rfn); + if (atexit_ran == 0) { atexit_ran = 1; /* Make sure we write out the data and delete the data structures. */ + atexit(llvm_delete_reset_function_list); atexit(llvm_delete_flush_function_list); atexit(llvm_delete_writeout_function_list); atexit(llvm_writeout_files); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compiler-rt-10.0.0.src/test/profile/Inputs/instrprof-gcov-multithread_fork.cpp new/compiler-rt-10.0.1.src/test/profile/Inputs/instrprof-gcov-multithread_fork.cpp --- old/compiler-rt-10.0.0.src/test/profile/Inputs/instrprof-gcov-multithread_fork.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/compiler-rt-10.0.1.src/test/profile/Inputs/instrprof-gcov-multithread_fork.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,25 @@ +#include <sys/types.h> +#include <thread> +#include <unistd.h> + +template <typename T> +void launcher(T func) { + auto t1 = std::thread(func); + auto t2 = std::thread(func); + + t1.join(); + t2.join(); +} + +void g() {} + +void f() { + fork(); + launcher<>(g); +} + +int main() { + launcher<>(f); + + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compiler-rt-10.0.0.src/test/profile/instrprof-gcov-multithread_fork.test new/compiler-rt-10.0.1.src/test/profile/instrprof-gcov-multithread_fork.test --- old/compiler-rt-10.0.0.src/test/profile/instrprof-gcov-multithread_fork.test 1970-01-01 01:00:00.000000000 +0100 +++ new/compiler-rt-10.0.1.src/test/profile/instrprof-gcov-multithread_fork.test 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,11 @@ +UNSUPPORTED: windows + +RUN: mkdir -p %t.d +RUN: cd %t.d + +RUN: %clangxx --coverage -lpthread -o %t %S/Inputs/instrprof-gcov-multithread_fork.cpp +RUN: test -f instrprof-gcov-multithread_fork.gcno + +RUN: rm -f instrprof-gcov-multithread_fork.gcda +RUN: %run %t +RUN: llvm-cov gcov instrprof-gcov-multithread_fork.gcda ++++++ fix-atomics-test.patch ++++++ >From 0781e93a6eaa71ec5d87be3bbeeeed053067f7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Marques?= <luismarq...@lowrisc.org> Date: Fri, 21 Feb 2020 19:26:09 +0000 Subject: [PATCH] [CodeGen][RISCV] Fix clang/test/CodeGen/atomic_ops.c for RISC-V By default the RISC-V target doesn't have the atomics standard extension enabled. The first RUN line in `clang/test/CodeGen/atomic_ops.c` didn't specify a target triple, which meant that on RISC-V Linux hosts it would target RISC-V, but because it used clang cc1 we didn't get the toolchain driver functionality to automatically turn on the extensions implied by the target triple (riscv64-linux includes atomics). This would cause the test to fail on RISC-V hosts. This patch changes the test to have RUN lines for two explicit targets, one with native atomics and one without. To work around FileCheck limitations and more accurately match the output, some tests now have separate prefixes for the two cases. Reviewers: jyknight, eli.friedman, lenary, efriedma Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D74847 --- test/CodeGen/atomic_ops.c | 55 +++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/test/CodeGen/atomic_ops.c b/test/CodeGen/atomic_ops.c index a853ba9f739..c1eb1d005db 100644 --- a/test/CodeGen/atomic_ops.c +++ b/test/CodeGen/atomic_ops.c @@ -1,7 +1,7 @@ -// XFAIL: hexagon,sparc -// (due to not having native load atomic support) -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s -// RUN: %clang_cc1 -triple mips-linux-gnu -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64 -emit-llvm %s \ +// RUN: -o - | FileCheck -check-prefixes=CHECK,NATIVE %s +// RUN: %clang_cc1 -triple riscv32 -target-feature -a -emit-llvm %s \ +// RUN: -o - | FileCheck -check-prefixes=CHECK,LIBCALL %s void foo(int x) { @@ -9,32 +9,47 @@ void foo(int x) _Atomic(short) j = 0; // Check that multiply / divides on atomics produce a cmpxchg loop i *= 2; - // CHECK: mul nsw i32 - // CHECK: {{(cmpxchg i32*|i1 @__atomic_compare_exchange\(i32 4,)}} + // NATIVE: mul nsw i32 + // NATIVE: cmpxchg i32* + // LIBCALL: mul nsw i32 + // LIBCALL: i1 @__atomic_compare_exchange(i32 4, i /= 2; - // CHECK: sdiv i32 - // CHECK: {{(cmpxchg i32*|i1 @__atomic_compare_exchange\(i32 4, )}} + // NATIVE: sdiv i32 + // NATIVE: cmpxchg i32* + // LIBCALL: sdiv i32 + // LIBCALL: i1 @__atomic_compare_exchange(i32 4, j /= x; - // CHECK: sdiv i32 - // CHECK: {{(cmpxchg i16*|i1 @__atomic_compare_exchange\(i32 2, )}} + // NATIVE: sdiv i32 + // NATIVE: cmpxchg i16* + // LIBCALL: sdiv i32 + // LIBCALL: i1 @__atomic_compare_exchange(i32 2, } extern _Atomic _Bool b; _Bool bar() { -// CHECK-LABEL: @bar -// CHECK: %[[load:.*]] = load atomic i8, i8* @b seq_cst -// CHECK: %[[tobool:.*]] = trunc i8 %[[load]] to i1 -// CHECK: ret i1 %[[tobool]] +// NATIVE-LABEL: @bar +// NATIVE: %[[load:.*]] = load atomic i8, i8* @b seq_cst +// NATIVE: %[[tobool:.*]] = trunc i8 %[[load]] to i1 +// NATIVE: ret i1 %[[tobool]] +// LIBCALL-LABEL: @bar +// LIBCALL: call void @__atomic_load(i32 1, i8* @b, i8* %atomic-temp, i32 5) +// LIBCALL: %[[load:.*]] = load i8, i8* %atomic-temp +// LIBCALL: %[[tobool:.*]] = trunc i8 %[[load]] to i1 +// LIBCALL: ret i1 %[[tobool]] + return b; } extern _Atomic(_Complex int) x; void baz(int y) { -// CHECK-LABEL: @baz -// CHECK: {{store atomic|call void @__atomic_store}} +// NATIVE-LABEL: @baz +// NATIVE: store atomic +// LIBCALL-LABEL: @baz +// LIBCALL: call void @__atomic_store + x += y; } @@ -84,9 +99,11 @@ _Atomic(int) compound_and(_Atomic(int) in) { } _Atomic(int) compound_mul(_Atomic(int) in) { -// CHECK-LABEL: @compound_mul -// CHECK: cmpxchg i32* {{%.*}}, i32 {{%.*}}, i32 [[NEW:%.*]] seq_cst seq_cst -// CHECK: ret i32 [[NEW]] +// NATIVE-LABEL: @compound_mul +// NATIVE: cmpxchg i32* {{%.*}}, i32 {{%.*}}, i32 [[NEW:%.*]] seq_cst seq_cst +// NATIVE: ret i32 [[NEW]] +// LIBCALL-LABEL: @compound_mul +// LIBCALL: i1 @__atomic_compare_exchange(i32 4, return (in *= 5); } -- 2.27.0 ++++++ libcxx-10.0.0.src.tar.xz -> libcxx-10.0.1.src.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxx-10.0.0.src/CMakeLists.txt new/libcxx-10.0.1.src/CMakeLists.txt --- old/libcxx-10.0.0.src/CMakeLists.txt 2020-03-23 16:01:02.000000000 +0100 +++ new/libcxx-10.0.1.src/CMakeLists.txt 2020-07-07 18:21:37.000000000 +0200 @@ -27,7 +27,7 @@ project(libcxx CXX C) set(PACKAGE_NAME libcxx) - set(PACKAGE_VERSION 10.0.0) + set(PACKAGE_VERSION 10.0.1) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvm-b...@lists.llvm.org") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxx-10.0.0.src/include/array new/libcxx-10.0.1.src/include/array --- old/libcxx-10.0.0.src/include/array 2020-03-23 16:01:02.000000000 +0100 +++ new/libcxx-10.0.1.src/include/array 2020-07-07 18:21:37.000000000 +0200 @@ -359,7 +359,7 @@ #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES template<class _Tp, class... _Args, - class = typename enable_if<(is_same_v<_Tp, _Args> && ...), void>::type + class = _EnableIf<__all<_IsSame<_Tp, _Args>::value...>::value> > array(_Tp, _Args...) -> array<_Tp, 1 + sizeof...(_Args)>; ++++++ libcxxabi-10.0.0.src.tar.xz -> libcxxabi-10.0.1.src.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxxabi-10.0.0.src/CMakeLists.txt new/libcxxabi-10.0.1.src/CMakeLists.txt --- old/libcxxabi-10.0.0.src/CMakeLists.txt 2020-03-23 16:01:02.000000000 +0100 +++ new/libcxxabi-10.0.1.src/CMakeLists.txt 2020-07-07 18:21:37.000000000 +0200 @@ -21,7 +21,7 @@ project(libcxxabi CXX C) set(PACKAGE_NAME libcxxabi) - set(PACKAGE_VERSION 10.0.0) + set(PACKAGE_VERSION 10.0.1) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvm-b...@lists.llvm.org") ++++++ lld-10.0.0.src.tar.xz -> lld-10.0.1.src.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/COFF/Chunks.h new/lld-10.0.1.src/COFF/Chunks.h --- old/lld-10.0.0.src/COFF/Chunks.h 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/COFF/Chunks.h 2020-07-07 18:21:37.000000000 +0200 @@ -486,7 +486,9 @@ class ImportThunkChunkARM : public ImportThunkChunk { public: - explicit ImportThunkChunkARM(Defined *s) : ImportThunkChunk(s) {} + explicit ImportThunkChunkARM(Defined *s) : ImportThunkChunk(s) { + setAlignment(2); + } size_t getSize() const override { return sizeof(importThunkARM); } void getBaserels(std::vector<Baserel> *res) override; void writeTo(uint8_t *buf) const override; @@ -494,14 +496,16 @@ class ImportThunkChunkARM64 : public ImportThunkChunk { public: - explicit ImportThunkChunkARM64(Defined *s) : ImportThunkChunk(s) {} + explicit ImportThunkChunkARM64(Defined *s) : ImportThunkChunk(s) { + setAlignment(4); + } size_t getSize() const override { return sizeof(importThunkARM64); } void writeTo(uint8_t *buf) const override; }; class RangeExtensionThunkARM : public NonSectionChunk { public: - explicit RangeExtensionThunkARM(Defined *t) : target(t) {} + explicit RangeExtensionThunkARM(Defined *t) : target(t) { setAlignment(2); } size_t getSize() const override; void writeTo(uint8_t *buf) const override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/COFF/DLL.cpp new/lld-10.0.1.src/COFF/DLL.cpp --- old/lld-10.0.0.src/COFF/DLL.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/COFF/DLL.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -365,7 +365,9 @@ class ThunkChunkARM : public NonSectionChunk { public: - ThunkChunkARM(Defined *i, Chunk *tm) : imp(i), tailMerge(tm) {} + ThunkChunkARM(Defined *i, Chunk *tm) : imp(i), tailMerge(tm) { + setAlignment(2); + } size_t getSize() const override { return sizeof(thunkARM); } @@ -385,7 +387,9 @@ class TailMergeChunkARM : public NonSectionChunk { public: - TailMergeChunkARM(Chunk *d, Defined *h) : desc(d), helper(h) {} + TailMergeChunkARM(Chunk *d, Defined *h) : desc(d), helper(h) { + setAlignment(2); + } size_t getSize() const override { return sizeof(tailMergeARM); } @@ -405,7 +409,9 @@ class ThunkChunkARM64 : public NonSectionChunk { public: - ThunkChunkARM64(Defined *i, Chunk *tm) : imp(i), tailMerge(tm) {} + ThunkChunkARM64(Defined *i, Chunk *tm) : imp(i), tailMerge(tm) { + setAlignment(4); + } size_t getSize() const override { return sizeof(thunkARM64); } @@ -422,7 +428,9 @@ class TailMergeChunkARM64 : public NonSectionChunk { public: - TailMergeChunkARM64(Chunk *d, Defined *h) : desc(d), helper(h) {} + TailMergeChunkARM64(Chunk *d, Defined *h) : desc(d), helper(h) { + setAlignment(4); + } size_t getSize() const override { return sizeof(tailMergeARM64); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/COFF/MarkLive.cpp new/lld-10.0.1.src/COFF/MarkLive.cpp --- old/lld-10.0.0.src/COFF/MarkLive.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/COFF/MarkLive.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -28,10 +28,12 @@ // as we push, so sections never appear twice in the list. SmallVector<SectionChunk *, 256> worklist; - // COMDAT section chunks are dead by default. Add non-COMDAT chunks. + // COMDAT section chunks are dead by default. Add non-COMDAT chunks. Do not + // traverse DWARF sections. They are live, but they should not keep other + // sections alive. for (Chunk *c : chunks) if (auto *sc = dyn_cast<SectionChunk>(c)) - if (sc->live) + if (sc->live && !sc->isDWARF()) worklist.push_back(sc); auto enqueue = [&](SectionChunk *c) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/Common/CMakeLists.txt new/lld-10.0.1.src/Common/CMakeLists.txt --- old/lld-10.0.0.src/Common/CMakeLists.txt 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/Common/CMakeLists.txt 2020-07-07 18:21:37.000000000 +0200 @@ -8,14 +8,14 @@ set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc") set(generate_vcs_version_script "${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake") -if(lld_vc) +if(lld_vc AND LLVM_APPEND_VC_REV) set(lld_source_dir ${LLD_SOURCE_DIR}) endif() add_custom_command(OUTPUT "${version_inc}" DEPENDS "${lld_vc}" "${generate_vcs_version_script}" COMMAND ${CMAKE_COMMAND} "-DNAMES=LLD" - "-DLLD_SOURCE_DIR=${LLD_SOURCE_DIR}" + "-DLLD_SOURCE_DIR=${lld_source_dir}" "-DHEADER_FILE=${version_inc}" -P "${generate_vcs_version_script}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/ELF/Driver.cpp new/lld-10.0.1.src/ELF/Driver.cpp --- old/lld-10.0.0.src/ELF/Driver.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/ELF/Driver.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -1906,8 +1906,17 @@ // We do not want to emit debug sections if --strip-all // or -strip-debug are given. - return config->strip != StripPolicy::None && - (s->name.startswith(".debug") || s->name.startswith(".zdebug")); + if (config->strip == StripPolicy::None) + return false; + + if (isDebugSection(*s)) + return true; + if (auto *isec = dyn_cast<InputSection>(s)) + if (InputSectionBase *rel = isec->getRelocatedSection()) + if (isDebugSection(*rel)) + return true; + + return false; }); // Now that the number of partitions is fixed, save a pointer to the main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/ELF/InputSection.cpp new/lld-10.0.1.src/ELF/InputSection.cpp --- old/lld-10.0.0.src/ELF/InputSection.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/ELF/InputSection.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -441,8 +441,7 @@ // See the comment in maybeReportUndefined for PPC64 .toc . auto *d = dyn_cast<Defined>(&sym); if (!d) { - if (!sec->name.startswith(".debug") && - !sec->name.startswith(".zdebug") && sec->name != ".eh_frame" && + if (!isDebugSection(*sec) && sec->name != ".eh_frame" && sec->name != ".gcc_except_table" && sec->name != ".toc") { uint32_t secIdx = cast<Undefined>(sym).discardedSecIdx; Elf_Shdr_Impl<ELFT> sec = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/ELF/InputSection.h new/lld-10.0.1.src/ELF/InputSection.h --- old/lld-10.0.0.src/ELF/InputSection.h 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/ELF/InputSection.h 2020-07-07 18:21:37.000000000 +0200 @@ -357,6 +357,10 @@ template <class ELFT> void copyShtGroup(uint8_t *buf); }; +inline bool isDebugSection(const InputSectionBase &sec) { + return sec.name.startswith(".debug") || sec.name.startswith(".zdebug"); +} + // The list of all input sections. extern std::vector<InputSectionBase *> inputSections; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/ELF/OutputSections.cpp new/lld-10.0.1.src/ELF/OutputSections.cpp --- old/lld-10.0.0.src/ELF/OutputSections.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/ELF/OutputSections.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -114,8 +114,7 @@ flags = isec->flags; } else { // Otherwise, check if new type or flags are compatible with existing ones. - unsigned mask = SHF_TLS | SHF_LINK_ORDER; - if ((flags & mask) != (isec->flags & mask)) + if ((flags ^ isec->flags) & SHF_TLS) error("incompatible section flags for " + name + "\n>>> " + toString(isec) + ": 0x" + utohexstr(isec->flags) + "\n>>> output section " + name + ": 0x" + utohexstr(flags)); @@ -367,8 +366,9 @@ // all InputSections in the OutputSection have the same dependency. if (auto *ex = dyn_cast<ARMExidxSyntheticSection>(first)) link = ex->getLinkOrderDep()->getParent()->sectionIndex; - else if (auto *d = first->getLinkOrderDep()) - link = d->getParent()->sectionIndex; + else if (first->flags & SHF_LINK_ORDER) + if (auto *d = first->getLinkOrderDep()) + link = d->getParent()->sectionIndex; } if (type == SHT_GROUP) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/ELF/ScriptLexer.cpp new/lld-10.0.1.src/ELF/ScriptLexer.cpp --- old/lld-10.0.0.src/ELF/ScriptLexer.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/ELF/ScriptLexer.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -52,6 +52,8 @@ // Returns 1-based line number of the current token. size_t ScriptLexer::getLineNumber() { + if (pos == 0) + return 1; StringRef s = getCurrentMB().getBuffer(); StringRef tok = tokens[pos - 1]; return s.substr(0, tok.data() - s.data()).count('\n') + 1; @@ -292,7 +294,9 @@ MemoryBufferRef ScriptLexer::getCurrentMB() { // Find input buffer containing the current token. - assert(!mbs.empty() && pos > 0); + assert(!mbs.empty()); + if (pos == 0) + return mbs.back(); for (MemoryBufferRef mb : mbs) if (encloses(mb.getBuffer(), tokens[pos - 1])) return mb; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/ELF/ScriptParser.cpp new/lld-10.0.1.src/ELF/ScriptParser.cpp --- old/lld-10.0.0.src/ELF/ScriptParser.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/ELF/ScriptParser.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -737,6 +737,7 @@ expect("("); if (consume("NOLOAD")) { cmd->noload = true; + cmd->type = SHT_NOBITS; } else { skip(); // This is "COPY", "INFO" or "OVERLAY". cmd->nonAlloc = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/ELF/Writer.cpp new/lld-10.0.1.src/ELF/Writer.cpp --- old/lld-10.0.0.src/ELF/Writer.cpp 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/ELF/Writer.cpp 2020-07-07 18:21:37.000000000 +0200 @@ -1523,17 +1523,30 @@ // but sort must consider them all at once. std::vector<InputSection **> scriptSections; std::vector<InputSection *> sections; + bool started = false, stopped = false; for (BaseCommand *base : sec->sectionCommands) { if (auto *isd = dyn_cast<InputSectionDescription>(base)) { for (InputSection *&isec : isd->sections) { - scriptSections.push_back(&isec); - sections.push_back(isec); + if (!(isec->flags & SHF_LINK_ORDER)) { + if (started) + stopped = true; + } else if (stopped) { + error(toString(isec) + ": SHF_LINK_ORDER sections in " + sec->name + + " are not contiguous"); + } else { + started = true; - InputSection *link = isec->getLinkOrderDep(); - if (!link->getParent()) - error(toString(isec) + ": sh_link points to discarded section " + - toString(link)); + scriptSections.push_back(&isec); + sections.push_back(isec); + + InputSection *link = isec->getLinkOrderDep(); + if (!link->getParent()) + error(toString(isec) + ": sh_link points to discarded section " + + toString(link)); + } } + } else if (started) { + stopped = true; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/COFF/arm64-import2.test new/lld-10.0.1.src/test/COFF/arm64-import2.test --- old/lld-10.0.0.src/test/COFF/arm64-import2.test 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/COFF/arm64-import2.test 2020-07-07 18:21:37.000000000 +0200 @@ -11,18 +11,20 @@ # BEFORE: 0: 00 00 00 94 bl #0 # BEFORE: 4: 00 00 00 94 bl #0 # BEFORE: 8: c0 03 5f d6 ret +# BEFORE: c: ff <unknown> # AFTER: Disassembly of section .text: # AFTER-EMPTY: -# AFTER: 140001000: 03 00 00 94 bl #12 -# AFTER: 140001004: 05 00 00 94 bl #20 +# AFTER: 140001000: 04 00 00 94 bl #16 +# AFTER: 140001004: 06 00 00 94 bl #24 # AFTER: 140001008: c0 03 5f d6 ret -# AFTER: 14000100c: 10 00 00 b0 adrp x16, #4096 -# AFTER: 140001010: 10 32 40 f9 ldr x16, [x16, #96] -# AFTER: 140001014: 00 02 1f d6 br x16 -# AFTER: 140001018: 10 00 00 b0 adrp x16, #4096 -# AFTER: 14000101c: 10 3a 40 f9 ldr x16, [x16, #112] -# AFTER: 140001020: 00 02 1f d6 br x16 +# AFTER: 14000100c: ff cc cc cc <unknown> +# AFTER: 140001010: 10 00 00 b0 adrp x16, #4096 +# AFTER: 140001014: 10 32 40 f9 ldr x16, [x16, #96] +# AFTER: 140001018: 00 02 1f d6 br x16 +# AFTER: 14000101c: 10 00 00 b0 adrp x16, #4096 +# AFTER: 140001020: 10 3a 40 f9 ldr x16, [x16, #112] +# AFTER: 140001024: 00 02 1f d6 br x16 # IMPORTS: Import { # IMPORTS: Name: library.dll @@ -45,7 +47,7 @@ - Name: .text Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: 0000009400000094C0035FD6 + SectionData: 0000009400000094C0035FD6FF Relocations: - VirtualAddress: 0 SymbolName: function diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/COFF/gc-dwarf.s new/lld-10.0.1.src/test/COFF/gc-dwarf.s --- old/lld-10.0.0.src/test/COFF/gc-dwarf.s 1970-01-01 01:00:00.000000000 +0100 +++ new/lld-10.0.1.src/test/COFF/gc-dwarf.s 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,60 @@ +# REQUIRES: x86 + +# RUN: llvm-mc -triple=x86_64-windows-msvc %s -filetype=obj -o %t.obj +# RUN: lld-link -lldmap:%t.map -out:%t.exe -opt:ref -entry:main %t.obj -verbose 2>&1 | FileCheck %s +# RUN: FileCheck %s --check-prefix=MAP --input-file=%t.map + +# CHECK: Discarded unused1 +# CHECK-NEXT: Discarded unused2 +# CHECK-NOT: Discarded + +# MAP: In Symbol +# MAP: gc-dwarf.s.tmp.obj:(.text) +# MAP: {{ main$}} +# MAP: gc-dwarf.s.tmp.obj:(.text) +# MAP: {{ used$}} + + .def @feat.00; .scl 3; .type 0; .endef + .globl @feat.00 +.set @feat.00, 0 + + .def main; .scl 2; .type 32; .endef + .section .text,"xr",one_only,main + .globl main +main: + callq used + xorl %eax, %eax + retq + + .def used; .scl 2; .type 32; .endef + .section .text,"xr",one_only,used + .globl used +used: + retq + + + .def unused1; .scl 2; .type 32; .endef + .section .text,"xr",one_only,unused1 + .globl unused1 +unused1: + retq + + .def unused2; .scl 2; .type 32; .endef + .section .text,"xr",one_only,unused2 + .globl unused2 +unused2: + retq + +# This isn't valid DWARF, but LLD doesn't care. Make up some data that +# references the functions above. +.section .debug_info,"r" +.long main@IMGREL +.long unused1@IMGREL +.long unused2@IMGREL + +# Similarly, .eh_frame unwind info should not keep functions alive. Again, this +# is not valid unwind info, but it doesn't matter for testing purposes. +.section .eh_frame,"r" +.long main@IMGREL +.long unused1@IMGREL +.long unused2@IMGREL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/COFF/pdb-tpi-aligned-records.test new/lld-10.0.1.src/test/COFF/pdb-tpi-aligned-records.test --- old/lld-10.0.0.src/test/COFF/pdb-tpi-aligned-records.test 1970-01-01 01:00:00.000000000 +0100 +++ new/lld-10.0.1.src/test/COFF/pdb-tpi-aligned-records.test 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,46 @@ +# RUN: yaml2obj < %s > %t.obj +# RUN: yaml2obj %p/Inputs/generic.yaml > %t2.obj + +# RUN: lld-link /out:%t.exe /debug /entry:main %t.obj %t2.obj /nodefaultlib +# RUN: llvm-pdbutil dump --types --type-data %t.pdb | FileCheck %s +# RUN: lld-link /out:%t.exe /debug:ghash /entry:main %t.obj %t2.obj /nodefaultlib +# RUN: llvm-pdbutil dump --types --type-data %t.pdb | FileCheck %s + +# CHECK: 0000: 12000810 03000000 00000000 00000000 0000F2F1 + +--- !COFF +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [] +sections: + - Name: '.debug$T' + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] + Alignment: 1 + # It is important to keep the 'SectionData' since the .OBJ is reconstructed from it, + # and that triggers an alignement bug in the output .PDB. + SectionData: '040000001000081003000000000000000000000000000600011200000000' + Types: + - Kind: LF_PROCEDURE + Procedure: + ReturnType: 3 + CallConv: NearC + Options: [ None ] + ParameterCount: 0 + ArgumentList: 0 + - Kind: LF_ARGLIST + ArgList: + ArgIndices: [ ] +symbols: + - Name: '.debug$T' + Value: 0 + SectionNumber: 1 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 30 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 0 + Number: 0 +... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/emit-relocs-debug.s new/lld-10.0.1.src/test/ELF/emit-relocs-debug.s --- old/lld-10.0.0.src/test/ELF/emit-relocs-debug.s 1970-01-01 01:00:00.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/emit-relocs-debug.s 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,20 @@ +# REQUIRES: x86 +## Test --emit-relocs handles .debug* + +# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o +# RUN: ld.lld --emit-relocs %t.o -o %t +# RUN: llvm-readobj -r %t | FileCheck %s +# RUN: ld.lld --emit-relocs --strip-debug %t.o -o %t.no +# RUN: llvm-readobj -r %t.no | FileCheck --check-prefix=NO %s + +# CHECK: Section {{.*}} .rela.debug_info { +# CHECK-NEXT: R_X86_64_64 .text 0x0 +# CHECK-NEXT: } + +# NO: Relocations [ +# NO-NEXT: ] + +foo: + +.section .debug_info +.quad foo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/gc-sections-linkorder-err.s new/lld-10.0.1.src/test/ELF/gc-sections-linkorder-err.s --- old/lld-10.0.0.src/test/ELF/gc-sections-linkorder-err.s 1970-01-01 01:00:00.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/gc-sections-linkorder-err.s 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,37 @@ +# REQUIRES: x86 + +## Error if the linked-to section of an input section is discarded. + +# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o +# RUN: not ld.lld --gc-sections --print-gc-sections %t.o -o /dev/null 2>&1 | FileCheck %s + +# CHECK: removing unused section {{.*}}.o:(.foo0) +# CHECK-NEXT: error: {{.*}}.o:(.bar): sh_link points to discarded section {{.*}}.o:(.foo0) +# CHECK-NEXT: error: {{.*}}.o:(.baz): sh_link points to discarded section {{.*}}.o:(.foo0) + +.globl _start +_start: + call .foo1 + call bar0 + call bar1 + call baz0 + call baz1 + +.section .foo0,"a" +.section .foo1,"a" + +## The linked-to section of the first input section is discarded. +.section .bar,"ao",@progbits,.foo0,unique,0 +bar0: +.byte 0 +.section .bar,"ao",@progbits,.foo1,unique,1 +bar1: +.byte 1 + +## Another case: the linked-to section of the second input section is discarded. +.section .baz,"ao",@progbits,.foo1,unique,0 +baz0: +.byte 0 +.section .baz,"ao",@progbits,.foo0,unique,1 +baz1: +.byte 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/gc-sections-linkorder.s new/lld-10.0.1.src/test/ELF/gc-sections-linkorder.s --- old/lld-10.0.0.src/test/ELF/gc-sections-linkorder.s 1970-01-01 01:00:00.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/gc-sections-linkorder.s 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,32 @@ +# REQUIRES: x86 + +# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o +# RUN: ld.lld --gc-sections --print-gc-sections %t.o -o /dev/null | FileCheck %s --implicit-check-not=removing + +# CHECK: removing unused section {{.*}}.o:(.foo2) +# CHECK: removing unused section {{.*}}.o:(bar2) +# CHECK: removing unused section {{.*}}.o:(.zed2) + +.global _start +_start: +.quad .foo1 + +.section .foo1,"a" +.quad 0 + +.section .foo2,"a" +.quad 0 + +.section bar1,"ao",@progbits,.foo1 +.quad .zed1 +.quad .foo1 + +.section bar2,"ao",@progbits,.foo2 +.quad .zed2 +.quad .foo2 + +.section .zed1,"a" +.quad 0 + +.section .zed2,"a" +.quad 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/gc-sections-linkorder2.s new/lld-10.0.1.src/test/ELF/gc-sections-linkorder2.s --- old/lld-10.0.0.src/test/ELF/gc-sections-linkorder2.s 1970-01-01 01:00:00.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/gc-sections-linkorder2.s 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,16 @@ +# REQUIRES: x86 + +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +# RUN: ld.lld --gc-sections --print-gc-sections %t.o -o /dev/null | count 0 + +.globl _start +_start: +.quad .foo + +## .foo is retained, so sections linking to it are retained as well. +.section .foo,"a" +.quad 0 +.section .bar,"ao",@progbits,.foo +.quad 0 +.section .zed,"ao",@progbits,.foo +.quad 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/gc-sections-metadata-err.s new/lld-10.0.1.src/test/ELF/gc-sections-metadata-err.s --- old/lld-10.0.0.src/test/ELF/gc-sections-metadata-err.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/gc-sections-metadata-err.s 1970-01-01 01:00:00.000000000 +0100 @@ -1,37 +0,0 @@ -# REQUIRES: x86 - -## Error if the linked-to section of an input section is discarded. - -# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o -# RUN: not ld.lld --gc-sections --print-gc-sections %t.o -o /dev/null 2>&1 | FileCheck %s - -# CHECK: removing unused section {{.*}}.o:(.foo0) -# CHECK-NEXT: error: {{.*}}.o:(.bar): sh_link points to discarded section {{.*}}.o:(.foo0) -# CHECK-NEXT: error: {{.*}}.o:(.baz): sh_link points to discarded section {{.*}}.o:(.foo0) - -.globl _start -_start: - call .foo1 - call bar0 - call bar1 - call baz0 - call baz1 - -.section .foo0,"a" -.section .foo1,"a" - -## The linked-to section of the first input section is discarded. -.section .bar,"ao",@progbits,.foo0,unique,0 -bar0: -.byte 0 -.section .bar,"ao",@progbits,.foo1,unique,1 -bar1: -.byte 1 - -## Another case: the linked-to section of the second input section is discarded. -.section .baz,"ao",@progbits,.foo1,unique,0 -baz0: -.byte 0 -.section .baz,"ao",@progbits,.foo0,unique,1 -baz1: -.byte 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/gc-sections-metadata.s new/lld-10.0.1.src/test/ELF/gc-sections-metadata.s --- old/lld-10.0.0.src/test/ELF/gc-sections-metadata.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/gc-sections-metadata.s 1970-01-01 01:00:00.000000000 +0100 @@ -1,38 +0,0 @@ -# REQUIRES: x86 - -# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: ld.lld --gc-sections %t.o -o %t -# RUN: llvm-objdump -section-headers %t | FileCheck %s - -# CHECK: 1 .foo1 -# CHECK-NEXT: bar1 -# CHECK-NEXT: .zed1 -# CHECK-NEXT: .text -# CHECK-NEXT: .comment -# CHECK-NEXT: .symtab -# CHECK-NEXT: .shstrtab -# CHECK-NEXT: .strtab - -.global _start -_start: -.quad .foo1 - -.section .foo1,"a" -.quad 0 - -.section .foo2,"a" -.quad 0 - -.section bar1,"ao",@progbits,.foo1 -.quad .zed1 -.quad .foo1 - -.section bar2,"ao",@progbits,.foo2 -.quad .zed2 -.quad .foo2 - -.section .zed1,"a" -.quad 0 - -.section .zed2,"a" -.quad 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/gc-sections-metadata2.s new/lld-10.0.1.src/test/ELF/gc-sections-metadata2.s --- old/lld-10.0.0.src/test/ELF/gc-sections-metadata2.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/gc-sections-metadata2.s 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -# REQUIRES: x86 -# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: ld.lld --gc-sections %t.o -o %t -# RUN: llvm-objdump -section-headers %t | FileCheck %s - -# CHECK: .foo -# CHECK: .bar -# CHECK: .zed - -.globl _start -_start: -.quad .foo - -.section .foo,"a" -.quad 0 -.section .bar,"ao",@progbits,.foo -.quad 0 -.section .zed,"ao",@progbits,.foo -.quad 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/invalid-dynamic-list.test new/lld-10.0.1.src/test/ELF/invalid-dynamic-list.test --- old/lld-10.0.0.src/test/ELF/invalid-dynamic-list.test 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/invalid-dynamic-list.test 2020-07-07 18:21:37.000000000 +0200 @@ -9,6 +9,10 @@ # RUN: mkdir -p %t.dir +# RUN: echo > %tempty.list +# RUN: not ld.lld --dynamic-list %tempty.list 2>&1 | FileCheck --check-prefix=EMPTY %s +# EMPTY: error: {{.*}}.list:1: unexpected EOF + # RUN: echo foobar > %t1 # RUN: not ld.lld --dynamic-list %t1 2>&1 | FileCheck -check-prefix=ERR1 %s # ERR1: {{.*}}:1: { expected, but got foobar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkerscript/at-self-reference.s new/lld-10.0.1.src/test/ELF/linkerscript/at-self-reference.s --- old/lld-10.0.0.src/test/ELF/linkerscript/at-self-reference.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkerscript/at-self-reference.s 1970-01-01 01:00:00.000000000 +0100 @@ -1,63 +0,0 @@ -# REQUIRES: x86 -# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t -# RUN: echo "SECTIONS { \ -# RUN: . = 0x1000; \ -# RUN: .aaa : AT(ADDR(.aaa)) { *(.aaa) } \ -# RUN: .bbb : AT(ADDR(.bbb)) { *(.bbb) } \ -# RUN: }" > %t.script -# RUN: ld.lld %t --script %t.script -o %t2 -# RUN: llvm-readobj -l %t2 | FileCheck %s - -# CHECK: ProgramHeaders [ -# CHECK-NEXT: ProgramHeader { -# CHECK-NEXT: Type: PT_LOAD (0x1) -# CHECK-NEXT: Offset: 0x1000 -# CHECK-NEXT: VirtualAddress: 0x1000 -# CHECK-NEXT: PhysicalAddress: 0x1000 -# CHECK-NEXT: FileSize: 3 -# CHECK-NEXT: MemSize: 3 -# CHECK-NEXT: Flags [ (0x5) -# CHECK-NEXT: PF_R (0x4) -# CHECK-NEXT: PF_X (0x1) -# CHECK-NEXT: ] -# CHECK-NEXT: Alignment: 4096 -# CHECK-NEXT: } -# CHECK-NEXT: ProgramHeader { -# CHECK-NEXT: Type: PT_LOAD (0x1) -# CHECK-NEXT: Offset: 0x1008 -# CHECK-NEXT: VirtualAddress: 0x1008 -# CHECK-NEXT: PhysicalAddress: 0x1008 -# CHECK-NEXT: FileSize: 9 -# CHECK-NEXT: MemSize: 9 -# CHECK-NEXT: Flags [ (0x5) -# CHECK-NEXT: PF_R (0x4) -# CHECK-NEXT: PF_X (0x1) -# CHECK-NEXT: ] -# CHECK-NEXT: Alignment: 4096 -# CHECK-NEXT: } -# CHECK-NEXT: ProgramHeader { -# CHECK-NEXT: Type: PT_GNU_STACK (0x6474E551) -# CHECK-NEXT: Offset: 0x0 -# CHECK-NEXT: VirtualAddress: 0x0 -# CHECK-NEXT: PhysicalAddress: 0x0 -# CHECK-NEXT: FileSize: 0 -# CHECK-NEXT: MemSize: 0 -# CHECK-NEXT: Flags [ (0x6) -# CHECK-NEXT: PF_R (0x4) -# CHECK-NEXT: PF_W (0x2) -# CHECK-NEXT: ] -# CHECK-NEXT: Alignment: 0 -# CHECK-NEXT: } -# CHECK-NEXT:] - -.global _start -_start: - nop - - -.section .aaa, "a" -.asciz "aa" - -.section .bbb, "a" -.align 8 -.quad 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkerscript/common-assign.s new/lld-10.0.1.src/test/ELF/linkerscript/common-assign.s --- old/lld-10.0.0.src/test/ELF/linkerscript/common-assign.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkerscript/common-assign.s 2020-07-07 18:21:37.000000000 +0200 @@ -6,7 +6,7 @@ # CHECK: Symbol { # CHECK: Name: bar -# CHECK-NEXT: Value: 0x134 +# CHECK-NEXT: Value: [[BAR:.*]] # CHECK-NEXT: Size: 4 # CHECK-NEXT: Binding: Global # CHECK-NEXT: Type: Object @@ -15,7 +15,7 @@ # CHECK-NEXT: } # CHECK-NEXT: Symbol { # CHECK-NEXT: Name: foo -# CHECK-NEXT: Value: 0x138 +# CHECK-NEXT: Value: [[FOO:.*]] # CHECK-NEXT: Size: 4 # CHECK-NEXT: Binding: Global # CHECK-NEXT: Type: Object @@ -24,7 +24,7 @@ # CHECK-NEXT: } # CHECK-NEXT: Symbol { # CHECK-NEXT: Name: pfoo -# CHECK-NEXT: Value: 0x138 +# CHECK-NEXT: Value: [[FOO]] # CHECK-NEXT: Size: 0 # CHECK-NEXT: Binding: Global # CHECK-NEXT: Type: None @@ -33,7 +33,7 @@ # CHECK-NEXT: } # CHECK-NEXT: Symbol { # CHECK-NEXT: Name: pbar -# CHECK-NEXT: Value: 0x134 +# CHECK-NEXT: Value: [[BAR]] # CHECK-NEXT: Size: 0 # CHECK-NEXT: Binding: Global # CHECK-NEXT: Type: None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkerscript/discard-linkorder.s new/lld-10.0.1.src/test/ELF/linkerscript/discard-linkorder.s --- old/lld-10.0.0.src/test/ELF/linkerscript/discard-linkorder.s 1970-01-01 01:00:00.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkerscript/discard-linkorder.s 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,32 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t +# RUN: echo "SECTIONS { /DISCARD/ : { *(.foo) } }" > %t.script +# RUN: ld.lld -o %t1 --script %t.script %t +# RUN: llvm-objdump -section-headers %t1 | FileCheck %s + +# CHECK-NOT: .foo +# CHECK-NOT: .bar +# CHECK-NOT: .zed +# CHECK-NOT: .moo + +## Sections dependency tree for testcase is: +## (.foo) +## | | +## | --(.bar) +## | +## --(.zed) +## | +## --(.moo) +## + +.section .foo,"a" +.quad 0 + +.section .bar,"ao",@progbits,.foo +.quad 0 + +.section .zed,"ao",@progbits,.foo +.quad 0 + +.section .moo,"ao",@progbits,.zed +.quad 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkerscript/discard-section-metadata.s new/lld-10.0.1.src/test/ELF/linkerscript/discard-section-metadata.s --- old/lld-10.0.0.src/test/ELF/linkerscript/discard-section-metadata.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkerscript/discard-section-metadata.s 1970-01-01 01:00:00.000000000 +0100 @@ -1,32 +0,0 @@ -# REQUIRES: x86 -# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t -# RUN: echo "SECTIONS { /DISCARD/ : { *(.foo) } }" > %t.script -# RUN: ld.lld -o %t1 --script %t.script %t -# RUN: llvm-objdump -section-headers %t1 | FileCheck %s - -# CHECK-NOT: .foo -# CHECK-NOT: .bar -# CHECK-NOT: .zed -# CHECK-NOT: .moo - -## Sections dependency tree for testcase is: -## (.foo) -## | | -## | --(.bar) -## | -## --(.zed) -## | -## --(.moo) -## - -.section .foo,"a" -.quad 0 - -.section .bar,"ao",@progbits,.foo -.quad 0 - -.section .zed,"ao",@progbits,.foo -.quad 0 - -.section .moo,"ao",@progbits,.zed -.quad 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkerscript/double-bss.test new/lld-10.0.1.src/test/ELF/linkerscript/double-bss.test --- old/lld-10.0.0.src/test/ELF/linkerscript/double-bss.test 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkerscript/double-bss.test 2020-07-07 18:21:37.000000000 +0200 @@ -2,9 +2,9 @@ # RUN: echo '.short 0; .bss; .zero 4; .comm q,128,8' \ # RUN: | llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %t # RUN: ld.lld -o %t1 --script %s %t -# RUN: llvm-objdump -section-headers %t1 | FileCheck %s -# CHECK: .bss1 00000004 0000000000000122 BSS -# CHECK-NEXT: .bss2 00000080 0000000000000128 BSS +# RUN: llvm-readelf -S %t1 | FileCheck %s +# CHECK: .bss1 NOBITS +# CHECK-NEXT: .bss2 NOBITS SECTIONS { . = SIZEOF_HEADERS; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkerscript/linkorder.s new/lld-10.0.1.src/test/ELF/linkerscript/linkorder.s --- old/lld-10.0.0.src/test/ELF/linkerscript/linkorder.s 1970-01-01 01:00:00.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkerscript/linkorder.s 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,67 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o + +## Contiguous SHF_LINK_ORDER sections. +# RUN: echo 'SECTIONS { .rodata : {BYTE(0) *(.rodata*) BYTE(3)} \ +# RUN: .text : {*(.text.bar) *(.text.foo)} }' > %t.lds +# RUN: ld.lld -T %t.lds %t.o -o %t +# RUN: llvm-readelf -S -x .rodata -x .text %t | FileCheck %s + +# CHECK: [ 1] .rodata {{.*}} AL 3 +# CHECK: [ 3] .text {{.*}} AX 0 +# CHECK: Hex dump of section '.rodata': +# CHECK-NEXT: 00020103 +# CHECK: Hex dump of section '.text': +# CHECK-NEXT: 0201 + +# RUN: echo 'SECTIONS { .rodata : {BYTE(0) *(.rodata*) BYTE(3)} \ +# RUN: .text : {*(.text.foo) *(.text.bar)} }' > %t1.lds +# RUN: ld.lld -T %t1.lds %t.o -o %t1 +# RUN: llvm-readelf -S -x .rodata -x .text %t1 | FileCheck --check-prefix=CHECK1 %s + +# CHECK1: [ 1] .rodata {{.*}} AL 3 +# CHECK1: [ 3] .text {{.*}} AX 0 +# CHECK1: Hex dump of section '.rodata': +# CHECK1-NEXT: 00010203 +# CHECK1: Hex dump of section '.text': +# CHECK1-NEXT: 0102 + +## Adjacent input sections descriptions are contiguous. +## Orphan section .text.bar precedes .text.foo, so swap the order of .rodata.* +# RUN: echo 'SECTIONS { .rodata : {*(.rodata.foo) *(.rodata.bar)} }' > %t2.lds +# RUN: ld.lld -T %t2.lds %t.o -o %t2 +# RUN: llvm-readelf -S -x .rodata %t2 | FileCheck --check-prefix=CHECK2 %s + +# CHECK2: [ 1] .rodata {{.*}} AL 3 +# CHECK2: [ 3] .text {{.*}} AX 0 +# CHECK2: Hex dump of section '.rodata': +# CHECK2-NEXT: 0201 + +## Non-contiguous SHF_LINK_ORDER sections, separated by a BYTE. +# RUN: echo 'SECTIONS { .rodata : {*(.rodata.foo) BYTE(0) *(.rodata.bar)} }' > %terr1.lds +# RUN: not ld.lld -T %terr1.lds %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s + +## Non-contiguous SHF_LINK_ORDER sections, separated by a non-SHF_LINK_ORDER section. +# RUN: echo 'SECTIONS { .rodata : {*(.rodata.foo) *(.text) *(.rodata.bar)} }' > %terr2.lds +# RUN: not ld.lld -T %terr2.lds %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s + +## Non-contiguous SHF_LINK_ORDER sections, separated by a symbol assignment. +# RUN: echo 'SECTIONS { .rodata : {*(.rodata.foo) a = .; *(.rodata.bar)} }' > %terr3.lds +# RUN: not ld.lld -T %terr3.lds %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s + +# ERR: error: {{.*}}.o:(.rodata.bar): SHF_LINK_ORDER sections in .rodata are not contiguous + +.global _start +_start: + +.section .ro,"a" +.byte 0 + +.section .text.bar,"a",@progbits +.byte 2 +.section .text.foo,"a",@progbits +.byte 1 +.section .rodata.foo,"ao",@progbits,.text.foo +.byte 1 +.section .rodata.bar,"ao",@progbits,.text.bar +.byte 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkerscript/linkorder2.s new/lld-10.0.1.src/test/ELF/linkerscript/linkorder2.s --- old/lld-10.0.0.src/test/ELF/linkerscript/linkorder2.s 1970-01-01 01:00:00.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkerscript/linkorder2.s 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,37 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +# RUN: echo "SECTIONS { .text : { *(.text.*) } }" > %t.script + +# RUN: echo "_bar" > %t.ord +# RUN: echo "_foo" >> %t.ord +# RUN: ld.lld --symbol-ordering-file %t.ord -o %t --script %t.script %t.o +# RUN: llvm-objdump -s %t | FileCheck %s + +# CHECK: Contents of section .rodata: +# CHECK-NEXT: 02000000 00000000 01000000 00000000 +# CHECK: Contents of section .text: +# CHECK-NEXT: 02000000 00000000 01000000 00000000 + +# RUN: echo "_foo" > %t.ord +# RUN: echo "_bar" >> %t.ord +# RUN: ld.lld --symbol-ordering-file %t.ord -o %t --script %t.script %t.o +# RUN: llvm-objdump -s %t | FileCheck %s --check-prefix=INV + +# INV: Contents of section .rodata: +# INV-NEXT: 01000000 00000000 02000000 00000000 +# INV: Contents of section .text: +# INV-NEXT: 01000000 00000000 02000000 00000000 + +.section .text.foo,"a",@progbits +_foo: +.quad 1 + +.section .text.bar,"a",@progbits +_bar: +.quad 2 + +.section .rodata.foo,"ao",@progbits,.text.foo +.quad 1 + +.section .rodata.bar,"ao",@progbits,.text.bar +.quad 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkerscript/merge-sections-syms.s new/lld-10.0.1.src/test/ELF/linkerscript/merge-sections-syms.s --- old/lld-10.0.0.src/test/ELF/linkerscript/merge-sections-syms.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkerscript/merge-sections-syms.s 2020-07-07 18:21:37.000000000 +0200 @@ -6,38 +6,10 @@ # RUN: .rodata : { *(.aaa) *(.bbb) A = .; *(.ccc) B = .; } \ # RUN: }" > %t.script # RUN: ld.lld -o %t.so --script %t.script %t.o -shared -# RUN: llvm-readobj --dyn-symbols %t.so | FileCheck %s - -# CHECK: DynamicSymbols [ -# CHECK-NEXT: Symbol { -# CHECK-NEXT: Name: -# CHECK-NEXT: Value: -# CHECK-NEXT: Size: -# CHECK-NEXT: Binding: -# CHECK-NEXT: Type: -# CHECK-NEXT: Other: -# CHECK-NEXT: Section: -# CHECK-NEXT: } -# CHECK-NEXT: Symbol { -# CHECK-NEXT: Name: A -# CHECK-NEXT: Value: 0x226 -# CHECK-NEXT: Size: -# CHECK-NEXT: Binding: -# CHECK-NEXT: Type: -# CHECK-NEXT: Other: -# CHECK-NEXT: Section: -# CHECK-NEXT: } -# CHECK-NEXT: Symbol { -# CHECK-NEXT: Name: B -# CHECK-NEXT: Value: 0x227 -# CHECK-NEXT: Size: -# CHECK-NEXT: Binding: -# CHECK-NEXT: Type: -# CHECK-NEXT: Other: -# CHECK-NEXT: Section: -# CHECK-NEXT: } -# CHECK-NEXT: ] +# RUN: llvm-nm -D %t.so | FileCheck %s +# CHECK: 0000000000000226 R A +# CHECK: 0000000000000227 R B .section .aaa,"a" .byte 11 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkerscript/noload.s new/lld-10.0.1.src/test/ELF/linkerscript/noload.s --- old/lld-10.0.0.src/test/ELF/linkerscript/noload.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkerscript/noload.s 2020-07-07 18:21:37.000000000 +0200 @@ -3,55 +3,18 @@ # RUN: echo "SECTIONS { \ # RUN: .data_noload_a (NOLOAD) : { *(.data_noload_a) } \ # RUN: .data_noload_b (0x10000) (NOLOAD) : { *(.data_noload_b) } \ +# RUN: .no_input_sec_noload (NOLOAD) : { . += 1; } \ # RUN: .text (0x20000) : { *(.text) } };" > %t.script # RUN: ld.lld -o %t --script %t.script %t.o -# RUN: llvm-readobj --sections -l %t | FileCheck %s +# RUN: llvm-readelf -S -l %t | FileCheck %s -# CHECK: Section { -# CHECK: Index: 1 -# CHECK-NEXT: Name: .data_noload_a -# CHECK-NEXT: Type: SHT_NOBITS -# CHECK-NEXT: Flags [ -# CHECK-NEXT: SHF_ALLOC -# CHECK-NEXT: SHF_WRITE -# CHECK-NEXT: ] -# CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0xE8 -# CHECK-NEXT: Size: 4096 -# CHECK-NEXT: Link: 0 -# CHECK-NEXT: Info: 0 -# CHECK-NEXT: AddressAlignment: 1 -# CHECK-NEXT: EntrySize: 0 -# CHECK-NEXT: } -# CHECK-NEXT: Section { -# CHECK-NEXT: Index: 2 -# CHECK-NEXT: Name: .data_noload_b -# CHECK-NEXT: Type: SHT_NOBITS -# CHECK-NEXT: Flags [ -# CHECK-NEXT: SHF_ALLOC -# CHECK-NEXT: SHF_WRITE -# CHECK-NEXT: ] -# CHECK-NEXT: Address: 0x10000 -# CHECK-NEXT: Offset: 0xE8 -# CHECK-NEXT: Size: 4096 -# CHECK-NEXT: Link: 0 -# CHECK-NEXT: Info: 0 -# CHECK-NEXT: AddressAlignment: 1 -# CHECK-NEXT: EntrySize: 0 -# CHECK-NEXT: } -# CHECK: ProgramHeader { -# CHECK-NEXT: Type: PT_LOAD (0x1) -# CHECK-NEXT: Offset: 0x1000 -# CHECK-NEXT: VirtualAddress: 0x20000 -# CHECK-NEXT: PhysicalAddress: 0x20000 -# CHECK-NEXT: FileSize: 1 -# CHECK-NEXT: MemSize: 1 -# CHECK-NEXT: Flags [ (0x5) -# CHECK-NEXT: PF_R (0x4) -# CHECK-NEXT: PF_X (0x1) -# CHECK-NEXT: ] -# CHECK-NEXT: Alignment: 4096 -# CHECK-NEXT: } +# CHECK: Name Type Address Off Size +# CHECK: .data_noload_a NOBITS 0000000000000000 [[OFF:[0-9a-f]+]] 001000 +# CHECK-NEXT: .data_noload_b NOBITS 0000000000010000 [[OFF]] 001000 +# CHECK-NEXT: .no_input_sec_noload NOBITS 0000000000011000 [[OFF]] 000001 + +# CHECK: Type Offset VirtAddr PhysAddr +# CHECK-NEXT: LOAD 0x001000 0x0000000000020000 0x0000000000020000 .section .text,"ax",@progbits nop diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkerscript/rosegment.test new/lld-10.0.1.src/test/ELF/linkerscript/rosegment.test --- old/lld-10.0.0.src/test/ELF/linkerscript/rosegment.test 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkerscript/rosegment.test 2020-07-07 18:21:37.000000000 +0200 @@ -4,23 +4,11 @@ # Test that with linker scripts we don't create a RO PT_LOAD. # RUN: ld.lld -o %t1 --script %s %t -shared -# RUN: llvm-readobj -l %t1 | FileCheck %s +# RUN: llvm-readelf -l %t1 | FileCheck %s SECTIONS { } -# CHECK-NOT: Type: PT_LOAD - -# CHECK: Type: PT_LOAD -# CHECK: Flags [ -# CHECK-NEXT: PF_R -# CHECK-NEXT: PF_X -# CHECK-NEXT: ] - -# CHECK: Type: PT_LOAD -# CHECK: Flags [ -# CHECK-NEXT: PF_R -# CHECK-NEXT: PF_W -# CHECK-NEXT: ] - -# CHECK-NOT: Type: PT_LOAD +# CHECK: Type {{.*}} Flg Align +# CHECK-NEXT: LOAD {{.*}} R E 0x1000 +# CHECK-NEXT: LOAD {{.*}} RW 0x1000 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkerscript/section-metadata.s new/lld-10.0.1.src/test/ELF/linkerscript/section-metadata.s --- old/lld-10.0.0.src/test/ELF/linkerscript/section-metadata.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkerscript/section-metadata.s 1970-01-01 01:00:00.000000000 +0100 @@ -1,33 +0,0 @@ -# REQUIRES: x86 -# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o - -# RUN: echo "SECTIONS { .text : { *(.text.bar) *(.text.foo) } }" > %t.script -# RUN: ld.lld -o %t --script %t.script %t.o -# RUN: llvm-objdump -s %t | FileCheck %s - -# RUN: echo "SECTIONS { .text : { *(.text.foo) *(.text.bar) } }" > %t.script -# RUN: ld.lld -o %t --script %t.script %t.o -# RUN: llvm-objdump -s %t | FileCheck --check-prefix=INV %s - - -# CHECK: Contents of section .rodata: -# CHECK-NEXT: 02000000 00000000 01000000 00000000 -# CHECK: Contents of section .text: -# CHECK-NEXT: 02000000 00000000 01000000 00000000 - -# INV: Contents of section .rodata: -# INV-NEXT: 01000000 00000000 02000000 00000000 -# INV: Contents of section .text: -# INV-NEXT: 01000000 00000000 02000000 00000000 - -.global _start -_start: - -.section .text.bar,"a",@progbits -.quad 2 -.section .text.foo,"a",@progbits -.quad 1 -.section .rodata.foo,"ao",@progbits,.text.foo -.quad 1 -.section .rodata.bar,"ao",@progbits,.text.bar -.quad 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkerscript/section-metadata2.s new/lld-10.0.1.src/test/ELF/linkerscript/section-metadata2.s --- old/lld-10.0.0.src/test/ELF/linkerscript/section-metadata2.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkerscript/section-metadata2.s 1970-01-01 01:00:00.000000000 +0100 @@ -1,37 +0,0 @@ -# REQUIRES: x86 -# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: echo "SECTIONS { .text : { *(.text.*) } }" > %t.script - -# RUN: echo "_bar" > %t.ord -# RUN: echo "_foo" >> %t.ord -# RUN: ld.lld --symbol-ordering-file %t.ord -o %t --script %t.script %t.o -# RUN: llvm-objdump -s %t | FileCheck %s - -# CHECK: Contents of section .rodata: -# CHECK-NEXT: 02000000 00000000 01000000 00000000 -# CHECK: Contents of section .text: -# CHECK-NEXT: 02000000 00000000 01000000 00000000 - -# RUN: echo "_foo" > %t.ord -# RUN: echo "_bar" >> %t.ord -# RUN: ld.lld --symbol-ordering-file %t.ord -o %t --script %t.script %t.o -# RUN: llvm-objdump -s %t | FileCheck %s --check-prefix=INV - -# INV: Contents of section .rodata: -# INV-NEXT: 01000000 00000000 02000000 00000000 -# INV: Contents of section .text: -# INV-NEXT: 01000000 00000000 02000000 00000000 - -.section .text.foo,"a",@progbits -_foo: -.quad 1 - -.section .text.bar,"a",@progbits -_bar: -.quad 2 - -.section .rodata.foo,"ao",@progbits,.text.foo -.quad 1 - -.section .rodata.bar,"ao",@progbits,.text.bar -.quad 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkorder-err.s new/lld-10.0.1.src/test/ELF/linkorder-err.s --- old/lld-10.0.0.src/test/ELF/linkorder-err.s 1970-01-01 01:00:00.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkorder-err.s 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,11 @@ +# REQUIRES: x86 + +# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o +# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s + +# CHECK: error: a section .foo with SHF_LINK_ORDER should not refer a non-regular section: {{.*}}.o:(.merge) + +.section .merge,"aM",@progbits,8 +.quad 0 +.section .foo,"ao",@progbits,.merge +.quad 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/linkorder-err2.s new/lld-10.0.1.src/test/ELF/linkorder-err2.s --- old/lld-10.0.0.src/test/ELF/linkorder-err2.s 1970-01-01 01:00:00.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/linkorder-err2.s 2020-07-07 18:21:37.000000000 +0200 @@ -0,0 +1,17 @@ +# REQUIRES: x86 + +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s + +## Check we do not crash and report proper errors. +# CHECK: error: a section .bar with SHF_LINK_ORDER should not refer a non-regular section: {{.*}}.o:(.foo) +# CHECK-NEXT: error: a section .bar with SHF_LINK_ORDER should not refer a non-regular section: {{.*}}.o:(.foo) + +.section .foo,"aM",@progbits,8 +.quad 0 + +.section .bar,"ao",@progbits,.foo,unique,1 +.quad 0 + +.section .bar,"ao",@progbits,.foo,unique,2 +.quad 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/many-alloc-sections.s new/lld-10.0.1.src/test/ELF/many-alloc-sections.s --- old/lld-10.0.0.src/test/ELF/many-alloc-sections.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/many-alloc-sections.s 2020-07-07 18:21:37.000000000 +0200 @@ -6,7 +6,7 @@ // Test that _start is in the correct section. // CHECK: Name: _start -// CHECK-NEXT: Value: 0x120 +// CHECK-NEXT: Value: // CHECK-NEXT: Size: 0 // CHECK-NEXT: Binding: Global // CHECK-NEXT: Type: None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/section-metadata-err.s new/lld-10.0.1.src/test/ELF/section-metadata-err.s --- old/lld-10.0.0.src/test/ELF/section-metadata-err.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/section-metadata-err.s 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -# REQUIRES: x86 - -# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s - -# CHECK: error: a section .bar with SHF_LINK_ORDER should not refer a non-regular section: {{.*}}section-metadata-err.s.tmp.o:(.foo) - -.global _start -_start: -.quad .foo - -.section .foo,"aM",@progbits,8 -.quad 0 - -.section .bar,"ao",@progbits,.foo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/section-metadata-err2.s new/lld-10.0.1.src/test/ELF/section-metadata-err2.s --- old/lld-10.0.0.src/test/ELF/section-metadata-err2.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/section-metadata-err2.s 1970-01-01 01:00:00.000000000 +0100 @@ -1,17 +0,0 @@ -# REQUIRES: x86 - -# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s - -## Check we do not crash and report proper errors. -# CHECK: error: a section .bar with SHF_LINK_ORDER should not refer a non-regular section: {{.*}}section-metadata-err2.s.tmp.o:(.foo) -# CHECK: error: a section .bar with SHF_LINK_ORDER should not refer a non-regular section: {{.*}}section-metadata-err2.s.tmp.o:(.foo) - -.section .foo,"aM",@progbits,8 -.quad 0 - -.section .bar,"ao",@progbits,.foo,unique,1 -.quad 0 - -.section .bar,"ao",@progbits,.foo,unique,2 -.quad 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/section-metadata-err3.s new/lld-10.0.1.src/test/ELF/section-metadata-err3.s --- old/lld-10.0.0.src/test/ELF/section-metadata-err3.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/section-metadata-err3.s 1970-01-01 01:00:00.000000000 +0100 @@ -1,17 +0,0 @@ -# REQUIRES: x86 - -# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s - -# CHECK: error: incompatible section flags for .bar -# CHECK-NEXT: >>> {{.*}}section-metadata-err3.s.tmp.o:(.bar): 0x2 -# CHECK-NEXT: >>> output section .bar: 0x82 - -.section .foo,"a",@progbits -.quad 0 - -.section .bar,"ao",@progbits,.foo,unique,1 -.quad 0 - -.section .bar,"a",@progbits,unique,2 -.quad 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-10.0.0.src/test/ELF/version-script-err.s new/lld-10.0.1.src/test/ELF/version-script-err.s --- old/lld-10.0.0.src/test/ELF/version-script-err.s 2020-03-23 16:01:02.000000000 +0100 +++ new/lld-10.0.1.src/test/ELF/version-script-err.s 2020-07-07 18:21:37.000000000 +0200 @@ -8,3 +8,8 @@ // RUN: not ld.lld --version-script %terr1.script -shared %t.o -o %t.so 2>&1 | \ // RUN: FileCheck -check-prefix=ERR1 %s // ERR1: {{.*}}:1: unclosed quote + +// RUN: echo > %tempty.ver +// RUN: not ld.lld --version-script %tempty.ver 2>&1 | \ +// RUN: FileCheck --check-prefix=ERR2 %s +// ERR2: error: {{.*}}.ver:1: unexpected EOF ++++++ lld-default-sha1.patch ++++++ --- /var/tmp/diff_new_pack.sKFGzU/_old 2020-07-29 17:15:23.528307299 +0200 +++ /var/tmp/diff_new_pack.sKFGzU/_new 2020-07-29 17:15:23.532307302 +0200 @@ -1,7 +1,7 @@ -Index: llvm-10.0.0.src/lld-10.0.0.src/ELF/Driver.cpp +Index: lld-10.0.0.src/ELF/Driver.cpp =================================================================== ---- llvm-10.0.0.src.orig/lld-10.0.0.src/ELF/Driver.cpp -+++ llvm-10.0.0.src/lld-10.0.0.src/ELF/Driver.cpp +--- lld-10.0.0.src.orig/ELF/Driver.cpp ++++ lld-10.0.0.src/ELF/Driver.cpp @@ -693,7 +693,7 @@ getBuildId(opt::InputArgList &args) { return {BuildIdKind::None, {}}; ++++++ lldb-10.0.0.src.tar.xz -> lldb-10.0.1.src.tar.xz ++++++ /work/SRC/openSUSE:Factory/llvm10/lldb-10.0.0.src.tar.xz /work/SRC/openSUSE:Factory/.llvm10.new.3592/lldb-10.0.1.src.tar.xz differ: char 25, line 1 ++++++ llvm-10.0.0.src.tar.xz -> llvm-10.0.1.src.tar.xz ++++++ /work/SRC/openSUSE:Factory/llvm10/llvm-10.0.0.src.tar.xz /work/SRC/openSUSE:Factory/.llvm10.new.3592/llvm-10.0.1.src.tar.xz differ: char 26, line 1 ++++++ llvm-do-not-install-static-libraries.patch ++++++ --- /var/tmp/diff_new_pack.sKFGzU/_old 2020-07-29 17:15:23.596307358 +0200 +++ /var/tmp/diff_new_pack.sKFGzU/_new 2020-07-29 17:15:23.600307362 +0200 @@ -2,10 +2,10 @@ want after installation. By not copying them in the first place we reduce the disk usage during installation. -Index: clang-10.0.0.src/cmake/modules/AddClang.cmake +Index: clang-10.0.1.src/cmake/modules/AddClang.cmake =================================================================== ---- a/clang-10.0.0.src/cmake/modules/AddClang.cmake -+++ b/clang-10.0.0.src/cmake/modules/AddClang.cmake +--- a/clang-10.0.1.src/cmake/modules/AddClang.cmake ++++ b/clang-10.0.1.src/cmake/modules/AddClang.cmake @@ -106,12 +106,15 @@ macro(add_clang_library name) set_property(GLOBAL PROPERTY CLANG_HAS_EXPORTS True) endif() @@ -68,10 +68,10 @@ endif() if (ARG_MODULE) set_target_properties(${name} PROPERTIES FOLDER "Loadable modules") -Index: lld-10.0.0.src/cmake/modules/AddLLD.cmake +Index: lld-10.0.1.src/cmake/modules/AddLLD.cmake =================================================================== ---- a/lld-10.0.0.src/cmake/modules/AddLLD.cmake -+++ b/lld-10.0.0.src/cmake/modules/AddLLD.cmake +--- a/lld-10.0.1.src/cmake/modules/AddLLD.cmake ++++ b/lld-10.0.1.src/cmake/modules/AddLLD.cmake @@ -17,13 +17,6 @@ macro(add_lld_library name) set_property(GLOBAL PROPERTY LLD_HAS_EXPORTS True) endif() @@ -86,10 +86,10 @@ if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) add_llvm_install_targets(install-${name} DEPENDS ${name} -Index: polly-10.0.0.src/cmake/polly_macros.cmake +Index: polly-10.0.1.src/cmake/polly_macros.cmake =================================================================== ---- a/polly-10.0.0.src/cmake/polly_macros.cmake -+++ b/polly-10.0.0.src/cmake/polly_macros.cmake +--- a/polly-10.0.1.src/cmake/polly_macros.cmake ++++ b/polly-10.0.1.src/cmake/polly_macros.cmake @@ -42,12 +42,14 @@ macro(add_polly_library name) llvm_config(${name} ${LLVM_LINK_COMPONENTS}) endif( LLVM_LINK_COMPONENTS ) @@ -110,10 +110,10 @@ endmacro(add_polly_library) macro(add_polly_loadable_module name) -Index: polly-10.0.0.src/lib/CMakeLists.txt +Index: polly-10.0.1.src/lib/CMakeLists.txt =================================================================== ---- a/polly-10.0.0.src/lib/CMakeLists.txt -+++ b/polly-10.0.0.src/lib/CMakeLists.txt +--- a/polly-10.0.1.src/lib/CMakeLists.txt ++++ b/polly-10.0.1.src/lib/CMakeLists.txt @@ -74,7 +74,7 @@ set_target_properties(PollyCore PROPERTI # It depends on all library it needs, such that with # LLVM_POLLY_LINK_INTO_TOOLS=ON, its dependencies like PollyISL are linked as ++++++ llvm-docs-10.0.0.src.tar.xz -> llvm-docs-10.0.1.src.tar.xz ++++++ ++++ 49172 lines of diff (skipped) ++++++ openmp-10.0.0.src.tar.xz -> openmp-10.0.1.src.tar.xz ++++++ ++++++ polly-10.0.0.src.tar.xz -> polly-10.0.1.src.tar.xz ++++++ /work/SRC/openSUSE:Factory/llvm10/polly-10.0.0.src.tar.xz /work/SRC/openSUSE:Factory/.llvm10.new.3592/polly-10.0.1.src.tar.xz differ: char 25, line 1 ++++++ restore-llvm10-abi.patch ++++++ diff --git a/include/llvm/Analysis/ValueLattice.h b/include/llvm/Analysis/ValueLattice.h index 415c32e..b8e538a 100644 --- a/include/llvm/Analysis/ValueLattice.h +++ b/include/llvm/Analysis/ValueLattice.h @@ -31,6 +31,11 @@ class ValueLatticeElement { /// "nothing known yet". unknown, + /// This Value is an UndefValue constant or produces undef. Undefined values + /// can be merged with constants (or single element constant ranges), + /// assuming all uses of the result will be replaced. + undef, + /// This Value has a specific constant value. (For constant integers, /// constantrange is used instead. Integer typed constantexprs can appear /// as constant.) @@ -45,12 +50,7 @@ class ValueLatticeElement { constantrange, /// We can not precisely model the dynamic values this value might take. - overdefined, - - /// This Value is an UndefValue constant or produces undef. Undefined values - /// can be merged with constants (or single element constant ranges), - /// assuming all uses of the result will be replaced. - undef + overdefined }; ValueLatticeElementTy Tag;