diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/docs/ClangCommandLineReference.rst llvm-toolchain-5.0-5.0/clang/docs/ClangCommandLineReference.rst --- llvm-toolchain-5.0-5.0~+rc3/clang/docs/ClangCommandLineReference.rst 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/docs/ClangCommandLineReference.rst 2017-09-06 11:02:51.000000000 +0000 @@ -656,6 +656,10 @@ Pass to the clang compiler +.. option:: -fclang-abi-compat= + +Attempt to match the ABI of Clang + .. option:: -fcomment-block-commands=,... Treat each comma separated argument in as a documentation comment block command diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/docs/ReleaseNotes.rst llvm-toolchain-5.0-5.0/clang/docs/ReleaseNotes.rst --- llvm-toolchain-5.0-5.0~+rc3/clang/docs/ReleaseNotes.rst 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/docs/ReleaseNotes.rst 2017-09-06 11:02:51.000000000 +0000 @@ -20,15 +20,9 @@ releases may be downloaded from the `LLVM releases web site `_. -For more information about Clang or LLVM, including information about -the latest release, please check out the main please see the `Clang Web -Site `_ or the `LLVM Web -Site `_. - -Note that if you are reading this file from a Subversion checkout or the -main Clang web page, this document applies to the *next* release, not -the current one. To see the release notes for a specific release, please -see the `releases page `_. +For more information about Clang or LLVM, including information about the +latest release, please see the `Clang Web Site `_ or the +`LLVM Web Site `_. What's New in Clang 5.0.0? ========================== @@ -53,25 +47,25 @@ Improvements to Clang's diagnostics ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- -Wcast-qual was implemented for C++. C-style casts are now properly +- ``-Wcast-qual`` was implemented for C++. C-style casts are now properly diagnosed. -- -Wunused-lambda-capture warns when a variable explicitly captured +- ``-Wunused-lambda-capture`` warns when a variable explicitly captured by a lambda is not used in the body of the lambda. -- -Wstrict-prototypes is a new warning that warns about non-prototype +- ``-Wstrict-prototypes`` is a new warning that warns about non-prototype function and block declarations and types in C and Objective-C. -- -Wunguarded-availability is a new warning that warns about uses of new +- ``-Wunguarded-availability`` is a new warning that warns about uses of new APIs that were introduced in a system whose version is newer than the deployment target version. A new Objective-C expression ``@available`` has been introduced to perform system version checking at runtime. This warning is off by default to prevent unexpected warnings in existing projects. - However, its less strict sibling -Wunguarded-availability-new is on by + However, its less strict sibling ``-Wunguarded-availability-new`` is on by default. It warns about unguarded uses of APIs only when they were introduced in or after macOS 10.13, iOS 11, tvOS 11 or watchOS 4. -- The -Wdocumentation warning now allows the use of ``\param`` and +- The ``-Wdocumentation`` warning now allows the use of ``\param`` and ``\returns`` documentation directives in the documentation comments for declarations with a function or a block pointer type. @@ -81,7 +75,8 @@ New Compiler Flags ------------------ -- --autocomplete was implemented to obtain a list of flags and its arguments. This is used for shell autocompletion. +- ``--autocomplete`` was implemented to obtain a list of flags and its arguments. + This is used for shell autocompletion. Deprecated Compiler Flags ------------------------- @@ -89,9 +84,9 @@ The following options are deprecated and ignored. They will be removed in future versions of Clang. -- -fslp-vectorize-aggressive used to enable the BB vectorizing pass. They have been superseeded +- ``-fslp-vectorize-aggressive`` used to enable the BB vectorizing pass. They have been superseeded by the normal SLP vectorizer. -- -fno-slp-vectorize-aggressive used to be the default behavior of clang. +- ``-fno-slp-vectorize-aggressive`` used to be the default behavior of clang. New Pragmas in Clang ----------------------- @@ -109,7 +104,7 @@ - The ``overloadable`` attribute now allows at most one function with a given name to lack the ``overloadable`` attribute. This unmarked function will not have its name mangled. -- The ```ms_abi`` attribute and the ``__builtin_ms_va_list`` types and builtins +- The ``ms_abi`` attribute and the ``__builtin_ms_va_list`` types and builtins are now supported on AArch64. C Language Changes in Clang @@ -140,11 +135,9 @@ vector's elements. - For compile time constant values, the above rule is weakened to consider the - value of the scalar constant rather than the constant's type. - -- Floating point constants with precise integral representations are not - implicitly converted to integer values, this is for compatibility with GCC. - + value of the scalar constant rather than the constant's type. However, + for compatibility with GCC, floating point constants with precise integral + representations are not implicitly converted to integer values. Currently the basic integer and floating point types with the following operators are supported: ``+``, ``/``, ``-``, ``*``, ``%``, ``>``, ``<``, @@ -155,10 +148,29 @@ C++ Language Changes in Clang ----------------------------- +- We expect this to be the last Clang release that defaults to ``-std=gnu++98`` + when using the GCC-compatible ``clang++`` driver. From Clang 6 onwards we + expect to use ``-std=gnu++14`` or a later standard by default, to match the + behavior of recent GCC releases. Users are encouraged to change their build + files to explicitly specify their desired C++ standard. + +- Support for the C++17 standard has been completed. This mode can be enabled + using ``-std=c++17`` (the old flag ``-std=c++1z`` is still supported for + compatibility). + +- When targeting a platform that uses the Itanium C++ ABI, Clang implements a + `recent change to the ABI`__ that passes objects of class type indirectly if they + have a non-trivial move constructor. Previous versions of Clang only + considered the copy constructor, resulting in an ABI change in rare cases, + but GCC has already implemented this change for several releases. + This affects all targets other than Windows and PS4. You can opt out of this + ABI change with ``-fclang-abi-compat=4.0``. + - As mentioned in `C Language Changes in Clang`_, Clang's support for implicit scalar to vector conversions also applies to C++. Additionally the following operators are also supported: ``&&`` and ``||``. +.. __: https://github.com/itanium-cxx-abi/cxx-abi/commit/7099637aba11fed6bdad7ee65bf4fd3f97fbf076 Objective-C Language Changes in Clang ------------------------------------- @@ -306,7 +318,7 @@ - The Undefined Behavior Sanitizer has a new check for pointer overflow. This check is on by default. The flag to control this functionality is - -fsanitize=pointer-overflow. + ``-fsanitize=pointer-overflow``. Pointer overflow is an indicator of undefined behavior: when a pointer indexing expression wraps around the address space, or produces other @@ -314,10 +326,10 @@ - UBSan has several new checks which detect violations of nullability annotations. These checks are off by default. The flag to control this group - of checks is -fsanitize=nullability. The checks can be individially enabled - by -fsanitize=nullability-arg (which checks calls), - -fsanitize=nullability-assign (which checks assignments), and - -fsanitize=nullability-return (which checks return statements). + of checks is ``-fsanitize=nullability``. The checks can be individially enabled + by ``-fsanitize=nullability-arg`` (which checks calls), + ``-fsanitize=nullability-assign`` (which checks assignments), and + ``-fsanitize=nullability-return`` (which checks return statements). - UBSan can now detect invalid loads from bitfields and from ObjC BOOLs. diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/include/clang/Driver/Options.td llvm-toolchain-5.0-5.0/clang/include/clang/Driver/Options.td --- llvm-toolchain-5.0-5.0~+rc3/clang/include/clang/Driver/Options.td 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/include/clang/Driver/Options.td 2017-09-06 11:02:51.000000000 +0000 @@ -694,6 +694,9 @@ def fbuiltin_module_map : Flag <["-"], "fbuiltin-module-map">, Group, Flags<[DriverOption]>, HelpText<"Load the clang builtins module map file.">; def fcaret_diagnostics : Flag<["-"], "fcaret-diagnostics">, Group; +def fclang_abi_compat_EQ : Joined<["-"], "fclang-abi-compat=">, Group, + Flags<[CC1Option]>, MetaVarName<"">, Values<".,latest">, + HelpText<"Attempt to match the ABI of Clang ">; def fclasspath_EQ : Joined<["-"], "fclasspath=">, Group; def fcolor_diagnostics : Flag<["-"], "fcolor-diagnostics">, Group, Flags<[CoreOption, CC1Option]>, HelpText<"Use colors in diagnostics">; diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/include/clang/Frontend/CodeGenOptions.def llvm-toolchain-5.0-5.0/clang/include/clang/Frontend/CodeGenOptions.def --- llvm-toolchain-5.0-5.0~+rc3/clang/include/clang/Frontend/CodeGenOptions.def 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/include/clang/Frontend/CodeGenOptions.def 2017-09-06 11:02:51.000000000 +0000 @@ -120,6 +120,10 @@ ENUM_CODEGENOPT(ObjCDispatchMethod, ObjCDispatchMethodKind, 2, Legacy) CODEGENOPT(OmitLeafFramePointer , 1, 0) ///< Set when -momit-leaf-frame-pointer is ///< enabled. + +/// A version of Clang that we should attempt to be ABI-compatible with. +ENUM_CODEGENOPT(ClangABICompat, ClangABI, 4, ClangABI::Latest) + VALUE_CODEGENOPT(OptimizationLevel, 2, 0) ///< The -O[0-3] option specified. VALUE_CODEGENOPT(OptimizeSize, 2, 0) ///< If -Os (==1) or -Oz (==2) is specified. diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/include/clang/Frontend/CodeGenOptions.h llvm-toolchain-5.0-5.0/clang/include/clang/Frontend/CodeGenOptions.h --- llvm-toolchain-5.0-5.0~+rc3/clang/include/clang/Frontend/CodeGenOptions.h 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/include/clang/Frontend/CodeGenOptions.h 2017-09-06 11:02:51.000000000 +0000 @@ -69,6 +69,23 @@ LocalExecTLSModel }; + /// Clang versions with different platform ABI conformance. + enum class ClangABI { + /// Attempt to be ABI-compatible with code generated by Clang 3.8.x + /// (SVN r257626). This causes <1 x long long> to be passed in an + /// integer register instead of an SSE register on x64_64. + Ver3_8, + + /// Attempt to be ABI-compatible with code generated by Clang 4.0.x + /// (SVN r291814). This causes move operations to be ignored when + /// determining whether a class type can be passed or returned directly. + Ver4, + + /// Conform to the underlying platform's C and C++ ABIs as closely + /// as we can. + Latest + }; + enum StructReturnConventionKind { SRCK_Default, // No special option was passed. SRCK_OnStack, // Small structs on the stack (-fpcc-struct-return). diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/lib/Basic/Version.cpp llvm-toolchain-5.0-5.0/clang/lib/Basic/Version.cpp --- llvm-toolchain-5.0-5.0~+rc3/clang/lib/Basic/Version.cpp 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/lib/Basic/Version.cpp 2017-09-06 11:02:51.000000000 +0000 @@ -36,7 +36,7 @@ // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_500/rc3/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_500/final/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/lib/CodeGen/ABIInfo.h llvm-toolchain-5.0-5.0/clang/lib/CodeGen/ABIInfo.h --- llvm-toolchain-5.0-5.0~+rc3/clang/lib/CodeGen/ABIInfo.h 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/lib/CodeGen/ABIInfo.h 2017-09-06 11:02:51.000000000 +0000 @@ -24,6 +24,7 @@ namespace clang { class ASTContext; + class CodeGenOptions; class TargetInfo; namespace CodeGen { @@ -68,6 +69,7 @@ llvm::LLVMContext &getVMContext() const; const llvm::DataLayout &getDataLayout() const; const TargetInfo &getTarget() const; + const CodeGenOptions &getCodeGenOpts() const; /// Return the calling convention to use for system runtime /// functions. diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/lib/CodeGen/CodeGenTypes.cpp llvm-toolchain-5.0-5.0/clang/lib/CodeGen/CodeGenTypes.cpp --- llvm-toolchain-5.0-5.0~+rc3/clang/lib/CodeGen/CodeGenTypes.cpp 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/lib/CodeGen/CodeGenTypes.cpp 2017-09-06 11:02:51.000000000 +0000 @@ -44,6 +44,10 @@ delete &*I++; } +const CodeGenOptions &CodeGenTypes::getCodeGenOpts() const { + return CGM.getCodeGenOpts(); +} + void CodeGenTypes::addRecordTypeName(const RecordDecl *RD, llvm::StructType *Ty, StringRef suffix) { diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/lib/CodeGen/CodeGenTypes.h llvm-toolchain-5.0-5.0/clang/lib/CodeGen/CodeGenTypes.h --- llvm-toolchain-5.0-5.0~+rc3/clang/lib/CodeGen/CodeGenTypes.h 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/lib/CodeGen/CodeGenTypes.h 2017-09-06 11:02:51.000000000 +0000 @@ -178,6 +178,7 @@ const TargetInfo &getTarget() const { return Target; } CGCXXABI &getCXXABI() const { return TheCXXABI; } llvm::LLVMContext &getLLVMContext() { return TheModule.getContext(); } + const CodeGenOptions &getCodeGenOpts() const; /// ConvertType - Convert type T into a llvm::Type. llvm::Type *ConvertType(QualType T); diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/lib/CodeGen/ItaniumCXXABI.cpp llvm-toolchain-5.0-5.0/clang/lib/CodeGen/ItaniumCXXABI.cpp --- llvm-toolchain-5.0-5.0~+rc3/clang/lib/CodeGen/ItaniumCXXABI.cpp 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/lib/CodeGen/ItaniumCXXABI.cpp 2017-09-06 11:02:51.000000000 +0000 @@ -62,9 +62,20 @@ bool classifyReturnType(CGFunctionInfo &FI) const override; + bool passClassIndirect(const CXXRecordDecl *RD) const { + // Clang <= 4 used the pre-C++11 rule, which ignores move operations. + // The PS4 platform ABI follows the behavior of Clang 3.2. + if (CGM.getCodeGenOpts().getClangABICompat() <= + CodeGenOptions::ClangABI::Ver4 || + CGM.getTriple().getOS() == llvm::Triple::PS4) + return RD->hasNonTrivialDestructor() || + RD->hasNonTrivialCopyConstructor(); + return !canCopyArgument(RD); + } + RecordArgABI getRecordArgABI(const CXXRecordDecl *RD) const override { // If C++ prohibits us from making a copy, pass by address. - if (!canCopyArgument(RD)) + if (passClassIndirect(RD)) return RAA_Indirect; return RAA_Default; } @@ -996,7 +1007,7 @@ return false; // If C++ prohibits us from making a copy, return by address. - if (!canCopyArgument(RD)) { + if (passClassIndirect(RD)) { auto Align = CGM.getContext().getTypeAlignInChars(FI.getReturnType()); FI.getReturnInfo() = ABIArgInfo::getIndirect(Align, /*ByVal=*/false); return true; diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/lib/CodeGen/TargetInfo.cpp llvm-toolchain-5.0-5.0/clang/lib/CodeGen/TargetInfo.cpp --- llvm-toolchain-5.0-5.0~+rc3/clang/lib/CodeGen/TargetInfo.cpp 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/lib/CodeGen/TargetInfo.cpp 2017-09-06 11:02:51.000000000 +0000 @@ -183,7 +183,11 @@ return CGT.getTarget(); } -bool ABIInfo:: isAndroid() const { return getTarget().getTriple().isAndroid(); } +const CodeGenOptions &ABIInfo::getCodeGenOpts() const { + return CGT.getCodeGenOpts(); +} + +bool ABIInfo::isAndroid() const { return getTarget().getTriple().isAndroid(); } bool ABIInfo::isHomogeneousAggregateBaseType(QualType Ty) const { return false; @@ -2095,9 +2099,14 @@ return !getTarget().getTriple().isOSDarwin(); } - /// GCC classifies <1 x long long> as SSE but compatibility with older clang - // compilers require us to classify it as INTEGER. + /// GCC classifies <1 x long long> as SSE but some platform ABIs choose to + /// classify it as INTEGER (for compatibility with older clang compilers). bool classifyIntegerMMXAsSSE() const { + // Clang <= 3.8 did not do this. + if (getCodeGenOpts().getClangABICompat() <= + CodeGenOptions::ClangABI::Ver3_8) + return false; + const llvm::Triple &Triple = getTarget().getTriple(); if (Triple.isOSDarwin() || Triple.getOS() == llvm::Triple::PS4) return false; diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/lib/Driver/ToolChains/Clang.cpp llvm-toolchain-5.0-5.0/clang/lib/Driver/ToolChains/Clang.cpp --- llvm-toolchain-5.0-5.0~+rc3/clang/lib/Driver/ToolChains/Clang.cpp 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/lib/Driver/ToolChains/Clang.cpp 2017-09-06 11:02:51.000000000 +0000 @@ -2855,6 +2855,9 @@ addPGOAndCoverageFlags(C, D, Output, Args, CmdArgs); + if (auto *ABICompatArg = Args.getLastArg(options::OPT_fclang_abi_compat_EQ)) + ABICompatArg->render(Args, CmdArgs); + // Add runtime flag for PS4 when PGO or Coverage are enabled. if (getToolChain().getTriple().isPS4CPU()) PS4cpu::addProfileRTArgs(getToolChain(), Args, CmdArgs); diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/lib/Frontend/CompilerInvocation.cpp llvm-toolchain-5.0-5.0/clang/lib/Frontend/CompilerInvocation.cpp --- llvm-toolchain-5.0-5.0~+rc3/clang/lib/Frontend/CompilerInvocation.cpp 2017-08-26 15:40:49.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/lib/Frontend/CompilerInvocation.cpp 2017-09-06 11:02:51.000000000 +0000 @@ -573,6 +573,33 @@ if (!Opts.ProfileInstrumentUsePath.empty()) setPGOUseInstrumentor(Opts, Opts.ProfileInstrumentUsePath); + if (Arg *A = Args.getLastArg(OPT_fclang_abi_compat_EQ)) { + Opts.setClangABICompat(CodeGenOptions::ClangABI::Latest); + + StringRef Ver = A->getValue(); + std::pair VerParts = Ver.split('.'); + unsigned Major, Minor = 0; + + // Check the version number is valid: either 3.x (0 <= x <= 9) or + // y or y.0 (4 <= y <= current version). + if (!VerParts.first.startswith("0") && + !VerParts.first.getAsInteger(10, Major) && + 3 <= Major && Major <= CLANG_VERSION_MAJOR && + (Major == 3 ? VerParts.second.size() == 1 && + !VerParts.second.getAsInteger(10, Minor) + : VerParts.first.size() == Ver.size() || + VerParts.second == "0")) { + // Got a valid version number. + if (Major == 3 && Minor <= 8) + Opts.setClangABICompat(CodeGenOptions::ClangABI::Ver3_8); + else if (Major <= 4) + Opts.setClangABICompat(CodeGenOptions::ClangABI::Ver4); + } else if (Ver != "latest") { + Diags.Report(diag::err_drv_invalid_value) + << A->getAsString(Args) << A->getValue(); + } + } + Opts.CoverageMapping = Args.hasFlag(OPT_fcoverage_mapping, OPT_fno_coverage_mapping, false); Opts.DumpCoverageMapping = Args.hasArg(OPT_dump_coverage_mapping); diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/test/CodeGenCXX/clang-abi-compat.cpp llvm-toolchain-5.0-5.0/clang/test/CodeGenCXX/clang-abi-compat.cpp --- llvm-toolchain-5.0-5.0~+rc3/clang/test/CodeGenCXX/clang-abi-compat.cpp 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/test/CodeGenCXX/clang-abi-compat.cpp 2017-09-06 11:02:51.000000000 +0000 @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -std=c++17 -triple x86_64-linux-gnu -fclang-abi-compat=3.0 %s -emit-llvm -o - | FileCheck --check-prefix=PRE39 --check-prefix=PRE5 %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-linux-gnu -fclang-abi-compat=3.8 %s -emit-llvm -o - | FileCheck --check-prefix=PRE39 --check-prefix=PRE5 %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-linux-gnu -fclang-abi-compat=3.9 %s -emit-llvm -o - | FileCheck --check-prefix=V39 --check-prefix=PRE5 %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-linux-gnu -fclang-abi-compat=4.0 %s -emit-llvm -o - | FileCheck --check-prefix=V39 --check-prefix=PRE5 %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-linux-gnu -fclang-abi-compat=5 %s -emit-llvm -o - | FileCheck --check-prefix=V39 --check-prefix=V5 %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-linux-gnu -fclang-abi-compat=latest %s -emit-llvm -o - | FileCheck --check-prefix=V39 --check-prefix=V5 %s + +typedef __attribute__((vector_size(8))) long long v1xi64; +void clang39(v1xi64) {} +// PRE39: @_Z7clang39Dv1_x(i64 +// V39: @_Z7clang39Dv1_x(double + +struct A { + A(const A&) = default; + A(A&&); +}; +void clang5(A) {} +// PRE5: @_Z6clang51A() +// V5: @_Z6clang51A(%{{.*}}* diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/test/CodeGenCXX/uncopyable-args.cpp llvm-toolchain-5.0-5.0/clang/test/CodeGenCXX/uncopyable-args.cpp --- llvm-toolchain-5.0-5.0~+rc3/clang/test/CodeGenCXX/uncopyable-args.cpp 2017-08-26 15:40:50.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/test/CodeGenCXX/uncopyable-args.cpp 2017-09-06 11:02:51.000000000 +0000 @@ -1,4 +1,6 @@ -// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK --check-prefix=NEWABI +// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown -fclang-abi-compat=4.0 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK --check-prefix=OLDABI +// RUN: %clang_cc1 -std=c++11 -triple x86_64-scei-ps4 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK --check-prefix=OLDABI // RUN: %clang_cc1 -std=c++11 -triple x86_64-windows-msvc -emit-llvm -o - %s -fms-compatibility -fms-compatibility-version=18 | FileCheck %s -check-prefix=WIN64 -check-prefix=WIN64-18 // RUN: %clang_cc1 -std=c++11 -triple x86_64-windows-msvc -emit-llvm -o - %s -fms-compatibility -fms-compatibility-version=19 | FileCheck %s -check-prefix=WIN64 -check-prefix=WIN64-19 @@ -56,8 +58,10 @@ // CHECK-LABEL: define void @_ZN9move_ctor3barEv() // CHECK: call void @_Z{{.*}}C1Ev( // CHECK-NOT: call -// CHECK: call void @_ZN9move_ctor3fooENS_1AE(%"struct.move_ctor::A"* %{{.*}}) -// CHECK-LABEL: declare void @_ZN9move_ctor3fooENS_1AE(%"struct.move_ctor::A"*) +// NEWABI: call void @_ZN9move_ctor3fooENS_1AE(%"struct.move_ctor::A"* %{{.*}}) +// OLDABI: call void @_ZN9move_ctor3fooENS_1AE(i8* %{{.*}}) +// NEWABI-LABEL: declare void @_ZN9move_ctor3fooENS_1AE(%"struct.move_ctor::A"*) +// OLDABI-LABEL: declare void @_ZN9move_ctor3fooENS_1AE(i8*) // WIN64-LABEL: declare void @"\01?foo@move_ctor@@YAXUA@1@@Z"(%"struct.move_ctor::A"*) } @@ -76,8 +80,10 @@ // CHECK-LABEL: define void @_ZN11all_deleted3barEv() // CHECK: call void @_Z{{.*}}C1Ev( // CHECK-NOT: call -// CHECK: call void @_ZN11all_deleted3fooENS_1AE(%"struct.all_deleted::A"* %{{.*}}) -// CHECK-LABEL: declare void @_ZN11all_deleted3fooENS_1AE(%"struct.all_deleted::A"*) +// NEWABI: call void @_ZN11all_deleted3fooENS_1AE(%"struct.all_deleted::A"* %{{.*}}) +// OLDABI: call void @_ZN11all_deleted3fooENS_1AE(i8* %{{.*}}) +// NEWABI-LABEL: declare void @_ZN11all_deleted3fooENS_1AE(%"struct.all_deleted::A"*) +// OLDABI-LABEL: declare void @_ZN11all_deleted3fooENS_1AE(i8*) // WIN64-LABEL: declare void @"\01?foo@all_deleted@@YAXUA@1@@Z"(%"struct.all_deleted::A"*) } @@ -95,8 +101,10 @@ // CHECK-LABEL: define void @_ZN18implicitly_deleted3barEv() // CHECK: call void @_Z{{.*}}C1Ev( // CHECK-NOT: call -// CHECK: call void @_ZN18implicitly_deleted3fooENS_1AE(%"struct.implicitly_deleted::A"* %{{.*}}) -// CHECK-LABEL: declare void @_ZN18implicitly_deleted3fooENS_1AE(%"struct.implicitly_deleted::A"*) +// NEWABI: call void @_ZN18implicitly_deleted3fooENS_1AE(%"struct.implicitly_deleted::A"* %{{.*}}) +// OLDABI: call void @_ZN18implicitly_deleted3fooENS_1AE(i8* %{{.*}}) +// NEWABI-LABEL: declare void @_ZN18implicitly_deleted3fooENS_1AE(%"struct.implicitly_deleted::A"*) +// OLDABI-LABEL: declare void @_ZN18implicitly_deleted3fooENS_1AE(i8*) // In MSVC 2013, the copy ctor is not deleted by a move assignment. In MSVC 2015, it is. // WIN64-18-LABEL: declare void @"\01?foo@implicitly_deleted@@YAXUA@1@@Z"(i64 @@ -116,8 +124,10 @@ // CHECK-LABEL: define void @_ZN11one_deleted3barEv() // CHECK: call void @_Z{{.*}}C1Ev( // CHECK-NOT: call -// CHECK: call void @_ZN11one_deleted3fooENS_1AE(%"struct.one_deleted::A"* %{{.*}}) -// CHECK-LABEL: declare void @_ZN11one_deleted3fooENS_1AE(%"struct.one_deleted::A"*) +// NEWABI: call void @_ZN11one_deleted3fooENS_1AE(%"struct.one_deleted::A"* %{{.*}}) +// OLDABI: call void @_ZN11one_deleted3fooENS_1AE(i8* %{{.*}}) +// NEWABI-LABEL: declare void @_ZN11one_deleted3fooENS_1AE(%"struct.one_deleted::A"*) +// OLDABI-LABEL: declare void @_ZN11one_deleted3fooENS_1AE(i8*) // WIN64-LABEL: declare void @"\01?foo@one_deleted@@YAXUA@1@@Z"(%"struct.one_deleted::A"*) } @@ -196,8 +206,10 @@ } // CHECK-LABEL: define void @_ZN14two_copy_ctors3barEv() // CHECK: call void @_Z{{.*}}C1Ev( -// CHECK: call void @_ZN14two_copy_ctors3fooENS_1BE(%"struct.two_copy_ctors::B"* %{{.*}}) -// CHECK-LABEL: declare void @_ZN14two_copy_ctors3fooENS_1BE(%"struct.two_copy_ctors::B"*) +// NEWABI: call void @_ZN14two_copy_ctors3fooENS_1BE(%"struct.two_copy_ctors::B"* %{{.*}}) +// OLDABI: call void @_ZN14two_copy_ctors3fooENS_1BE(%"struct.two_copy_ctors::B"* byval +// NEWABI-LABEL: declare void @_ZN14two_copy_ctors3fooENS_1BE(%"struct.two_copy_ctors::B"*) +// OLDABI-LABEL: declare void @_ZN14two_copy_ctors3fooENS_1BE(%"struct.two_copy_ctors::B"* byval // WIN64-LABEL: declare void @"\01?foo@two_copy_ctors@@YAXUB@1@@Z"(%"struct.two_copy_ctors::B"*) } @@ -209,7 +221,8 @@ void *p; }; void *foo(A a) { return a.p; } -// CHECK-LABEL: define i8* @_ZN15definition_only3fooENS_1AE(%"struct.definition_only::A"* +// NEWABI-LABEL: define i8* @_ZN15definition_only3fooENS_1AE(%"struct.definition_only::A"* +// OLDABI-LABEL: define i8* @_ZN15definition_only3fooENS_1AE(i8* // WIN64-LABEL: define i8* @"\01?foo@definition_only@@YAPEAXUA@1@@Z"(%"struct.definition_only::A"* } @@ -224,7 +237,8 @@ B b; }; void *foo(A a) { return a.b.p; } -// CHECK-LABEL: define i8* @_ZN17deleted_by_member3fooENS_1AE(%"struct.deleted_by_member::A"* +// NEWABI-LABEL: define i8* @_ZN17deleted_by_member3fooENS_1AE(%"struct.deleted_by_member::A"* +// OLDABI-LABEL: define i8* @_ZN17deleted_by_member3fooENS_1AE(i8* // WIN64-LABEL: define i8* @"\01?foo@deleted_by_member@@YAPEAXUA@1@@Z"(%"struct.deleted_by_member::A"* } @@ -238,7 +252,8 @@ A(); }; void *foo(A a) { return a.p; } -// CHECK-LABEL: define i8* @_ZN15deleted_by_base3fooENS_1AE(%"struct.deleted_by_base::A"* +// NEWABI-LABEL: define i8* @_ZN15deleted_by_base3fooENS_1AE(%"struct.deleted_by_base::A"* +// OLDABI-LABEL: define i8* @_ZN15deleted_by_base3fooENS_1AE(i8* // WIN64-LABEL: define i8* @"\01?foo@deleted_by_base@@YAPEAXUA@1@@Z"(%"struct.deleted_by_base::A"* } @@ -253,7 +268,8 @@ B b; }; void *foo(A a) { return a.b.p; } -// CHECK-LABEL: define i8* @_ZN22deleted_by_member_copy3fooENS_1AE(%"struct.deleted_by_member_copy::A"* +// NEWABI-LABEL: define i8* @_ZN22deleted_by_member_copy3fooENS_1AE(%"struct.deleted_by_member_copy::A"* +// OLDABI-LABEL: define i8* @_ZN22deleted_by_member_copy3fooENS_1AE(i8* // WIN64-LABEL: define i8* @"\01?foo@deleted_by_member_copy@@YAPEAXUA@1@@Z"(%"struct.deleted_by_member_copy::A"* } @@ -267,7 +283,8 @@ A(); }; void *foo(A a) { return a.p; } -// CHECK-LABEL: define i8* @_ZN20deleted_by_base_copy3fooENS_1AE(%"struct.deleted_by_base_copy::A"* +// NEWABI-LABEL: define i8* @_ZN20deleted_by_base_copy3fooENS_1AE(%"struct.deleted_by_base_copy::A"* +// OLDABI-LABEL: define i8* @_ZN20deleted_by_base_copy3fooENS_1AE(i8* // WIN64-LABEL: define i8* @"\01?foo@deleted_by_base_copy@@YAPEAXUA@1@@Z"(%"struct.deleted_by_base_copy::A"* } @@ -277,7 +294,8 @@ A(const A &o) = delete; void *p; }; -// CHECK-LABEL: define i8* @_ZN15explicit_delete3fooENS_1AE(%"struct.explicit_delete::A"* +// NEWABI-LABEL: define i8* @_ZN15explicit_delete3fooENS_1AE(%"struct.explicit_delete::A"* +// OLDABI-LABEL: define i8* @_ZN15explicit_delete3fooENS_1AE(i8* // WIN64-LABEL: define i8* @"\01?foo@explicit_delete@@YAPEAXUA@1@@Z"(%"struct.explicit_delete::A"* void *foo(A a) { return a.p; } } @@ -289,7 +307,8 @@ // Deleted copy ctor due to rvalue ref member. int &&ref; }; -// CHECK-LABEL: define {{.*}} @_ZN28implicitly_deleted_copy_ctor3fooENS_1AE(%"struct.implicitly_deleted_copy_ctor::A"* +// NEWABI-LABEL: define {{.*}} @_ZN28implicitly_deleted_copy_ctor3fooENS_1AE(%"struct.implicitly_deleted_copy_ctor::A"* +// OLDABI-LABEL: define {{.*}} @_ZN28implicitly_deleted_copy_ctor3fooENS_1AE(i32* // WIN64-LABEL: define {{.*}} @"\01?foo@implicitly_deleted_copy_ctor@@YAAEAHUA@1@@Z"(%"struct.implicitly_deleted_copy_ctor::A"* int &foo(A a) { return a.ref; } diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/test/Driver/flags.c llvm-toolchain-5.0-5.0/clang/test/Driver/flags.c --- llvm-toolchain-5.0-5.0~+rc3/clang/test/Driver/flags.c 2017-08-26 15:40:50.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/test/Driver/flags.c 2017-09-06 11:02:52.000000000 +0000 @@ -24,3 +24,6 @@ // RUN: %clang -target armv7-apple-darwin10 -### -S -mno-implicit-float -mimplicit-float %s 2>&1 | FileCheck -check-prefix=TEST8 %s // TEST8-NOT: "-no-implicit-float" + +// RUN: %clang -target x86_64-linux-gnu -### -c -fclang-abi-compat=3.2 %s 2>&1 | FileCheck -check-prefix=TEST9 %s +// TEST9: "-fclang-abi-compat=3.2" diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang/test/Frontend/clang-abi-compat.cpp llvm-toolchain-5.0-5.0/clang/test/Frontend/clang-abi-compat.cpp --- llvm-toolchain-5.0-5.0~+rc3/clang/test/Frontend/clang-abi-compat.cpp 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang/test/Frontend/clang-abi-compat.cpp 2017-09-06 11:02:52.000000000 +0000 @@ -0,0 +1,15 @@ +// RUN: not %clang_cc1 -fclang-abi-compat=banana %s -fsyntax-only 2>&1 | FileCheck --check-prefix=INVALID %s +// RUN: not %clang_cc1 -fclang-abi-compat=2.9 %s -fsyntax-only 2>&1 | FileCheck --check-prefix=INVALID %s +// RUN: not %clang_cc1 -fclang-abi-compat=8 %s -fsyntax-only 2>&1 | FileCheck --check-prefix=INVALID %s +// RUN: not %clang_cc1 -fclang-abi-compat=3.10 %s -fsyntax-only 2>&1 | FileCheck --check-prefix=INVALID %s +// RUN: not %clang_cc1 -fclang-abi-compat=4.1 %s -fsyntax-only 2>&1 | FileCheck --check-prefix=INVALID %s +// RUN: not %clang_cc1 -fclang-abi-compat=04 %s -fsyntax-only 2>&1 | FileCheck --check-prefix=INVALID %s +// RUN: not %clang_cc1 -fclang-abi-compat=4. %s -fsyntax-only 2>&1 | FileCheck --check-prefix=INVALID %s +// RUN: not %clang_cc1 -fclang-abi-compat=4.00 %s -fsyntax-only 2>&1 | FileCheck --check-prefix=INVALID %s +// INVALID: error: invalid value '{{.*}}' in '-fclang-abi-compat={{.*}}' +// +// RUN: %clang_cc1 -fclang-abi-compat=3.0 %s -fsyntax-only +// RUN: %clang_cc1 -fclang-abi-compat=3.9 %s -fsyntax-only +// RUN: %clang_cc1 -fclang-abi-compat=4 %s -fsyntax-only +// RUN: %clang_cc1 -fclang-abi-compat=4.0 %s -fsyntax-only +// RUN: %clang_cc1 -fclang-abi-compat=latest %s -fsyntax-only diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang-tools-extra/docs/index.rst llvm-toolchain-5.0-5.0/clang-tools-extra/docs/index.rst --- llvm-toolchain-5.0-5.0~+rc3/clang-tools-extra/docs/index.rst 2017-08-26 15:41:00.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang-tools-extra/docs/index.rst 2017-09-06 11:03:10.000000000 +0000 @@ -28,24 +28,6 @@ clangd -Doxygen Documentation -===================== -The Doxygen documentation describes the **internal** software that makes up the -tools of clang-tools-extra, not the **external** use of these tools. The Doxygen -documentation contains no instructions about how to use the tools, only the APIs -that make up the software. For usage instructions, please see the user's guide -or reference manual for each tool. - -* `Doxygen documentation`_ - -.. _`Doxygen documentation`: doxygen/annotated.html - -.. note:: - This documentation is generated directly from the source code with doxygen. - Since the tools of clang-tools-extra are constantly under active - development, what you're about to read is out of date! - - Indices and tables ================== diff -Nru llvm-toolchain-5.0-5.0~+rc3/clang-tools-extra/docs/ReleaseNotes.rst llvm-toolchain-5.0-5.0/clang-tools-extra/docs/ReleaseNotes.rst --- llvm-toolchain-5.0-5.0~+rc3/clang-tools-extra/docs/ReleaseNotes.rst 2017-08-26 15:41:00.000000000 +0000 +++ llvm-toolchain-5.0-5.0/clang-tools-extra/docs/ReleaseNotes.rst 2017-09-06 11:03:10.000000000 +0000 @@ -21,11 +21,6 @@ the latest release, please see the `Clang Web Site `_ or the `LLVM Web Site `_. -Note that if you are reading this file from a Subversion checkout or the -main Clang web page, this document applies to the *next* release, not -the current one. To see the release notes for a specific release, please -see the `releases page `_. - What's New in Extra Clang Tools 5.0.0? ====================================== diff -Nru llvm-toolchain-5.0-5.0~+rc3/debian/changelog llvm-toolchain-5.0-5.0/debian/changelog --- llvm-toolchain-5.0-5.0~+rc3/debian/changelog 2017-08-28 09:55:40.000000000 +0000 +++ llvm-toolchain-5.0-5.0/debian/changelog 2017-10-03 10:24:29.000000000 +0000 @@ -1,8 +1,58 @@ -llvm-toolchain-5.0 (1:5.0~+rc3-1~gd~x) xenial; urgency=medium +llvm-toolchain-5.0 (1:5.0-0ubuntu0~xedgers16.04.1) xenial; urgency=medium - * No-change backport to xenial + * Copied from artful - -- Fabio Pedretti Mon, 28 Aug 2017 11:55:40 +0200 + -- Rico Tzschichholz Tue, 03 Oct 2017 12:24:29 +0200 + +llvm-toolchain-5.0 (1:5.0-2ubuntu1) artful; urgency=medium + + * Add NDEBUG macro, lost in the previous -g --> -g1 switch + + -- Gianfranco Costamagna Mon, 25 Sep 2017 10:27:03 +0200 + +llvm-toolchain-5.0 (1:5.0-2) unstable; urgency=medium + + [ Matthias Klose ] + * Link with --no-keep-files-mapped --no-map-whole-files when using gold. + * build using gold on arm64 and s390x. For backports, arm64 might still + need the BFD linker, and building with only one or two processes in + parallel. + * On amd64, s390x, arm64 and ppc64el, build with -g1 instead of -g. + * Set CMAKE_CXX_FLAGS_RELWITHDEBINFO and pass opt_flags. + + -- Sylvestre Ledru Mon, 18 Sep 2017 21:53:00 +0200 + +llvm-toolchain-5.0 (1:5.0-1) unstable; urgency=medium + + * New stable release + + -- Sylvestre Ledru Wed, 06 Sep 2017 13:04:44 +0200 + +llvm-toolchain-5.0 (1:5.0~+rc5-2) unstable; urgency=medium + + * Fail the build if the arch + gcc has a broken gsplit-dwarf support + + -- Sylvestre Ledru Sun, 03 Sep 2017 15:13:34 +0200 + +llvm-toolchain-5.0 (1:5.0~+rc5-1) unstable; urgency=medium + + * New testing release + + -- Sylvestre Ledru Fri, 01 Sep 2017 23:18:29 +0200 + +llvm-toolchain-5.0 (1:5.0~+rc4-2) unstable; urgency=medium + + * Fix the FTBFS because of -gsplit-dwarf: + - Only enable it on archs which needs it + - Only enable it when gcc supports it correctly + + -- Sylvestre Ledru Thu, 31 Aug 2017 19:14:45 +0200 + +llvm-toolchain-5.0 (1:5.0~+rc4-1) unstable; urgency=medium + + * New testing release + + -- Sylvestre Ledru Wed, 30 Aug 2017 16:06:39 +0200 llvm-toolchain-5.0 (1:5.0~+rc3-1) unstable; urgency=medium diff -Nru llvm-toolchain-5.0-5.0~+rc3/debian/control llvm-toolchain-5.0-5.0/debian/control --- llvm-toolchain-5.0-5.0~+rc3/debian/control 2017-08-24 21:04:21.000000000 +0000 +++ llvm-toolchain-5.0-5.0/debian/control 2017-10-03 10:24:29.000000000 +0000 @@ -1,7 +1,8 @@ Source: llvm-toolchain-5.0 Section: devel Priority: optional -Maintainer: LLVM Packaging Team +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: LLVM Packaging Team Uploaders: Sylvestre Ledru Build-Depends: debhelper (>= 9.0), flex, bison, dejagnu, tcl, expect, cmake, perl, libtool, chrpath, texinfo, sharutils, libffi-dev (>= 3.0.9), @@ -229,6 +230,8 @@ Depends: ${shlibs:Depends}, ${misc:Depends} Pre-Depends: ${misc:Pre-Depends} Multi-Arch: same +Breaks: libllvm3.9v4 +Replaces: libllvm3.9v4 Description: Modular compiler and toolchain technologies, runtime library LLVM is a collection of libraries and tools that make it easy to build compilers, optimizers, just-in-time code generators, and many other @@ -243,6 +246,8 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm5.0 (= ${binary:Version}) Pre-Depends: ${misc:Pre-Depends} Multi-Arch: same +Breaks: libllvm3.9v4-dbg +Replaces: libllvm3.9v4-dbg Description: Modular compiler and toolchain technologies, debugging libraries LLVM is a collection of libraries and tools that make it easy to build compilers, optimizers, just-in-time code generators, and many other diff -Nru llvm-toolchain-5.0-5.0~+rc3/debian/libclang1-X.Y.symbols.in llvm-toolchain-5.0-5.0/debian/libclang1-X.Y.symbols.in --- llvm-toolchain-5.0-5.0~+rc3/debian/libclang1-X.Y.symbols.in 2017-07-31 06:42:34.000000000 +0000 +++ llvm-toolchain-5.0-5.0/debian/libclang1-X.Y.symbols.in 2017-08-26 20:27:39.000000000 +0000 @@ -62,14 +62,14 @@ clang_Cursor_isAnonymous@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_Cursor_isBitField@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_Cursor_isDynamicCall@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ - clang_Cursor_isExternalSymbol@LLVM_@LLVM_VERSION@ 1:5.0~+rc1 + clang_Cursor_isExternalSymbol@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~ clang_Cursor_isFunctionInlined@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_Cursor_isMacroBuiltin@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_Cursor_isMacroFunctionLike@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_Cursor_isNull@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_Cursor_isObjCOptional@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_Cursor_isVariadic@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ - clang_EnumDecl_isScoped@LLVM_@LLVM_VERSION@ 1:5.0~+rc1 + clang_EnumDecl_isScoped@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~ clang_EvalResult_dispose@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_EvalResult_getAsDouble@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_EvalResult_getAsInt@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ @@ -189,7 +189,7 @@ clang_findReferencesInFileWithBlock@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_formatDiagnostic@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_free@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ - clang_getAddressSpace@LLVM_@LLVM_VERSION@ 1:5.0~+rc1 + clang_getAddressSpace@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~ clang_getAllSkippedRanges@LLVM_@LLVM_VERSION@ 1:5.0~svn302377-1~ clang_getArgType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_getArrayElementType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ @@ -216,7 +216,7 @@ clang_getCursorCompletionString@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_getCursorDefinition@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_getCursorDisplayName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ - clang_getCursorExceptionSpecificationType@LLVM_@LLVM_VERSION@ 1:5.0~+rc1 + clang_getCursorExceptionSpecificationType@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~ clang_getCursorExtent@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_getCursorKind@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_getCursorKindSpelling@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ @@ -253,7 +253,7 @@ clang_getEnumConstantDeclUnsignedValue@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_getEnumConstantDeclValue@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_getEnumDeclIntegerType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ - clang_getExceptionSpecificationType@LLVM_@LLVM_VERSION@ 1:5.0~+rc1 + clang_getExceptionSpecificationType@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~ clang_getExpansionLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_getFieldDeclBitWidth@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_getFile@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ @@ -304,7 +304,7 @@ clang_getTypeKindSpelling@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_getTypeSpelling@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_getTypedefDeclUnderlyingType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ - clang_getTypedefName@LLVM_@LLVM_VERSION@ 1:5.0~+rc1 + clang_getTypedefName@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~ clang_hashCursor@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_indexLoc_getCXSourceLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_indexLoc_getFileLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ @@ -350,7 +350,7 @@ clang_reparseTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_saveTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_sortCodeCompletionResults@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ - clang_suspendTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~+rc1 + clang_suspendTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~ clang_toggleCrashRecovery@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_tokenize@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ clang_visitChildren@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~ diff -Nru llvm-toolchain-5.0-5.0~+rc3/debian/rules llvm-toolchain-5.0-5.0/debian/rules --- llvm-toolchain-5.0-5.0~+rc3/debian/rules 2017-08-26 08:16:07.000000000 +0000 +++ llvm-toolchain-5.0-5.0/debian/rules 2017-09-25 08:26:56.000000000 +0000 @@ -34,15 +34,22 @@ LDFLAGS_EXTRA += -latomic endif +ENABLE_SPLIT_DWARF_ARCHS := armel armhf i386 mips powerpc +# Only enable gsplit dwarf on archs which needs it +ifneq (,$(filter $(DEB_HOST_ARCH),$(ENABLE_SPLIT_DWARF_ARCHS))) ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' binutils) ge 2.22.52.0.4 ; echo $$?),0) # when using -gsplit-dwarf, it will requires extract-dwo which doesn't exist on precise: # More: https://llvm.org/bugs/show_bug.cgi?id=28841 -ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) lt 7.1.0-7~ ; echo $$?),0) -# Do not pass -gsplit-dwarf with gcc 7. This is causing some linking issues -# More: https://bugs.llvm.org/show_bug.cgi?id=34140 +ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) lt 7.1.0-7~ || \ + dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) ge 7.2.0-2; echo $$?),0) +# Only pass -gsplit-dwarf with working version of gcc 7 +# More: https://bugs.llvm.org/show_bug.cgi?id=34140 & https://bugs.debian.org/873609 CXXFLAGS_EXTRA += -gsplit-dwarf -endif -endif +else +$(error "Broken gcc version for -gsplit-dwarf support. Please use < gcc 7 or >= 7.2.0-2") +endif # < gcc 7 or >= 7.2.0-2 +endif # binutils +endif # archs ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) lt 4.7.2-10~ ; echo $$?),0) @@ -53,7 +60,13 @@ export CC=gcc-$(GCC_VERSION) export CXX=g++-$(GCC_VERSION) -opt_flags = -g -O2 +opt_flags = -O2 -DNDEBUG +ifneq (,$(filter $(DEB_HOST_ARCH),amd64 arm64 ppc64el s390x)) + opt_flags += -g1 +else + opt_flags += -g +endif + ifneq (,$(findstring $(DEB_HOST_ARCH),armel)) opt_flags += -marm # 3.8 fails to build, disable the compiler_rt builtins @@ -74,12 +87,12 @@ control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev' endif -BINUTILS_GOLD_ARCHS := amd64 armhf i386 powerpcspe ppc64 ppc64el sparc sparc64 x32 +BINUTILS_GOLD_ARCHS := amd64 arm64 armhf i386 powerpcspe ppc64 ppc64el sparc sparc64 x32 s390x ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' binutils) ge 2.23.1-1~exp3 ; echo $$?),0) ifneq (,$(filter $(DEB_HOST_ARCH),$(BINUTILS_GOLD_ARCHS))) # -fused-ld=gold enables the gold linker (but is not supported by all archs / distro) - LDFLAGS_EXTRA += -fuse-ld=gold - CXXFLAGS_EXTRA += -Wl,-fuse-ld=gold + LDFLAGS_EXTRA += -fuse-ld=gold --no-keep-files-mapped --no-map-whole-files + CXXFLAGS_EXTRA += -Wl,-fuse-ld=gold -Wl,--no-keep-files-mapped -Wl,--no-map-whole-files CMAKE_EXTRA += -DLLVM_BINUTILS_INCDIR=/usr/include/ endif endif @@ -267,6 +280,7 @@ -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$(LLVM_VERSION) \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(opt_flags)" \ -DCMAKE_CXX_FLAGS='$(CXXFLAGS_EXTRA)' \ -DLLVM_LINK_LLVM_DYLIB=ON \ -DLLVM_INSTALL_UTILS=ON \ diff -Nru llvm-toolchain-5.0-5.0~+rc3/docs/index.rst llvm-toolchain-5.0-5.0/docs/index.rst --- llvm-toolchain-5.0-5.0~+rc3/docs/index.rst 2017-08-26 15:40:28.000000000 +0000 +++ llvm-toolchain-5.0-5.0/docs/index.rst 2017-09-06 11:01:18.000000000 +0000 @@ -1,11 +1,6 @@ Overview ======== -.. warning:: - - If you are using a released version of LLVM, see `the download page - `_ to find your documentation. - The LLVM compiler infrastructure supports a wide range of projects, from industrial strength compilers to specialized JIT applications to small research projects. diff -Nru llvm-toolchain-5.0-5.0~+rc3/docs/ReleaseNotes.rst llvm-toolchain-5.0-5.0/docs/ReleaseNotes.rst --- llvm-toolchain-5.0-5.0~+rc3/docs/ReleaseNotes.rst 2017-08-26 15:40:28.000000000 +0000 +++ llvm-toolchain-5.0-5.0/docs/ReleaseNotes.rst 2017-09-06 11:01:18.000000000 +0000 @@ -46,6 +46,17 @@ HTML. The tool processes the YAML files produced by clang with the -fsave-optimization-record option. +* A new CMake macro ``LLVM_REVERSE_ITERATION`` has been added. If enabled, all + supported unordered LLVM containers would be iterated in reverse order. This + is useful for uncovering non-determinism caused by iteration of unordered + containers. Currently, it supports reverse iteration of SmallPtrSet and + DenseMap. + +* A new tool ``llvm-dlltool`` has been added to create short import libraries + from GNU style definition files. The tool utilizes the PE COFF SPEC Import + Library Format and PE COFF Auxiliary Weak Externals Format to achieve + compatibility with LLD and MSVC LINK. + Changes to the LLVM IR ---------------------- @@ -184,6 +195,9 @@ * Fixed many inline assembly bugs. +* Preliminary support for tracing NetBSD processes and core files with a single + thread in LLDB. + Changes to the AMDGPU Target ----------------------------- diff -Nru llvm-toolchain-5.0-5.0~+rc3/include/llvm/CodeGen/SelectionDAGNodes.h llvm-toolchain-5.0-5.0/include/llvm/CodeGen/SelectionDAGNodes.h --- llvm-toolchain-5.0-5.0~+rc3/include/llvm/CodeGen/SelectionDAGNodes.h 2017-08-26 15:40:28.000000000 +0000 +++ llvm-toolchain-5.0-5.0/include/llvm/CodeGen/SelectionDAGNodes.h 2017-09-06 11:01:18.000000000 +0000 @@ -801,7 +801,8 @@ /// if DAG changes. static bool hasPredecessorHelper(const SDNode *N, SmallPtrSetImpl &Visited, - SmallVectorImpl &Worklist) { + SmallVectorImpl &Worklist, + unsigned int MaxSteps = 0) { if (Visited.count(N)) return true; while (!Worklist.empty()) { @@ -816,6 +817,8 @@ } if (Found) return true; + if (MaxSteps != 0 && Visited.size() >= MaxSteps) + return false; } return false; } diff -Nru llvm-toolchain-5.0-5.0~+rc3/lib/Analysis/PostDominators.cpp llvm-toolchain-5.0-5.0/lib/Analysis/PostDominators.cpp --- llvm-toolchain-5.0-5.0~+rc3/lib/Analysis/PostDominators.cpp 2017-08-26 15:40:28.000000000 +0000 +++ llvm-toolchain-5.0-5.0/lib/Analysis/PostDominators.cpp 2017-09-06 11:01:18.000000000 +0000 @@ -23,8 +23,6 @@ #define DEBUG_TYPE "postdomtree" -template class llvm::DominatorTreeBase; // PostDomTreeBase - //===----------------------------------------------------------------------===// // PostDominatorTree Implementation //===----------------------------------------------------------------------===// diff -Nru llvm-toolchain-5.0-5.0~+rc3/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm-toolchain-5.0-5.0/lib/CodeGen/SelectionDAG/DAGCombiner.cpp --- llvm-toolchain-5.0-5.0~+rc3/lib/CodeGen/SelectionDAG/DAGCombiner.cpp 2017-08-26 15:40:28.000000000 +0000 +++ llvm-toolchain-5.0-5.0/lib/CodeGen/SelectionDAG/DAGCombiner.cpp 2017-09-06 11:01:18.000000000 +0000 @@ -12607,25 +12607,37 @@ } } -// We need to check that merging these stores does not cause a loop -// in the DAG. Any store candidate may depend on another candidate +// We need to check that merging these stores does not cause a loop in +// the DAG. Any store candidate may depend on another candidate // indirectly through its operand (we already consider dependencies // through the chain). Check in parallel by searching up from // non-chain operands of candidates. + bool DAGCombiner::checkMergeStoreCandidatesForDependencies( SmallVectorImpl &StoreNodes, unsigned NumStores) { + + // FIXME: We should be able to truncate a full search of + // predecessors by doing a BFS and keeping tabs the originating + // stores from which worklist nodes come from in a similar way to + // TokenFactor simplfication. + SmallPtrSet Visited; SmallVector Worklist; - // search ops of store candidates + unsigned int Max = 8192; + // Search Ops of store candidates. for (unsigned i = 0; i < NumStores; ++i) { SDNode *n = StoreNodes[i].MemNode; // Potential loops may happen only through non-chain operands for (unsigned j = 1; j < n->getNumOperands(); ++j) Worklist.push_back(n->getOperand(j).getNode()); } - // search through DAG. We can stop early if we find a storenode + // Search through DAG. We can stop early if we find a store node. for (unsigned i = 0; i < NumStores; ++i) { - if (SDNode::hasPredecessorHelper(StoreNodes[i].MemNode, Visited, Worklist)) + if (SDNode::hasPredecessorHelper(StoreNodes[i].MemNode, Visited, Worklist, + Max)) + return false; + // Check if we ended early, failing conservatively if so. + if (Visited.size() >= Max) return false; } return true; diff -Nru llvm-toolchain-5.0-5.0~+rc3/lib/Target/X86/X86ISelLowering.cpp llvm-toolchain-5.0-5.0/lib/Target/X86/X86ISelLowering.cpp --- llvm-toolchain-5.0-5.0~+rc3/lib/Target/X86/X86ISelLowering.cpp 2017-08-26 15:40:28.000000000 +0000 +++ llvm-toolchain-5.0-5.0/lib/Target/X86/X86ISelLowering.cpp 2017-09-06 11:01:19.000000000 +0000 @@ -30942,11 +30942,40 @@ return true; } +// When legalizing carry, we create carries via add X, -1 +// If that comes from an actual carry, via setcc, we use the +// carry directly. +static SDValue combineCarryThroughADD(SDValue EFLAGS) { + if (EFLAGS.getOpcode() == X86ISD::ADD) { + if (isAllOnesConstant(EFLAGS.getOperand(1))) { + SDValue Carry = EFLAGS.getOperand(0); + while (Carry.getOpcode() == ISD::TRUNCATE || + Carry.getOpcode() == ISD::ZERO_EXTEND || + Carry.getOpcode() == ISD::SIGN_EXTEND || + Carry.getOpcode() == ISD::ANY_EXTEND || + (Carry.getOpcode() == ISD::AND && + isOneConstant(Carry.getOperand(1)))) + Carry = Carry.getOperand(0); + if (Carry.getOpcode() == X86ISD::SETCC || + Carry.getOpcode() == X86ISD::SETCC_CARRY) { + if (Carry.getConstantOperandVal(0) == X86::COND_B) + return Carry.getOperand(1); + } + } + } + + return SDValue(); +} + /// Optimize an EFLAGS definition used according to the condition code \p CC /// into a simpler EFLAGS value, potentially returning a new \p CC and replacing /// uses of chain values. static SDValue combineSetCCEFLAGS(SDValue EFLAGS, X86::CondCode &CC, SelectionDAG &DAG) { + if (CC == X86::COND_B) + if (SDValue Flags = combineCarryThroughADD(EFLAGS)) + return Flags; + if (SDValue R = checkBoolTestSetCCCombine(EFLAGS, CC)) return R; return combineSetCCAtomicArith(EFLAGS, CC, DAG); @@ -34989,27 +35018,13 @@ return SDValue(); } -// Optimize RES, EFLAGS = X86ISD::ADD LHS, RHS -static SDValue combineX86ADD(SDNode *N, SelectionDAG &DAG, - X86TargetLowering::DAGCombinerInfo &DCI) { - // When legalizing carry, we create carries via add X, -1 - // If that comes from an actual carry, via setcc, we use the - // carry directly. - if (isAllOnesConstant(N->getOperand(1)) && N->hasAnyUseOfValue(1)) { - SDValue Carry = N->getOperand(0); - while (Carry.getOpcode() == ISD::TRUNCATE || - Carry.getOpcode() == ISD::ZERO_EXTEND || - Carry.getOpcode() == ISD::SIGN_EXTEND || - Carry.getOpcode() == ISD::ANY_EXTEND || - (Carry.getOpcode() == ISD::AND && - isOneConstant(Carry.getOperand(1)))) - Carry = Carry.getOperand(0); - - if (Carry.getOpcode() == X86ISD::SETCC || - Carry.getOpcode() == X86ISD::SETCC_CARRY) { - if (Carry.getConstantOperandVal(0) == X86::COND_B) - return DCI.CombineTo(N, SDValue(N, 0), Carry.getOperand(1)); - } +static SDValue combineSBB(SDNode *N, SelectionDAG &DAG) { + if (SDValue Flags = combineCarryThroughADD(N->getOperand(2))) { + MVT VT = N->getSimpleValueType(0); + SDVTList VTs = DAG.getVTList(VT, MVT::i32); + return DAG.getNode(X86ISD::SBB, SDLoc(N), VTs, + N->getOperand(0), N->getOperand(1), + Flags); } return SDValue(); @@ -35038,6 +35053,14 @@ return DCI.CombineTo(N, Res1, CarryOut); } + if (SDValue Flags = combineCarryThroughADD(N->getOperand(2))) { + MVT VT = N->getSimpleValueType(0); + SDVTList VTs = DAG.getVTList(VT, MVT::i32); + return DAG.getNode(X86ISD::ADC, SDLoc(N), VTs, + N->getOperand(0), N->getOperand(1), + Flags); + } + return SDValue(); } @@ -35677,7 +35700,7 @@ case X86ISD::CMOV: return combineCMov(N, DAG, DCI, Subtarget); case ISD::ADD: return combineAdd(N, DAG, Subtarget); case ISD::SUB: return combineSub(N, DAG, Subtarget); - case X86ISD::ADD: return combineX86ADD(N, DAG, DCI); + case X86ISD::SBB: return combineSBB(N, DAG); case X86ISD::ADC: return combineADC(N, DAG, DCI); case ISD::MUL: return combineMul(N, DAG, DCI, Subtarget); case ISD::SHL: diff -Nru llvm-toolchain-5.0-5.0~+rc3/lldb/source/Host/common/TCPSocket.cpp llvm-toolchain-5.0-5.0/lldb/source/Host/common/TCPSocket.cpp --- llvm-toolchain-5.0-5.0~+rc3/lldb/source/Host/common/TCPSocket.cpp 2017-08-26 15:41:11.000000000 +0000 +++ llvm-toolchain-5.0-5.0/lldb/source/Host/common/TCPSocket.cpp 2017-09-06 11:04:39.000000000 +0000 @@ -198,9 +198,14 @@ ::setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, option_value_p, sizeof(option_value)); - address.SetPort(port); + SocketAddress listen_address = address; + if(!listen_address.IsLocalhost()) + listen_address.SetToAnyAddress(address.GetFamily(), port); + else + listen_address.SetPort(port); - int err = ::bind(fd, &address.sockaddr(), address.GetLength()); + int err = + ::bind(fd, &listen_address.sockaddr(), listen_address.GetLength()); if (-1 != err) err = ::listen(fd, backlog); diff -Nru llvm-toolchain-5.0-5.0~+rc3/lldb/unittests/Host/SocketTest.cpp llvm-toolchain-5.0-5.0/lldb/unittests/Host/SocketTest.cpp --- llvm-toolchain-5.0-5.0~+rc3/lldb/unittests/Host/SocketTest.cpp 2017-08-26 15:41:12.000000000 +0000 +++ llvm-toolchain-5.0-5.0/lldb/unittests/Host/SocketTest.cpp 2017-09-06 11:04:39.000000000 +0000 @@ -220,3 +220,14 @@ EXPECT_TRUE(error.Success()); EXPECT_TRUE(socket_up->IsValid()); } + +TEST_F(SocketTest, TCPListen0GetPort) { + Socket *server_socket; + Predicate port_predicate; + port_predicate.SetValue(0, eBroadcastNever); + Status err = + Socket::TcpListen("10.10.12.3:0", false, server_socket, &port_predicate); + std::unique_ptr socket_up((TCPSocket*)server_socket); + EXPECT_TRUE(socket_up->IsValid()); + EXPECT_NE(socket_up->GetLocalPortNumber(), 0); +}