From owner-svn-src-vendor@freebsd.org Fri Sep 1 16:29:10 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F479E187C8; Fri, 1 Sep 2017 16:29:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88A187D066; Fri, 1 Sep 2017 16:29:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v81GT8Aq095477; Fri, 1 Sep 2017 16:29:08 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v81GT6pB095452; Fri, 1 Sep 2017 16:29:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201709011629.v81GT6pB095452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 1 Sep 2017 16:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r323090 - in vendor/clang/dist: docs include/clang/AST include/clang/Driver include/clang/Frontend lib/CodeGen lib/Driver/ToolChains lib/Format lib/Frontend test/CodeGenCXX test/Driver ... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/clang/dist: docs include/clang/AST include/clang/Driver include/clang/Frontend lib/CodeGen lib/Driver/ToolChains lib/Format lib/Frontend test/CodeGenCXX test/Driver test/Frontend unittests/F... X-SVN-Commit-Revision: 323090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Sep 2017 16:29:10 -0000 Author: dim Date: Fri Sep 1 16:29:06 2017 New Revision: 323090 URL: https://svnweb.freebsd.org/changeset/base/323090 Log: Vendor import of clang release_50 branch r312293: https://llvm.org/svn/llvm-project/cfe/branches/release_50@312293 Added: vendor/clang/dist/test/CodeGenCXX/clang-abi-compat.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCXX/debug-info-inlined.cpp (contents, props changed) vendor/clang/dist/test/Frontend/clang-abi-compat.cpp (contents, props changed) Modified: vendor/clang/dist/docs/ClangCommandLineReference.rst vendor/clang/dist/docs/ReleaseNotes.rst vendor/clang/dist/include/clang/AST/DeclCXX.h vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def vendor/clang/dist/include/clang/Frontend/CodeGenOptions.h vendor/clang/dist/lib/CodeGen/ABIInfo.h vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp vendor/clang/dist/lib/CodeGen/CodeGenTypes.cpp vendor/clang/dist/lib/CodeGen/CodeGenTypes.h vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp vendor/clang/dist/lib/CodeGen/TargetInfo.cpp vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist/lib/Format/WhitespaceManager.cpp vendor/clang/dist/lib/Format/WhitespaceManager.h vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/test/CodeGenCXX/catch-undef-behavior.cpp vendor/clang/dist/test/CodeGenCXX/uncopyable-args.cpp vendor/clang/dist/test/Driver/flags.c vendor/clang/dist/unittests/Format/FormatTest.cpp Modified: vendor/clang/dist/docs/ClangCommandLineReference.rst ============================================================================== --- vendor/clang/dist/docs/ClangCommandLineReference.rst Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/docs/ClangCommandLineReference.rst Fri Sep 1 16:29:06 2017 (r323090) @@ -656,6 +656,10 @@ Pass to the assembler 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 Modified: vendor/clang/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.rst Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/docs/ReleaseNotes.rst Fri Sep 1 16:29:06 2017 (r323090) @@ -1,6 +1,6 @@ -======================================= -Clang 5.0.0 (In-Progress) Release Notes -======================================= +========================= +Clang 5.0.0 Release Notes +========================= .. contents:: :local: @@ -8,12 +8,6 @@ Clang 5.0.0 (In-Progress) Release Notes Written by the `LLVM Team `_ -.. warning:: - - These are in-progress notes for the upcoming Clang 5 release. - Release notes for previous releases can be found on - `the Download Page `_. - Introduction ============ @@ -26,16 +20,10 @@ documentation 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 `_. +For more information about Clang or LLVM, including information about 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 Clang 5.0.0? ========================== @@ -47,8 +35,6 @@ sections with improvements to Clang's support for thos Major New Features ------------------ -- ... - C++ coroutines ^^^^^^^^^^^^^^ `C++ coroutines TS @@ -61,25 +47,25 @@ coroutine support. Here is `an example 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. @@ -89,7 +75,8 @@ Improvements to Clang's diagnostics 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 ------------------------- @@ -97,9 +84,9 @@ Deprecated Compiler Flags 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 ----------------------- @@ -117,15 +104,9 @@ Attribute Changes in Clang - 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. -Windows Support ---------------- - -Clang's support for building native Windows programs ... - - C Language Changes in Clang --------------------------- @@ -154,38 +135,43 @@ a vector expression--occurs when: 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. + 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. -- Floating point constants with precise integral representations are not - implicitly converted to integer values, this is for compatability with GCC. - - Currently the basic integer and floating point types with the following operators are supported: ``+``, ``/``, ``-``, ``*``, ``%``, ``>``, ``<``, ``>=``, ``<=``, ``==``, ``!=``, ``&``, ``|``, ``^`` and the corresponding assignment operators where applicable. -... -C11 Feature Support -^^^^^^^^^^^^^^^^^^^ - -... - 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 -C++1z Feature Support -^^^^^^^^^^^^^^^^^^^^^ - -... - Objective-C Language Changes in Clang ------------------------------------- @@ -240,26 +226,7 @@ The following new functionalities have been added: - Added OpenCL types to ``CIndex``. -OpenMP Support in Clang ----------------------------------- -... - -Internal API Changes --------------------- - -These are major API changes that have happened since the 4.0.0 release of -Clang. If upgrading an external codebase that uses Clang as a library, -this section should help get you past the largest hurdles of upgrading. - -- ... - -AST Matchers ------------- - -... - - clang-format ------------ @@ -301,7 +268,7 @@ clang-format | namespace A { | namespace A { | | int i; | int i; | | int j; | int j; | - | } | } | + | } | } // namespace A | +---------------------+---------------------+ * Comment reflow support added. Overly long comment lines will now be reflown with the rest of @@ -351,7 +318,7 @@ Undefined Behavior Sanitizer (UBSan) - 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 @@ -359,10 +326,10 @@ Undefined Behavior Sanitizer (UBSan) - 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. @@ -371,20 +338,11 @@ Undefined Behavior Sanitizer (UBSan) also avoid emitting unnecessary overflow checks in arithmetic expressions with promoted integer operands. -Core Analysis Improvements -========================== -- ... - -New Issues Found -================ - -- ... - Python Binding Changes ---------------------- -Python bindings now support both Python 2 and Python 3. +Python bindings now support both Python 2 and Python 3. The following methods have been added: @@ -398,10 +356,6 @@ The following methods have been added: - ``get_exception_specification_kind`` has been added to ``Type``. -- ... - -Significant Known Problems -========================== Additional Information ====================== Modified: vendor/clang/dist/include/clang/AST/DeclCXX.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclCXX.h Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/include/clang/AST/DeclCXX.h Fri Sep 1 16:29:06 2017 (r323090) @@ -2028,7 +2028,10 @@ class CXXMethodDecl : public FunctionDecl { (public) /// \brief Returns the type of the \c this pointer. /// - /// Should only be called for instance (i.e., non-static) methods. + /// Should only be called for instance (i.e., non-static) methods. Note + /// that for the call operator of a lambda closure type, this returns the + /// desugared 'this' type (a pointer to the closure type), not the captured + /// 'this' type. QualType getThisType(ASTContext &C) const; unsigned getTypeQualifiers() const { Modified: vendor/clang/dist/include/clang/Driver/Options.td ============================================================================== --- vendor/clang/dist/include/clang/Driver/Options.td Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/include/clang/Driver/Options.td Fri Sep 1 16:29:06 2017 (r323090) @@ -694,6 +694,9 @@ def fbuiltin : Flag<["-"], "fbuiltin">, Group 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">; Modified: vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def ============================================================================== --- vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def Fri Sep 1 16:29:06 2017 (r323090) @@ -120,6 +120,10 @@ CODEGENOPT(NoZeroInitializedInBSS , 1, 0) ///< -fno-ze 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. Modified: vendor/clang/dist/include/clang/Frontend/CodeGenOptions.h ============================================================================== --- vendor/clang/dist/include/clang/Frontend/CodeGenOptions.h Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/include/clang/Frontend/CodeGenOptions.h Fri Sep 1 16:29:06 2017 (r323090) @@ -69,6 +69,23 @@ class CodeGenOptions : public CodeGenOptionsBase { (pu 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). Modified: vendor/clang/dist/lib/CodeGen/ABIInfo.h ============================================================================== --- vendor/clang/dist/lib/CodeGen/ABIInfo.h Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/lib/CodeGen/ABIInfo.h Fri Sep 1 16:29:06 2017 (r323090) @@ -24,6 +24,7 @@ namespace llvm { namespace clang { class ASTContext; + class CodeGenOptions; class TargetInfo; namespace CodeGen { @@ -68,6 +69,7 @@ namespace swiftcall { 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. Modified: vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -3260,7 +3260,7 @@ void CGDebugInfo::EmitInlineFunctionStart(CGBuilderTy llvm::DISubprogram *SP = nullptr; if (FI != SPCache.end()) SP = dyn_cast_or_null(FI->second); - if (!SP) + if (!SP || !SP->isDefinition()) SP = getFunctionStub(GD); FnBeginRegionCount.push_back(LexicalBlockStack.size()); LexicalBlockStack.emplace_back(SP); Modified: vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -22,6 +22,7 @@ #include "CodeGenPGO.h" #include "TargetInfo.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/ASTLambda.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/StmtCXX.h" @@ -983,11 +984,22 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, } // Check the 'this' pointer once per function, if it's available. - if (CXXThisValue) { + if (CXXABIThisValue) { SanitizerSet SkippedChecks; SkippedChecks.set(SanitizerKind::ObjectSize, true); QualType ThisTy = MD->getThisType(getContext()); - EmitTypeCheck(TCK_Load, Loc, CXXThisValue, ThisTy, + + // If this is the call operator of a lambda with no capture-default, it + // may have a static invoker function, which may call this operator with + // a null 'this' pointer. + if (isLambdaCallOperator(MD) && + cast(MD->getParent())->getLambdaCaptureDefault() == + LCD_None) + SkippedChecks.set(SanitizerKind::Null, true); + + EmitTypeCheck(isa(MD) ? TCK_ConstructorCall + : TCK_MemberCall, + Loc, CXXABIThisValue, ThisTy, getContext().getTypeAlignInChars(ThisTy->getPointeeType()), SkippedChecks); } Modified: vendor/clang/dist/lib/CodeGen/CodeGenTypes.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CodeGenTypes.cpp Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/lib/CodeGen/CodeGenTypes.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -44,6 +44,10 @@ CodeGenTypes::~CodeGenTypes() { delete &*I++; } +const CodeGenOptions &CodeGenTypes::getCodeGenOpts() const { + return CGM.getCodeGenOpts(); +} + void CodeGenTypes::addRecordTypeName(const RecordDecl *RD, llvm::StructType *Ty, StringRef suffix) { Modified: vendor/clang/dist/lib/CodeGen/CodeGenTypes.h ============================================================================== --- vendor/clang/dist/lib/CodeGen/CodeGenTypes.h Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/lib/CodeGen/CodeGenTypes.h Fri Sep 1 16:29:06 2017 (r323090) @@ -178,6 +178,7 @@ class CodeGenTypes { (public) 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); Modified: vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -62,9 +62,20 @@ class ItaniumCXXABI : public CodeGen::CGCXXABI { (publ 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 @@ bool ItaniumCXXABI::classifyReturnType(CGFunctionInfo 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; Modified: vendor/clang/dist/lib/CodeGen/TargetInfo.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/TargetInfo.cpp Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/lib/CodeGen/TargetInfo.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -183,8 +183,12 @@ const TargetInfo &ABIInfo::getTarget() const { 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 @@ class X86_64ABIInfo : public SwiftABIInfo { 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; Modified: vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -2855,6 +2855,9 @@ void Clang::ConstructJob(Compilation &C, const JobActi 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); Modified: vendor/clang/dist/lib/Format/WhitespaceManager.cpp ============================================================================== --- vendor/clang/dist/lib/Format/WhitespaceManager.cpp Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/lib/Format/WhitespaceManager.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -246,12 +246,12 @@ AlignTokenSequence(unsigned Start, unsigned End, unsig for (unsigned i = Start; i != End; ++i) { if (ScopeStack.size() != 0 && - Changes[i].nestingAndIndentLevel() < - Changes[ScopeStack.back()].nestingAndIndentLevel()) + Changes[i].indentAndNestingLevel() < + Changes[ScopeStack.back()].indentAndNestingLevel()) ScopeStack.pop_back(); - if (i != Start && Changes[i].nestingAndIndentLevel() > - Changes[i - 1].nestingAndIndentLevel()) + if (i != Start && Changes[i].indentAndNestingLevel() > + Changes[i - 1].indentAndNestingLevel()) ScopeStack.push_back(i); bool InsideNestedScope = ScopeStack.size() != 0; @@ -327,8 +327,8 @@ static unsigned AlignTokens(const FormatStyle &Style, // Measure the scope level (i.e. depth of (), [], {}) of the first token, and // abort when we hit any token in a higher scope than the starting one. - auto NestingAndIndentLevel = StartAt < Changes.size() - ? Changes[StartAt].nestingAndIndentLevel() + auto IndentAndNestingLevel = StartAt < Changes.size() + ? Changes[StartAt].indentAndNestingLevel() : std::pair(0, 0); // Keep track of the number of commas before the matching tokens, we will only @@ -359,7 +359,7 @@ static unsigned AlignTokens(const FormatStyle &Style, unsigned i = StartAt; for (unsigned e = Changes.size(); i != e; ++i) { - if (Changes[i].nestingAndIndentLevel() < NestingAndIndentLevel) + if (Changes[i].indentAndNestingLevel() < IndentAndNestingLevel) break; if (Changes[i].NewlinesBefore != 0) { @@ -375,7 +375,7 @@ static unsigned AlignTokens(const FormatStyle &Style, if (Changes[i].Tok->is(tok::comma)) { ++CommasBeforeMatch; - } else if (Changes[i].nestingAndIndentLevel() > NestingAndIndentLevel) { + } else if (Changes[i].indentAndNestingLevel() > IndentAndNestingLevel) { // Call AlignTokens recursively, skipping over this scope block. unsigned StoppedAt = AlignTokens(Style, Matches, Changes, i); i = StoppedAt - 1; Modified: vendor/clang/dist/lib/Format/WhitespaceManager.h ============================================================================== --- vendor/clang/dist/lib/Format/WhitespaceManager.h Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/lib/Format/WhitespaceManager.h Fri Sep 1 16:29:06 2017 (r323090) @@ -154,12 +154,11 @@ class WhitespaceManager { (public) const Change *StartOfBlockComment; int IndentationOffset; - // A combination of nesting level and indent level, which are used in + // A combination of indent level and nesting level, which are used in // tandem to compute lexical scope, for the purposes of deciding // when to stop consecutive alignment runs. - std::pair - nestingAndIndentLevel() const { - return std::make_pair(Tok->NestingLevel, Tok->IndentLevel); + std::pair indentAndNestingLevel() const { + return std::make_pair(Tok->IndentLevel, Tok->NestingLevel); } }; Modified: vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp ============================================================================== --- vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -573,6 +573,33 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, Arg 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); Modified: vendor/clang/dist/test/CodeGenCXX/catch-undef-behavior.cpp ============================================================================== --- vendor/clang/dist/test/CodeGenCXX/catch-undef-behavior.cpp Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/test/CodeGenCXX/catch-undef-behavior.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -449,6 +449,28 @@ void upcast_to_vbase() { } } +struct ThisAlign { + void this_align_lambda(); + void this_align_lambda_2(); +}; +void ThisAlign::this_align_lambda() { + // CHECK-LABEL: define {{.*}}@"_ZZN9ThisAlign17this_align_lambdaEvENK3$_0clEv" + // CHECK-SAME: (%{{.*}}* %[[this:[^)]*]]) + // CHECK: %[[this_addr:.*]] = alloca + // CHECK: store %{{.*}}* %[[this]], %{{.*}}** %[[this_addr]], + // CHECK: %[[this_inner:.*]] = load %{{.*}}*, %{{.*}}** %[[this_addr]], + // CHECK: %[[this_outer_addr:.*]] = getelementptr inbounds %{{.*}}, %{{.*}}* %[[this_inner]], i32 0, i32 0 + // CHECK: %[[this_outer:.*]] = load %{{.*}}*, %{{.*}}** %[[this_outer_addr]], + // + // CHECK: %[[this_inner_isnonnull:.*]] = icmp ne %{{.*}}* %[[this_inner]], null + // CHECK: %[[this_inner_asint:.*]] = ptrtoint %{{.*}}* %[[this_inner]] to i + // CHECK: %[[this_inner_misalignment:.*]] = and i{{32|64}} %[[this_inner_asint]], {{3|7}}, + // CHECK: %[[this_inner_isaligned:.*]] = icmp eq i{{32|64}} %[[this_inner_misalignment]], 0 + // CHECK: %[[this_inner_valid:.*]] = and i1 %[[this_inner_isnonnull]], %[[this_inner_isaligned]], + // CHECK: br i1 %[[this_inner_valid:.*]] + [&] { return this; } (); +} + namespace CopyValueRepresentation { // CHECK-LABEL: define {{.*}} @_ZN23CopyValueRepresentation2S3aSERKS0_ // CHECK-NOT: call {{.*}} @__ubsan_handle_load_invalid_value @@ -530,6 +552,20 @@ namespace CopyValueRepresentation { S5 s52; s52 = s51; } +} + +void ThisAlign::this_align_lambda_2() { + // CHECK-LABEL: define {{.*}}@"_ZZN9ThisAlign19this_align_lambda_2EvENK3$_1clEv" + // CHECK-SAME: (%{{.*}}* %[[this:[^)]*]]) + // CHECK: %[[this_addr:.*]] = alloca + // CHECK: store %{{.*}}* %[[this]], %{{.*}}** %[[this_addr]], + // CHECK: %[[this_inner:.*]] = load %{{.*}}*, %{{.*}}** %[[this_addr]], + // + // Do not perform a null check on the 'this' pointer if the function might be + // called from a static invoker. + // CHECK-NOT: icmp ne %{{.*}}* %[[this_inner]], null + auto *p = +[] {}; + p(); } // CHECK: attributes [[NR_NUW]] = { noreturn nounwind } Added: vendor/clang/dist/test/CodeGenCXX/clang-abi-compat.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist/test/CodeGenCXX/clang-abi-compat.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -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(%{{.*}}* Added: vendor/clang/dist/test/CodeGenCXX/debug-info-inlined.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist/test/CodeGenCXX/debug-info-inlined.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -emit-llvm -triple i686-pc-windows-msvc19.0.24213 -gcodeview -debug-info-kind=limited -std=c++14 %s -o - | FileCheck %s +// PR33997. +struct already_AddRefed { + ~already_AddRefed(); +}; +struct RefPtr { + operator int *(); +}; +struct ServoCssRulesStrong { + already_AddRefed Consume(); +}; +struct GroupRule { + GroupRule(already_AddRefed); +}; +class ConditionRule : GroupRule { + using GroupRule::GroupRule; +}; +class CSSMediaRule : ConditionRule { + using ConditionRule::ConditionRule; +}; +class CSSMozDocumentRule : ConditionRule { + using ConditionRule::ConditionRule; +}; +class ServoDocumentRule : CSSMozDocumentRule { + ServoDocumentRule(RefPtr); +}; +class ServoMediaRule : CSSMediaRule { + ServoMediaRule(RefPtr); +}; +ServoCssRulesStrong Servo_MediaRule_GetRules(int *); +ServoCssRulesStrong Servo_DocumentRule_GetRules(int *); +ServoDocumentRule::ServoDocumentRule(RefPtr aRawRule) + : CSSMozDocumentRule(Servo_DocumentRule_GetRules(aRawRule).Consume()) {} + +ServoMediaRule::ServoMediaRule(RefPtr aRawRule) + : CSSMediaRule(Servo_MediaRule_GetRules(aRawRule).Consume()) {} + +// CHECK: define{{.*}}ServoMediaRule +// CHECK-NOT: {{ ret }} +// CHECK: store %class.ConditionRule* % +// CHECK-SAME: %class.ConditionRule** % +// CHECK-SAME: !dbg ![[INL:[0-9]+]] + +// CHECK: ![[INL]] = !DILocation(line: 16, scope: ![[SP:[0-9]+]], inlinedAt: +// CHECK: ![[SP]] = distinct !DISubprogram(name: "GroupRule", {{.*}}isDefinition: true Modified: vendor/clang/dist/test/CodeGenCXX/uncopyable-args.cpp ============================================================================== --- vendor/clang/dist/test/CodeGenCXX/uncopyable-args.cpp Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/test/CodeGenCXX/uncopyable-args.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -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 @@ void bar() { // 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 @@ void bar() { // 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 @@ void bar() { // 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 @@ void bar() { // 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 @@ void bar() { } // 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 @@ struct A { 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 @@ struct A { 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 @@ struct A : B { 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 @@ struct A { 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 @@ struct A : B { 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 @@ struct A { 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 @@ struct A { // 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; } Modified: vendor/clang/dist/test/Driver/flags.c ============================================================================== --- vendor/clang/dist/test/Driver/flags.c Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/test/Driver/flags.c Fri Sep 1 16:29:06 2017 (r323090) @@ -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" Added: vendor/clang/dist/test/Frontend/clang-abi-compat.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist/test/Frontend/clang-abi-compat.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -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 Modified: vendor/clang/dist/unittests/Format/FormatTest.cpp ============================================================================== --- vendor/clang/dist/unittests/Format/FormatTest.cpp Fri Sep 1 16:29:00 2017 (r323089) +++ vendor/clang/dist/unittests/Format/FormatTest.cpp Fri Sep 1 16:29:06 2017 (r323090) @@ -8860,6 +8860,16 @@ TEST_F(FormatTest, AlignConsecutiveDeclarations) { Alignment); Alignment.BinPackParameters = true; Alignment.ColumnLimit = 80; + + // Bug 33507 + Alignment.PointerAlignment = FormatStyle::PAS_Middle; + verifyFormat( + "auto found = range::find_if(vsProducts, [&](auto * aProduct) {\n" + " static const Version verVs2017;\n" + " return true;\n" + "});\n", + Alignment); + Alignment.PointerAlignment = FormatStyle::PAS_Right; } TEST_F(FormatTest, LinuxBraceBreaking) {