Date: Tue, 5 Feb 2019 18:39:15 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r343796 - in vendor/clang/dist-release_80: docs include/clang/Basic include/clang/Driver include/clang/Tooling lib/Basic lib/Basic/Targets lib/Driver/ToolChains lib/Headers lib/Lex lib/... Message-ID: <201902051839.x15IdFml063340@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Tue Feb 5 18:39:15 2019 New Revision: 343796 URL: https://svnweb.freebsd.org/changeset/base/343796 Log: Vendor import of clang release_80 branch r353167: https://llvm.org/svn/llvm-project/cfe/branches/release_80@353167 Added: vendor/clang/dist-release_80/test/CodeCompletion/crash-null-type.cpp vendor/clang/dist-release_80/test/PCH/leakfiles vendor/clang/dist-release_80/test/Sema/Float16.c vendor/clang/dist-release_80/test/SemaCXX/Float16.cpp vendor/clang/dist-release_80/test/SemaCXX/PR40395.cpp Modified: vendor/clang/dist-release_80/docs/LanguageExtensions.rst vendor/clang/dist-release_80/docs/OpenMPSupport.rst vendor/clang/dist-release_80/docs/ReleaseNotes.rst vendor/clang/dist-release_80/include/clang/Basic/BuiltinsAArch64.def vendor/clang/dist-release_80/include/clang/Basic/Features.def vendor/clang/dist-release_80/include/clang/Basic/FileManager.h vendor/clang/dist-release_80/include/clang/Basic/TargetInfo.h vendor/clang/dist-release_80/include/clang/Driver/Options.td vendor/clang/dist-release_80/include/clang/Tooling/ArgumentsAdjusters.h vendor/clang/dist-release_80/lib/Basic/FileManager.cpp vendor/clang/dist-release_80/lib/Basic/TargetInfo.cpp vendor/clang/dist-release_80/lib/Basic/Targets.cpp vendor/clang/dist-release_80/lib/Basic/Targets/AArch64.cpp vendor/clang/dist-release_80/lib/Basic/Targets/ARM.cpp vendor/clang/dist-release_80/lib/Basic/Targets/OSTargets.h vendor/clang/dist-release_80/lib/Basic/Targets/SPIR.h vendor/clang/dist-release_80/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist-release_80/lib/Driver/ToolChains/NetBSD.cpp vendor/clang/dist-release_80/lib/Headers/opencl-c.h vendor/clang/dist-release_80/lib/Lex/LiteralSupport.cpp vendor/clang/dist-release_80/lib/Sema/SemaCodeComplete.cpp vendor/clang/dist-release_80/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist-release_80/lib/Sema/SemaExpr.cpp vendor/clang/dist-release_80/lib/Sema/SemaTemplate.cpp vendor/clang/dist-release_80/lib/Sema/SemaType.cpp vendor/clang/dist-release_80/lib/Tooling/ArgumentsAdjusters.cpp vendor/clang/dist-release_80/test/AST/float16.cpp vendor/clang/dist-release_80/test/CXX/dcl.dcl/dcl.attr/dcl.align/p8.cpp vendor/clang/dist-release_80/test/CodeGen/arm64-crc32.c vendor/clang/dist-release_80/test/CodeGen/builtins-arm64.c vendor/clang/dist-release_80/test/CodeGenCXX/float16-declarations.cpp vendor/clang/dist-release_80/test/CodeGenCXX/mangle-ms.cpp vendor/clang/dist-release_80/test/CodeGenCXX/trivial_abi.cpp vendor/clang/dist-release_80/test/CodeGenOpenCL/printf.cl vendor/clang/dist-release_80/test/Driver/mips-features.c vendor/clang/dist-release_80/test/Lexer/half-literal.cpp vendor/clang/dist-release_80/test/Preprocessor/init.c vendor/clang/dist-release_80/test/SemaCXX/cxx1z-decomposition.cpp vendor/clang/dist-release_80/test/SemaObjC/enum-fixed-type.m vendor/clang/dist-release_80/test/SemaOpenCL/printf-format-string-warnings.cl vendor/clang/dist-release_80/test/SemaOpenCL/printf-format-strings.cl vendor/clang/dist-release_80/unittests/Basic/FileManagerTest.cpp vendor/clang/dist-release_80/unittests/Tooling/ToolingTest.cpp Modified: vendor/clang/dist-release_80/docs/LanguageExtensions.rst ============================================================================== --- vendor/clang/dist-release_80/docs/LanguageExtensions.rst Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/docs/LanguageExtensions.rst Tue Feb 5 18:39:15 2019 (r343796) @@ -474,44 +474,58 @@ Half-Precision Floating Point ============================= Clang supports two half-precision (16-bit) floating point types: ``__fp16`` and -``_Float16``. ``__fp16`` is defined in the ARM C Language Extensions (`ACLE -<http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053d/IHI0053D_acle_2_1.pdf>`_) -and ``_Float16`` in ISO/IEC TS 18661-3:2015. +``_Float16``. These types are supported in all language modes. -``__fp16`` is a storage and interchange format only. This means that values of -``__fp16`` promote to (at least) float when used in arithmetic operations. -There are two ``__fp16`` formats. Clang supports the IEEE 754-2008 format and -not the ARM alternative format. +``__fp16`` is supported on every target, as it is purely a storage format; see below. +``_Float16`` is currently only supported on the following targets, with further +targets pending ABI standardization: +- 32-bit ARM +- 64-bit ARM (AArch64) +- SPIR +``_Float16`` will be supported on more targets as they define ABIs for it. -ISO/IEC TS 18661-3:2015 defines C support for additional floating point types. -``_FloatN`` is defined as a binary floating type, where the N suffix denotes -the number of bits and is 16, 32, 64, or greater and equal to 128 and a -multiple of 32. Clang supports ``_Float16``. The difference from ``__fp16`` is -that arithmetic on ``_Float16`` is performed in half-precision, thus it is not -a storage-only format. ``_Float16`` is available as a source language type in -both C and C++ mode. +``__fp16`` is a storage and interchange format only. This means that values of +``__fp16`` are immediately promoted to (at least) ``float`` when used in arithmetic +operations, so that e.g. the result of adding two ``__fp16`` values has type ``float``. +The behavior of ``__fp16`` is specified by the ARM C Language Extensions (`ACLE <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053d/IHI0053D_acle_2_1.pdf>`_). +Clang uses the ``binary16`` format from IEEE 754-2008 for ``__fp16``, not the ARM +alternative format. -It is recommended that portable code use the ``_Float16`` type because -``__fp16`` is an ARM C-Language Extension (ACLE), whereas ``_Float16`` is -defined by the C standards committee, so using ``_Float16`` will not prevent -code from being ported to architectures other than Arm. Also, ``_Float16`` -arithmetic and operations will directly map on half-precision instructions when -they are available (e.g. Armv8.2-A), avoiding conversions to/from -single-precision, and thus will result in more performant code. If -half-precision instructions are unavailable, values will be promoted to -single-precision, similar to the semantics of ``__fp16`` except that the -results will be stored in single-precision. +``_Float16`` is an extended floating-point type. This means that, just like arithmetic on +``float`` or ``double``, arithmetic on ``_Float16`` operands is formally performed in the +``_Float16`` type, so that e.g. the result of adding two ``_Float16`` values has type +``_Float16``. The behavior of ``_Float16`` is specified by ISO/IEC TS 18661-3:2015 +("Floating-point extensions for C"). As with ``__fp16``, Clang uses the ``binary16`` +format from IEEE 754-2008 for ``_Float16``. -In an arithmetic operation where one operand is of ``__fp16`` type and the -other is of ``_Float16`` type, the ``_Float16`` type is first converted to -``__fp16`` type and then the operation is completed as if both operands were of -``__fp16`` type. +``_Float16`` arithmetic will be performed using native half-precision support +when available on the target (e.g. on ARMv8.2a); otherwise it will be performed +at a higher precision (currently always ``float``) and then truncated down to +``_Float16``. Note that C and C++ allow intermediate floating-point operands +of an expression to be computed with greater precision than is expressible in +their type, so Clang may avoid intermediate truncations in certain cases; this may +lead to results that are inconsistent with native arithmetic. -To define a ``_Float16`` literal, suffix ``f16`` can be appended to the compile-time -constant declaration. There is no default argument promotion for ``_Float16``; this -applies to the standard floating types only. As a consequence, for example, an -explicit cast is required for printing a ``_Float16`` value (there is no string -format specifier for ``_Float16``). +It is recommended that portable code use ``_Float16`` instead of ``__fp16``, +as it has been defined by the C standards committee and has behavior that is +more familiar to most programmers. + +Because ``__fp16`` operands are always immediately promoted to ``float``, the +common real type of ``__fp16`` and ``_Float16`` for the purposes of the usual +arithmetic conversions is ``float``. + +A literal can be given ``_Float16`` type using the suffix ``f16``; for example: +``` +3.14f16 +``` + +Because default argument promotion only applies to the standard floating-point +types, ``_Float16`` values are not promoted to ``double`` when passed as variadic +or untyped arguments. As a consequence, some caution must be taken when using +certain library facilities with ``_Float16``; for example, there is no ``printf`` format +specifier for ``_Float16``, and (unlike ``float``) it will not be implicitly promoted to +``double`` when passed to ``printf``, so the programmer must explicitly cast it to +``double`` before using it with an ``%f`` or similar specifier. Messages on ``deprecated`` and ``unavailable`` Attributes ========================================================= Modified: vendor/clang/dist-release_80/docs/OpenMPSupport.rst ============================================================================== --- vendor/clang/dist-release_80/docs/OpenMPSupport.rst Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/docs/OpenMPSupport.rst Tue Feb 5 18:39:15 2019 (r343796) @@ -17,60 +17,50 @@ OpenMP Support ================== -Clang fully supports OpenMP 4.5. Clang supports offloading to X86_64, AArch64, -PPC64[LE] and has `basic support for Cuda devices`_. +Clang supports the following OpenMP 5.0 features -Standalone directives -===================== +* The `reduction`-based clauses in the `task` and `target`-based directives. -* #pragma omp [for] simd: :good:`Complete`. +* Support relational-op != (not-equal) as one of the canonical forms of random + access iterator. -* #pragma omp declare simd: :partial:`Partial`. We support parsing/semantic - analysis + generation of special attributes for X86 target, but still - missing the LLVM pass for vectorization. +* Support for mapping of the lambdas in target regions. -* #pragma omp taskloop [simd]: :good:`Complete`. +* Parsing/sema analysis for the requires directive. -* #pragma omp target [enter|exit] data: :good:`Complete`. +* Nested declare target directives. -* #pragma omp target update: :good:`Complete`. +* Make the `this` pointer implicitly mapped as `map(this[:1])`. -* #pragma omp target: :good:`Complete`. +* The `close` *map-type-modifier*. -* #pragma omp declare target: :good:`Complete`. +Clang fully supports OpenMP 4.5. Clang supports offloading to X86_64, AArch64, +PPC64[LE] and has `basic support for Cuda devices`_. -* #pragma omp teams: :good:`Complete`. +* #pragma omp declare simd: :partial:`Partial`. We support parsing/semantic + analysis + generation of special attributes for X86 target, but still + missing the LLVM pass for vectorization. -* #pragma omp distribute [simd]: :good:`Complete`. +In addition, the LLVM OpenMP runtime `libomp` supports the OpenMP Tools +Interface (OMPT) on x86, x86_64, AArch64, and PPC64 on Linux, Windows, and macOS. -* #pragma omp distribute parallel for [simd]: :good:`Complete`. +General improvements +-------------------- +- New collapse clause scheme to avoid expensive remainder operations. + Compute loop index variables after collapsing a loop nest via the + collapse clause by replacing the expensive remainder operation with + multiplications and additions. -Combined directives -=================== - -* #pragma omp parallel for simd: :good:`Complete`. - -* #pragma omp target parallel: :good:`Complete`. - -* #pragma omp target parallel for [simd]: :good:`Complete`. - -* #pragma omp target simd: :good:`Complete`. - -* #pragma omp target teams: :good:`Complete`. - -* #pragma omp teams distribute [simd]: :good:`Complete`. - -* #pragma omp target teams distribute [simd]: :good:`Complete`. - -* #pragma omp teams distribute parallel for [simd]: :good:`Complete`. - -* #pragma omp target teams distribute parallel for [simd]: :good:`Complete`. - -Clang does not support any constructs/updates from OpenMP 5.0 except -for `reduction`-based clauses in the `task` and `target`-based directives. - -In addition, the LLVM OpenMP runtime `libomp` supports the OpenMP Tools -Interface (OMPT) on x86, x86_64, AArch64, and PPC64 on Linux, Windows, and mac OS. +- The default schedules for the `distribute` and `for` constructs in a + parallel region and in SPMD mode have changed to ensure coalesced + accesses. For the `distribute` construct, a static schedule is used + with a chunk size equal to the number of threads per team (default + value of threads or as specified by the `thread_limit` clause if + present). For the `for` construct, the schedule is static with chunk + size of one. + +- Simplified SPMD code generation for `distribute parallel for` when + the new default schedules are applicable. .. _basic support for Cuda devices: Modified: vendor/clang/dist-release_80/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist-release_80/docs/ReleaseNotes.rst Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/docs/ReleaseNotes.rst Tue Feb 5 18:39:15 2019 (r343796) @@ -127,6 +127,10 @@ Non-comprehensive list of changes in this release manually and rely on the old behaviour you will need to add appropriate compiler flags for finding the corresponding libc++ include directory. +- The integrated assembler is used now by default for all MIPS targets. + +- Improved support for MIPS N32 ABI and MIPS R6 target triples. + New Compiler Flags ------------------ @@ -136,6 +140,13 @@ New Compiler Flags instrumenting for gcov-based profiling. See the :doc:`UsersManual` for details. +- When using a custom stack alignment, the ``stackrealign`` attribute is now + implicitly set on the main function. + +- Emission of ``R_MIPS_JALR`` and ``R_MICROMIPS_JALR`` relocations can now + be controlled by the ``-mrelax-pic-calls`` and ``-mno-relax-pic-calls`` + options. + - ... Deprecated Compiler Flags @@ -179,6 +190,15 @@ Windows Support `dllexport` and `dllimport` attributes not apply to inline member functions. This can significantly reduce compile and link times. See the `User's Manual <UsersManual.html#the-zc-dllexportinlines-option>`_ for more info. + +- For MinGW, ``-municode`` now correctly defines ``UNICODE`` during + preprocessing. + +- For MinGW, clang now produces vtables and RTTI for dllexported classes + without key functions. This fixes building Qt in debug mode. + +- Allow using Address Sanitizer and Undefined Behaviour Sanitizer on MinGW. + - ... @@ -233,13 +253,16 @@ ABI Changes in Clang OpenMP Support in Clang ---------------------------------- -- Support relational-op != (not-equal) as one of the canonical forms of random - access iterator. +- OpenMP 5.0 features -- Added support for mapping of the lambdas in target regions. + - Support relational-op != (not-equal) as one of the canonical forms of random + access iterator. + - Added support for mapping of the lambdas in target regions. + - Added parsing/sema analysis for the requires directive. + - Support nested declare target directives. + - Make the `this` pointer implicitly mapped as `map(this[:1])`. + - Added the `close` *map-type-modifier*. -- Added parsing/sema analysis for OpenMP 5.0 requires directive. - - Various bugfixes and improvements. New features supported for Cuda devices: @@ -249,6 +272,15 @@ New features supported for Cuda devices: - Extended number of constructs that can be executed in SPMD mode. - Fixed support for lastprivate/reduction variables in SPMD constructs. + +- New collapse clause scheme to avoid expensive remainder operations. + +- New default schedule for distribute and parallel constructs. + +- Simplified code generation for distribute and parallel in SPMD mode. + +- Flag (``-fopenmp_optimistic_collapse``) for user to limit collapsed + loop counter width when safe to do so. - General performance improvement. Modified: vendor/clang/dist-release_80/include/clang/Basic/BuiltinsAArch64.def ============================================================================== --- vendor/clang/dist-release_80/include/clang/Basic/BuiltinsAArch64.def Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/include/clang/Basic/BuiltinsAArch64.def Tue Feb 5 18:39:15 2019 (r343796) @@ -33,7 +33,7 @@ BUILTIN(__builtin_arm_clrex, "v", "") // Bit manipulation BUILTIN(__builtin_arm_rbit, "UiUi", "nc") -BUILTIN(__builtin_arm_rbit64, "LUiLUi", "nc") +BUILTIN(__builtin_arm_rbit64, "WUiWUi", "nc") // HINT BUILTIN(__builtin_arm_nop, "v", "") @@ -50,8 +50,8 @@ BUILTIN(__builtin_arm_crc32h, "UiUiUs", "nc") BUILTIN(__builtin_arm_crc32ch, "UiUiUs", "nc") BUILTIN(__builtin_arm_crc32w, "UiUiUi", "nc") BUILTIN(__builtin_arm_crc32cw, "UiUiUi", "nc") -BUILTIN(__builtin_arm_crc32d, "UiUiLUi", "nc") -BUILTIN(__builtin_arm_crc32cd, "UiUiLUi", "nc") +BUILTIN(__builtin_arm_crc32d, "UiUiWUi", "nc") +BUILTIN(__builtin_arm_crc32cd, "UiUiWUi", "nc") // Memory barrier BUILTIN(__builtin_arm_dmb, "vUi", "nc") @@ -63,10 +63,10 @@ BUILTIN(__builtin_arm_prefetch, "vvC*UiUiUiUi", "nc") // System Registers BUILTIN(__builtin_arm_rsr, "UicC*", "nc") -BUILTIN(__builtin_arm_rsr64, "LUicC*", "nc") +BUILTIN(__builtin_arm_rsr64, "WUicC*", "nc") BUILTIN(__builtin_arm_rsrp, "v*cC*", "nc") BUILTIN(__builtin_arm_wsr, "vcC*Ui", "nc") -BUILTIN(__builtin_arm_wsr64, "vcC*LUi", "nc") +BUILTIN(__builtin_arm_wsr64, "vcC*WUi", "nc") BUILTIN(__builtin_arm_wsrp, "vcC*vC*", "nc") // MSVC Modified: vendor/clang/dist-release_80/include/clang/Basic/Features.def ============================================================================== --- vendor/clang/dist-release_80/include/clang/Basic/Features.def Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/include/clang/Basic/Features.def Tue Feb 5 18:39:15 2019 (r343796) @@ -96,7 +96,7 @@ FEATURE(objc_arc, LangOpts.ObjCAutoRefCount) FEATURE(objc_arc_fields, true) FEATURE(objc_arc_weak, LangOpts.ObjCWeak) FEATURE(objc_default_synthesize_properties, LangOpts.ObjC) -FEATURE(objc_fixed_enum, true) +FEATURE(objc_fixed_enum, LangOpts.ObjC) FEATURE(objc_instancetype, LangOpts.ObjC) FEATURE(objc_kindof, LangOpts.ObjC) FEATURE(objc_modules, LangOpts.ObjC && LangOpts.Modules) Modified: vendor/clang/dist-release_80/include/clang/Basic/FileManager.h ============================================================================== --- vendor/clang/dist-release_80/include/clang/Basic/FileManager.h Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/include/clang/Basic/FileManager.h Tue Feb 5 18:39:15 2019 (r343796) @@ -70,15 +70,14 @@ class FileEntry { bool IsNamedPipe; bool InPCH; bool IsValid; // Is this \c FileEntry initialized and valid? - bool DeferredOpen; // Created by getFile(OpenFile=0); may open later. /// The open file, if it is owned by the \p FileEntry. mutable std::unique_ptr<llvm::vfs::File> File; public: FileEntry() - : UniqueID(0, 0), IsNamedPipe(false), InPCH(false), IsValid(false), - DeferredOpen(false) {} + : UniqueID(0, 0), IsNamedPipe(false), InPCH(false), IsValid(false) + {} FileEntry(const FileEntry &) = delete; FileEntry &operator=(const FileEntry &) = delete; Modified: vendor/clang/dist-release_80/include/clang/Basic/TargetInfo.h ============================================================================== --- vendor/clang/dist-release_80/include/clang/Basic/TargetInfo.h Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/include/clang/Basic/TargetInfo.h Tue Feb 5 18:39:15 2019 (r343796) @@ -64,6 +64,7 @@ class TargetInfo : public RefCountedBase<TargetInfo> { bool HasLegalHalfType; // True if the backend supports operations on the half // LLVM IR type. bool HasFloat128; + bool HasFloat16; unsigned char PointerWidth, PointerAlign; unsigned char BoolWidth, BoolAlign; unsigned char IntWidth, IntAlign; @@ -516,6 +517,9 @@ class TargetInfo : public RefCountedBase<TargetInfo> { /// Determine whether the __float128 type is supported on this target. virtual bool hasFloat128Type() const { return HasFloat128; } + + /// Determine whether the _Float16 type is supported on this target. + virtual bool hasFloat16Type() const { return HasFloat16; } /// Return the alignment that is suitable for storing any /// object with a fundamental alignment requirement. Modified: vendor/clang/dist-release_80/include/clang/Driver/Options.td ============================================================================== --- vendor/clang/dist-release_80/include/clang/Driver/Options.td Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/include/clang/Driver/Options.td Tue Feb 5 18:39:15 2019 (r343796) @@ -2418,6 +2418,14 @@ def modd_spreg : Flag<["-"], "modd-spreg">, Group<m_mi def mno_odd_spreg : Flag<["-"], "mno-odd-spreg">, Group<m_mips_Features_Group>, HelpText<"Disable odd single-precision floating point registers">, Flags<[HelpHidden]>; +def mrelax_pic_calls : Flag<["-"], "mrelax-pic-calls">, + Group<m_mips_Features_Group>, + HelpText<"Try turning PIC calls (j{al}r{c} $25) into direct calls " + "(MIPS only)">, Flags<[HelpHidden]>; +def mno_relax_pic_calls : Flag<["-"], "mno-relax-pic-calls">, + Group<m_mips_Features_Group>, + HelpText<"Do not try turning PIC calls (j{al}r{c} $25) into direct calls " + "(MIPS only)">, Flags<[HelpHidden]>; def mglibc : Flag<["-"], "mglibc">, Group<m_libc_Group>, Flags<[HelpHidden]>; def muclibc : Flag<["-"], "muclibc">, Group<m_libc_Group>, Flags<[HelpHidden]>; def module_file_info : Flag<["-"], "module-file-info">, Flags<[DriverOption,CC1Option]>, Group<Action_Group>, Modified: vendor/clang/dist-release_80/include/clang/Tooling/ArgumentsAdjusters.h ============================================================================== --- vendor/clang/dist-release_80/include/clang/Tooling/ArgumentsAdjusters.h Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/include/clang/Tooling/ArgumentsAdjusters.h Tue Feb 5 18:39:15 2019 (r343796) @@ -61,6 +61,10 @@ ArgumentsAdjuster getInsertArgumentAdjuster( const char *Extra, ArgumentInsertPosition Pos = ArgumentInsertPosition::END); +/// Gets an argument adjuster which strips plugin related command line +/// arguments. +ArgumentsAdjuster getStripPluginsAdjuster(); + /// Gets an argument adjuster which adjusts the arguments in sequence /// with the \p First adjuster and then with the \p Second one. ArgumentsAdjuster combineAdjusters(ArgumentsAdjuster First, Modified: vendor/clang/dist-release_80/lib/Basic/FileManager.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Basic/FileManager.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Basic/FileManager.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -189,21 +189,15 @@ const FileEntry *FileManager::getFile(StringRef Filena *SeenFileEntries.insert(std::make_pair(Filename, nullptr)).first; // See if there is already an entry in the map. - if (NamedFileEnt.second) { - if (NamedFileEnt.second == NON_EXISTENT_FILE) - return nullptr; - // Entry exists: return it *unless* it wasn't opened and open is requested. - if (!(NamedFileEnt.second->DeferredOpen && openFile)) - return NamedFileEnt.second; - // We previously stat()ed the file, but didn't open it: do that below. - // FIXME: the below does other redundant work too (stats the dir and file). - } else { - // By default, initialize it to invalid. - NamedFileEnt.second = NON_EXISTENT_FILE; - } + if (NamedFileEnt.second) + return NamedFileEnt.second == NON_EXISTENT_FILE ? nullptr + : NamedFileEnt.second; ++NumFileCacheMisses; + // By default, initialize it to invalid. + NamedFileEnt.second = NON_EXISTENT_FILE; + // Get the null-terminated file name as stored as the key of the // SeenFileEntries map. StringRef InterndFileName = NamedFileEnt.first(); @@ -241,7 +235,6 @@ const FileEntry *FileManager::getFile(StringRef Filena // It exists. See if we have already opened a file with the same inode. // This occurs when one dir is symlinked to another, for example. FileEntry &UFE = UniqueRealFiles[Data.UniqueID]; - UFE.DeferredOpen = !openFile; NamedFileEnt.second = &UFE; @@ -258,15 +251,6 @@ const FileEntry *FileManager::getFile(StringRef Filena InterndFileName = NamedFileEnt.first().data(); } - // If we opened the file for the first time, record the resulting info. - // Do this even if the cache entry was valid, maybe we didn't previously open. - if (F && !UFE.File) { - if (auto PathName = F->getName()) - fillRealPathName(&UFE, *PathName); - UFE.File = std::move(F); - assert(!UFE.DeferredOpen && "we just opened it!"); - } - if (UFE.isValid()) { // Already have an entry with this inode, return it. // FIXME: this hack ensures that if we look up a file by a virtual path in @@ -297,9 +281,13 @@ const FileEntry *FileManager::getFile(StringRef Filena UFE.UniqueID = Data.UniqueID; UFE.IsNamedPipe = Data.IsNamedPipe; UFE.InPCH = Data.InPCH; + UFE.File = std::move(F); UFE.IsValid = true; - // Note File and DeferredOpen were initialized above. + if (UFE.File) { + if (auto PathName = UFE.File->getName()) + fillRealPathName(&UFE, *PathName); + } return &UFE; } @@ -371,7 +359,6 @@ FileManager::getVirtualFile(StringRef Filename, off_t UFE->UID = NextFileUID++; UFE->IsValid = true; UFE->File.reset(); - UFE->DeferredOpen = false; return UFE; } Modified: vendor/clang/dist-release_80/lib/Basic/TargetInfo.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Basic/TargetInfo.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Basic/TargetInfo.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -35,6 +35,7 @@ TargetInfo::TargetInfo(const llvm::Triple &T) : Target NoAsmVariants = false; HasLegalHalfType = false; HasFloat128 = false; + HasFloat16 = false; PointerWidth = PointerAlign = 32; BoolWidth = BoolAlign = 8; IntWidth = IntAlign = 32; Modified: vendor/clang/dist-release_80/lib/Basic/Targets.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Basic/Targets.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Basic/Targets.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -570,19 +570,27 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple, Triple.getVendor() != llvm::Triple::UnknownVendor || !Triple.isOSBinFormatWasm()) return nullptr; - if (Triple.getOS() != llvm::Triple::UnknownOS && - Triple.getOS() != llvm::Triple::WASI) - return nullptr; - return new WebAssemblyOSTargetInfo<WebAssembly32TargetInfo>(Triple, Opts); + switch (Triple.getOS()) { + case llvm::Triple::WASI: + return new WASITargetInfo<WebAssembly32TargetInfo>(Triple, Opts); + case llvm::Triple::UnknownOS: + return new WebAssemblyOSTargetInfo<WebAssembly32TargetInfo>(Triple, Opts); + default: + return nullptr; + } case llvm::Triple::wasm64: if (Triple.getSubArch() != llvm::Triple::NoSubArch || Triple.getVendor() != llvm::Triple::UnknownVendor || !Triple.isOSBinFormatWasm()) return nullptr; - if (Triple.getOS() != llvm::Triple::UnknownOS && - Triple.getOS() != llvm::Triple::WASI) - return nullptr; - return new WebAssemblyOSTargetInfo<WebAssembly64TargetInfo>(Triple, Opts); + switch (Triple.getOS()) { + case llvm::Triple::WASI: + return new WASITargetInfo<WebAssembly64TargetInfo>(Triple, Opts); + case llvm::Triple::UnknownOS: + return new WebAssemblyOSTargetInfo<WebAssembly64TargetInfo>(Triple, Opts); + default: + return nullptr; + } case llvm::Triple::renderscript32: return new LinuxTargetInfo<RenderScript32TargetInfo>(Triple, Opts); Modified: vendor/clang/dist-release_80/lib/Basic/Targets/AArch64.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Basic/Targets/AArch64.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Basic/Targets/AArch64.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -50,6 +50,7 @@ AArch64TargetInfo::AArch64TargetInfo(const llvm::Tripl // All AArch64 implementations support ARMv8 FP, which makes half a legal type. HasLegalHalfType = true; + HasFloat16 = true; LongWidth = LongAlign = PointerWidth = PointerAlign = 64; MaxVectorAlign = 128; Modified: vendor/clang/dist-release_80/lib/Basic/Targets/ARM.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Basic/Targets/ARM.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Basic/Targets/ARM.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -397,6 +397,7 @@ bool ARMTargetInfo::handleTargetFeatures(std::vector<s SoftFloat = SoftFloatABI = false; HWDiv = 0; DotProd = 0; + HasFloat16 = true; // This does not diagnose illegal cases like having both // "+vfpv2" and "+vfpv3" or having "+neon" and "+fp-only-sp". Modified: vendor/clang/dist-release_80/lib/Basic/Targets/OSTargets.h ============================================================================== --- vendor/clang/dist-release_80/lib/Basic/Targets/OSTargets.h Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Basic/Targets/OSTargets.h Tue Feb 5 18:39:15 2019 (r343796) @@ -764,8 +764,9 @@ class LLVM_LIBRARY_VISIBILITY FuchsiaTargetInfo : publ template <typename Target> class LLVM_LIBRARY_VISIBILITY WebAssemblyOSTargetInfo : public OSTargetInfo<Target> { +protected: void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, - MacroBuilder &Builder) const final { + MacroBuilder &Builder) const { // A common platform macro. if (Opts.POSIXThreads) Builder.defineMacro("_REENTRANT"); @@ -781,6 +782,21 @@ class LLVM_LIBRARY_VISIBILITY WebAssemblyOSTargetInfo this->MCountName = "__mcount"; this->TheCXXABI.set(TargetCXXABI::WebAssembly); } +}; + +// WASI target +template <typename Target> +class LLVM_LIBRARY_VISIBILITY WASITargetInfo + : public WebAssemblyOSTargetInfo<Target> { + void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, + MacroBuilder &Builder) const final { + WebAssemblyOSTargetInfo<Target>::getOSDefines(Opts, Triple, Builder); + Builder.defineMacro("__wasi__"); + } + +public: + explicit WASITargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) + : WebAssemblyOSTargetInfo<Target>(Triple, Opts) {} }; } // namespace targets Modified: vendor/clang/dist-release_80/lib/Basic/Targets/SPIR.h ============================================================================== --- vendor/clang/dist-release_80/lib/Basic/Targets/SPIR.h Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Basic/Targets/SPIR.h Tue Feb 5 18:39:15 2019 (r343796) @@ -48,6 +48,7 @@ class LLVM_LIBRARY_VISIBILITY SPIRTargetInfo : public AddrSpaceMap = &SPIRAddrSpaceMap; UseAddrSpaceMapMangling = true; HasLegalHalfType = true; + HasFloat16 = true; // Define available target features // These must be defined in sorted order! NoAsmVariants = true; Modified: vendor/clang/dist-release_80/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Driver/ToolChains/Clang.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Driver/ToolChains/Clang.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -1716,6 +1716,14 @@ void Clang::AddMIPSTargetArgs(const ArgList &Args, } else D.Diag(diag::warn_target_unsupported_compact_branches) << CPUName; } + + if (Arg *A = Args.getLastArg(options::OPT_mrelax_pic_calls, + options::OPT_mno_relax_pic_calls)) { + if (A->getOption().matches(options::OPT_mno_relax_pic_calls)) { + CmdArgs.push_back("-mllvm"); + CmdArgs.push_back("-mips-jalr-reloc=0"); + } + } } void Clang::AddPPCTargetArgs(const ArgList &Args, Modified: vendor/clang/dist-release_80/lib/Driver/ToolChains/NetBSD.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Driver/ToolChains/NetBSD.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Driver/ToolChains/NetBSD.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -256,6 +256,13 @@ void netbsd::Linker::ConstructJob(Compilation &C, cons bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs); AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA); + const SanitizerArgs &SanArgs = ToolChain.getSanitizerArgs(); + if (SanArgs.needsSharedRt()) { + CmdArgs.push_back("-rpath"); + CmdArgs.push_back(Args.MakeArgString( + ToolChain.getCompilerRTPath().c_str())); + } + unsigned Major, Minor, Micro; ToolChain.getTriple().getOSVersion(Major, Minor, Micro); bool useLibgcc = true; Modified: vendor/clang/dist-release_80/lib/Headers/opencl-c.h ============================================================================== --- vendor/clang/dist-release_80/lib/Headers/opencl-c.h Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Headers/opencl-c.h Tue Feb 5 18:39:15 2019 (r343796) @@ -14470,7 +14470,7 @@ half16 __ovld __cnfn shuffle2(half16 x, half16 y, usho #if __OPENCL_C_VERSION__ >= CL_VERSION_1_2 // OpenCL v1.2 s6.12.13, v2.0 s6.13.13 - printf -int printf(__constant const char* st, ...) __attribute__((format(printf, 1, 2))); +int printf(__constant const char* st, ...); #endif // OpenCL v1.1 s6.11.3, v1.2 s6.12.14, v2.0 s6.13.14 - Image Read and Write Functions Modified: vendor/clang/dist-release_80/lib/Lex/LiteralSupport.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Lex/LiteralSupport.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Lex/LiteralSupport.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -617,10 +617,11 @@ NumericLiteralParser::NumericLiteralParser(StringRef T if (isHalf || isFloat || isLong || isFloat128) break; // HF, FF, LF, QF invalid. - if (s + 2 < ThisTokEnd && s[1] == '1' && s[2] == '6') { - s += 2; // success, eat up 2 characters. - isFloat16 = true; - continue; + if (PP.getTargetInfo().hasFloat16Type() && s + 2 < ThisTokEnd && + s[1] == '1' && s[2] == '6') { + s += 2; // success, eat up 2 characters. + isFloat16 = true; + continue; } isFloat = true; Modified: vendor/clang/dist-release_80/lib/Sema/SemaCodeComplete.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Sema/SemaCodeComplete.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Sema/SemaCodeComplete.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -681,7 +681,8 @@ QualType clang::getDeclUsageType(ASTContext &C, const T = Property->getType(); else if (const auto *Value = dyn_cast<ValueDecl>(ND)) T = Value->getType(); - else + + if (T.isNull()) return QualType(); // Dig through references, function pointers, and block pointers to Modified: vendor/clang/dist-release_80/lib/Sema/SemaDeclCXX.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Sema/SemaDeclCXX.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Sema/SemaDeclCXX.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -1301,6 +1301,10 @@ static DeclAccessPair findDecomposableBaseClass(Sema & static bool checkMemberDecomposition(Sema &S, ArrayRef<BindingDecl*> Bindings, ValueDecl *Src, QualType DecompType, const CXXRecordDecl *OrigRD) { + if (S.RequireCompleteType(Src->getLocation(), DecompType, + diag::err_incomplete_type)) + return true; + CXXCastPath BasePath; DeclAccessPair BasePair = findDecomposableBaseClass(S, Src->getLocation(), OrigRD, BasePath); @@ -5885,9 +5889,6 @@ static bool canPassInRegisters(Sema &S, CXXRecordDecl TargetInfo::CallingConvKind CCK) { if (D->isDependentType() || D->isInvalidDecl()) return false; - - if (D->hasAttr<TrivialABIAttr>()) - return true; // Clang <= 4 used the pre-C++11 rule, which ignores move operations. // The PS4 platform ABI follows the behavior of Clang 3.2. Modified: vendor/clang/dist-release_80/lib/Sema/SemaExpr.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Sema/SemaExpr.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Sema/SemaExpr.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -738,33 +738,20 @@ ExprResult Sema::DefaultArgumentPromotion(Expr *E) { return ExprError(); E = Res.get(); - QualType ScalarTy = Ty; - unsigned NumElts = 0; - if (const ExtVectorType *VecTy = Ty->getAs<ExtVectorType>()) { - NumElts = VecTy->getNumElements(); - ScalarTy = VecTy->getElementType(); - } - // If this is a 'float' or '__fp16' (CVR qualified or typedef) // promote to double. // Note that default argument promotion applies only to float (and // half/fp16); it does not apply to _Float16. - const BuiltinType *BTy = ScalarTy->getAs<BuiltinType>(); + const BuiltinType *BTy = Ty->getAs<BuiltinType>(); if (BTy && (BTy->getKind() == BuiltinType::Half || BTy->getKind() == BuiltinType::Float)) { if (getLangOpts().OpenCL && !getOpenCLOptions().isEnabled("cl_khr_fp64")) { - if (BTy->getKind() == BuiltinType::Half) { - QualType Ty = Context.FloatTy; - if (NumElts != 0) - Ty = Context.getExtVectorType(Ty, NumElts); - E = ImpCastExprToType(E, Ty, CK_FloatingCast).get(); - } + if (BTy->getKind() == BuiltinType::Half) { + E = ImpCastExprToType(E, Context.FloatTy, CK_FloatingCast).get(); + } } else { - QualType Ty = Context.DoubleTy; - if (NumElts != 0) - Ty = Context.getExtVectorType(Ty, NumElts); - E = ImpCastExprToType(E, Ty, CK_FloatingCast).get(); + E = ImpCastExprToType(E, Context.DoubleTy, CK_FloatingCast).get(); } } Modified: vendor/clang/dist-release_80/lib/Sema/SemaTemplate.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Sema/SemaTemplate.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Sema/SemaTemplate.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -6309,7 +6309,7 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplate // -- a predefined __func__ variable if (auto *E = Value.getLValueBase().dyn_cast<const Expr*>()) { if (isa<CXXUuidofExpr>(E)) { - Converted = TemplateArgument(ArgResult.get()); + Converted = TemplateArgument(ArgResult.get()->IgnoreImpCasts()); break; } Diag(Arg->getBeginLoc(), diag::err_template_arg_not_decl_ref) Modified: vendor/clang/dist-release_80/lib/Sema/SemaType.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Sema/SemaType.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Sema/SemaType.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -1442,7 +1442,12 @@ static QualType ConvertDeclSpecToType(TypeProcessingSt else Result = Context.Int128Ty; break; - case DeclSpec::TST_float16: Result = Context.Float16Ty; break; + case DeclSpec::TST_float16: + if (!S.Context.getTargetInfo().hasFloat16Type()) + S.Diag(DS.getTypeSpecTypeLoc(), diag::err_type_unsupported) + << "_Float16"; + Result = Context.Float16Ty; + break; case DeclSpec::TST_half: Result = Context.HalfTy; break; case DeclSpec::TST_float: Result = Context.FloatTy; break; case DeclSpec::TST_double: Modified: vendor/clang/dist-release_80/lib/Tooling/ArgumentsAdjusters.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Tooling/ArgumentsAdjusters.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/lib/Tooling/ArgumentsAdjusters.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -108,5 +108,27 @@ ArgumentsAdjuster combineAdjusters(ArgumentsAdjuster F }; } +ArgumentsAdjuster getStripPluginsAdjuster() { + return [](const CommandLineArguments &Args, StringRef /*unused*/) { + CommandLineArguments AdjustedArgs; + for (size_t I = 0, E = Args.size(); I != E; I++) { + // According to https://clang.llvm.org/docs/ClangPlugins.html + // plugin arguments are in the form: + // -Xclang {-load, -plugin, -plugin-arg-<plugin-name>, -add-plugin} + // -Xclang <arbitrary-argument> + if (I + 4 < E && Args[I] == "-Xclang" && + (Args[I + 1] == "-load" || Args[I + 1] == "-plugin" || + llvm::StringRef(Args[I + 1]).startswith("-plugin-arg-") || + Args[I + 1] == "-add-plugin") && + Args[I + 2] == "-Xclang") { + I += 3; + continue; + } + AdjustedArgs.push_back(Args[I]); + } + return AdjustedArgs; + }; +} + } // end namespace tooling } // end namespace clang Modified: vendor/clang/dist-release_80/test/AST/float16.cpp ============================================================================== --- vendor/clang/dist-release_80/test/AST/float16.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/test/AST/float16.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c++11 -ast-dump %s | FileCheck %s --strict-whitespace -// RUN: %clang_cc1 -std=c++11 -ast-dump -fnative-half-type %s | FileCheck %s --check-prefix=CHECK-NATIVE --strict-whitespace +// RUN: %clang_cc1 -std=c++11 -ast-dump -triple aarch64-linux-gnu %s | FileCheck %s --strict-whitespace +// RUN: %clang_cc1 -std=c++11 -ast-dump -triple aarch64-linux-gnu -fnative-half-type %s | FileCheck %s --check-prefix=CHECK-NATIVE --strict-whitespace /* Various contexts where type _Float16 can appear. */ Modified: vendor/clang/dist-release_80/test/CXX/dcl.dcl/dcl.attr/dcl.align/p8.cpp ============================================================================== --- vendor/clang/dist-release_80/test/CXX/dcl.dcl/dcl.attr/dcl.align/p8.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/test/CXX/dcl.dcl/dcl.attr/dcl.align/p8.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -verify %s +// RUN: %clang_cc1 -std=c++11 -verify %s -triple x86_64-linux-gnu alignas(double) void f(); // expected-error {{'alignas' attribute only applies to variables, data members and tag types}} alignas(double) unsigned char c[sizeof(double)]; // expected-note {{previous}} Added: vendor/clang/dist-release_80/test/CodeCompletion/crash-null-type.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist-release_80/test/CodeCompletion/crash-null-type.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -0,0 +1,8 @@ +void test() { + for (auto [loopVar] : y) { // y has to be unresolved + loopVa + } +} +// RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:3:11 %s -o - \ +// RUN: | FileCheck %s +// CHECK: COMPLETION: loopVar Modified: vendor/clang/dist-release_80/test/CodeGen/arm64-crc32.c ============================================================================== --- vendor/clang/dist-release_80/test/CodeGen/arm64-crc32.c Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/test/CodeGen/arm64-crc32.c Tue Feb 5 18:39:15 2019 (r343796) @@ -1,54 +1,57 @@ // REQUIRES: aarch64-registered-target // RUN: %clang_cc1 -triple arm64-none-linux-gnu \ // RUN: -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-windows \ +// RUN: -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s +#include <stdint.h> -int crc32b(int a, char b) +uint32_t crc32b(uint32_t a, uint8_t b) { return __builtin_arm_crc32b(a,b); // CHECK: [[T0:%[0-9]+]] = zext i8 %b to i32 // CHECK: call i32 @llvm.aarch64.crc32b(i32 %a, i32 [[T0]]) } -int crc32cb(int a, char b) +uint32_t crc32cb(uint32_t a, uint8_t b) { return __builtin_arm_crc32cb(a,b); // CHECK: [[T0:%[0-9]+]] = zext i8 %b to i32 // CHECK: call i32 @llvm.aarch64.crc32cb(i32 %a, i32 [[T0]]) } -int crc32h(int a, short b) +uint32_t crc32h(uint32_t a, uint16_t b) { return __builtin_arm_crc32h(a,b); // CHECK: [[T0:%[0-9]+]] = zext i16 %b to i32 // CHECK: call i32 @llvm.aarch64.crc32h(i32 %a, i32 [[T0]]) } -int crc32ch(int a, short b) +uint32_t crc32ch(uint32_t a, uint16_t b) { return __builtin_arm_crc32ch(a,b); // CHECK: [[T0:%[0-9]+]] = zext i16 %b to i32 // CHECK: call i32 @llvm.aarch64.crc32ch(i32 %a, i32 [[T0]]) } -int crc32w(int a, int b) +uint32_t crc32w(uint32_t a, uint32_t b) { return __builtin_arm_crc32w(a,b); // CHECK: call i32 @llvm.aarch64.crc32w(i32 %a, i32 %b) } -int crc32cw(int a, int b) +uint32_t crc32cw(uint32_t a, uint32_t b) { return __builtin_arm_crc32cw(a,b); // CHECK: call i32 @llvm.aarch64.crc32cw(i32 %a, i32 %b) } -int crc32d(int a, long b) +uint32_t crc32d(uint32_t a, uint64_t b) { return __builtin_arm_crc32d(a,b); // CHECK: call i32 @llvm.aarch64.crc32x(i32 %a, i64 %b) } -int crc32cd(int a, long b) +uint32_t crc32cd(uint32_t a, uint64_t b) { return __builtin_arm_crc32cd(a,b); // CHECK: call i32 @llvm.aarch64.crc32cx(i32 %a, i64 %b) Modified: vendor/clang/dist-release_80/test/CodeGen/builtins-arm64.c ============================================================================== --- vendor/clang/dist-release_80/test/CodeGen/builtins-arm64.c Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/test/CodeGen/builtins-arm64.c Tue Feb 5 18:39:15 2019 (r343796) @@ -1,4 +1,6 @@ -// RUN: %clang_cc1 -triple arm64-unknown-linux -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s +// RUN: %clang_cc1 -triple arm64-unknown-linux -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-LINUX +// RUN: %clang_cc1 -triple aarch64-windows -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-WIN +#include <stdint.h> void f0(void *a, void *b) { __clear_cache(a,b); @@ -15,8 +17,15 @@ unsigned rbit(unsigned a) { return __builtin_arm_rbit(a); } +// CHECK-WIN: [[A64:%[^ ]+]] = zext i32 %a to i64 +// CHECK-WIN: call i64 @llvm.bitreverse.i64(i64 [[A64]]) +// CHECK-LINUX: call i64 @llvm.bitreverse.i64(i64 %a) +unsigned long rbitl(unsigned long a) { + return __builtin_arm_rbit64(a); +} + // CHECK: call {{.*}} @llvm.bitreverse.i64(i64 %a) -unsigned long long rbit64(unsigned long long a) { +uint64_t rbit64(uint64_t a) { return __builtin_arm_rbit64(a); } @@ -49,13 +58,17 @@ void prefetch() { // CHECK: call {{.*}} @llvm.prefetch(i8* null, i32 0, i32 3, i32 0) } -unsigned rsr() { +__typeof__(__builtin_arm_rsr("1:2:3:4:5")) rsr(void); + +uint32_t rsr() { // CHECK: [[V0:[%A-Za-z0-9.]+]] = call i64 @llvm.read_register.i64(metadata ![[M0:[0-9]]]) // CHECK-NEXT: trunc i64 [[V0]] to i32 return __builtin_arm_rsr("1:2:3:4:5"); } -unsigned long rsr64() { +__typeof__(__builtin_arm_rsr64("1:2:3:4:5")) rsr64(void); + +uint64_t rsr64(void) { // CHECK: call i64 @llvm.read_register.i64(metadata ![[M0:[0-9]]]) return __builtin_arm_rsr64("1:2:3:4:5"); } @@ -66,13 +79,17 @@ void *rsrp() { return __builtin_arm_rsrp("1:2:3:4:5"); } +__typeof__(__builtin_arm_wsr("1:2:3:4:5", 0)) wsr(unsigned); + void wsr(unsigned v) { // CHECK: [[V0:[%A-Za-z0-9.]+]] = zext i32 %v to i64 // CHECK-NEXT: call void @llvm.write_register.i64(metadata ![[M0:[0-9]]], i64 [[V0]]) __builtin_arm_wsr("1:2:3:4:5", v); } -void wsr64(unsigned long v) { +__typeof__(__builtin_arm_wsr64("1:2:3:4:5", 0)) wsr64(uint64_t); + +void wsr64(uint64_t v) { // CHECK: call void @llvm.write_register.i64(metadata ![[M0:[0-9]]], i64 %v) __builtin_arm_wsr64("1:2:3:4:5", v); } Modified: vendor/clang/dist-release_80/test/CodeGenCXX/float16-declarations.cpp ============================================================================== --- vendor/clang/dist-release_80/test/CodeGenCXX/float16-declarations.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/test/CodeGenCXX/float16-declarations.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -1,5 +1,4 @@ // RUN: %clang -std=c++11 --target=aarch64-arm--eabi -S -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-AARCH64 -// RUN: %clang -std=c++11 --target=x86_64 -S -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-X86 /* Various contexts where type _Float16 can appear. */ @@ -15,7 +14,6 @@ namespace { _Float16 arr1n[10]; // CHECK-AARCH64-DAG: @_ZN12_GLOBAL__N_15arr1nE = internal global [10 x half] zeroinitializer, align 2 -// CHECK-X86-DAG: @_ZN12_GLOBAL__N_15arr1nE = internal global [10 x half] zeroinitializer, align 16 _Float16 arr2n[] = { 1.2, 3.0, 3.e4 }; // CHECK-DAG: @_ZN12_GLOBAL__N_15arr2nE = internal global [3 x half] [half 0xH3CCD, half 0xH4200, half 0xH7753], align 2 @@ -30,14 +28,12 @@ namespace { _Float16 f1f; // CHECK-AARCH64-DAG: @f1f = dso_local global half 0xH0000, align 2 -// CHECK-X86-DAG: @f1f = dso_local global half 0xH0000, align 2 _Float16 f2f = 32.4; // CHECK-DAG: @f2f = dso_local global half 0xH500D, align 2 _Float16 arr1f[10]; // CHECK-AARCH64-DAG: @arr1f = dso_local global [10 x half] zeroinitializer, align 2 -// CHECK-X86-DAG: @arr1f = dso_local global [10 x half] zeroinitializer, align 16 _Float16 arr2f[] = { -1.2, -3.0, -3.e4 }; // CHECK-DAG: @arr2f = dso_local global [3 x half] [half 0xHBCCD, half 0xHC200, half 0xHF753], align 2 @@ -137,8 +133,6 @@ int main(void) { long double cvtld = f2n; //CHECK-AARCh64-DAG: [[H2LD:%[a-z0-9]+]] = fpext half {{%[0-9]+}} to fp128 //CHECK-AARCh64-DAG: store fp128 [[H2LD]], fp128* %{{.*}}, align 16 -//CHECK-X86-DAG: [[H2LD:%[a-z0-9]+]] = fpext half {{%[0-9]+}} to x86_fp80 -//CHECK-X86-DAG: store x86_fp80 [[H2LD]], x86_fp80* %{{.*}}, align 16 _Float16 f2h = 42.0f; //CHECK-DAG: store half 0xH5140, half* %{{.*}}, align 2 Modified: vendor/clang/dist-release_80/test/CodeGenCXX/mangle-ms.cpp ============================================================================== --- vendor/clang/dist-release_80/test/CodeGenCXX/mangle-ms.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/test/CodeGenCXX/mangle-ms.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -triple=i386-pc-win32 -std=c++98 | FileCheck %s // RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -triple=x86_64-pc-win32 -std=c++98| FileCheck -check-prefix X64 %s +// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -triple=aarch64-pc-win32 -std=c++98 -DARM | FileCheck -check-prefixes=X64,ARM %s int a; // CHECK-DAG: @"?a@@3HA" @@ -466,10 +467,12 @@ namespace Complex { // CHECK-DAG: define dso_local void @"?f@Complex@@YAXU?$_Complex@H@__clang@@@Z"( void f(_Complex int) {} } +#ifdef ARM namespace Float16 { -// CHECK-DAG: define dso_local void @"?f@Float16@@YAXU_Float16@__clang@@@Z"( +// ARM-DAG: define dso_local void @"?f@Float16@@YAXU_Float16@__clang@@@Z"( void f(_Float16) {} } +#endif // ARM namespace PR26029 { template <class> Modified: vendor/clang/dist-release_80/test/CodeGenCXX/trivial_abi.cpp ============================================================================== --- vendor/clang/dist-release_80/test/CodeGenCXX/trivial_abi.cpp Tue Feb 5 18:39:08 2019 (r343795) +++ vendor/clang/dist-release_80/test/CodeGenCXX/trivial_abi.cpp Tue Feb 5 18:39:15 2019 (r343796) @@ -1,5 +1,5 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902051839.x15IdFml063340>