From 2ed8710148a921286717212737771dd31c518fb7 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 4 Mar 2018 15:03:44 +0000 Subject: [PATCH 1/3] Vendor import of llvm 6.0.0 release r326565: https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_600/final@326565 --- bindings/go/README.txt | 8 ++ docs/ReleaseNotes.rst | 98 ++++++------------- .../AArch64/AArch64InstructionSelector.cpp | 1 + lib/Target/X86/X86ISelLowering.cpp | 2 +- test/CodeGen/X86/pr36553.ll | 20 ++++ 5 files changed, 62 insertions(+), 67 deletions(-) create mode 100644 test/CodeGen/X86/pr36553.ll diff --git a/bindings/go/README.txt b/bindings/go/README.txt index 2fc4afa0771..6ed224d8280 100644 --- a/bindings/go/README.txt +++ b/bindings/go/README.txt @@ -51,3 +51,11 @@ CGO_CPPFLAGS, CGO_CXXFLAGS and CGO_LDFLAGS environment variables: $ export CGO_CXXFLAGS=-std=c++11 $ export CGO_LDFLAGS="`/path/to/llvm-build/bin/llvm-config --ldflags --libs --system-libs all`" $ go build -tags byollvm + +If you see a compilation error while compiling your code with Go 1.9.4 or later as follows, + + go build llvm.org/llvm/bindings/go/llvm: invalid flag in #cgo LDFLAGS: -Wl,-headerpad_max_install_names + +you need to setup $CGO_LDFLAGS_ALLOW to allow a compiler to specify some linker options: + + $ export CGO_LDFLAGS_ALLOW='-Wl,(-search_paths_first|-headerpad_max_install_names)' diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst index f2bbdc871ad..ed867d5a9dc 100644 --- a/docs/ReleaseNotes.rst +++ b/docs/ReleaseNotes.rst @@ -22,12 +22,12 @@ them. Non-comprehensive list of changes in this release ================================================= -.. NOTE - For small 1-3 sentence descriptions, just add an entry at the end of - this list. If your description won't fit comfortably in one bullet - point (e.g. maybe you would like to give an example of the - functionality, or simply have a lot to talk about), see the `NOTE` below - for adding a new subsection. + +* Support for `retpolines `_ + was added to help mitigate "branch target injection" (variant #2) of the + "Spectre" speculative side channels described by `Project Zero + `_ + and the `Spectre paper `_. * The ``Redirects`` argument of ``llvm::sys::ExecuteAndWait`` and ``llvm::sys::ExecuteNoWait`` was changed to an ``ArrayRef`` of optional @@ -48,17 +48,6 @@ Non-comprehensive list of changes in this release * Preliminary support for Sanitizers and sibling features on X86(_64) NetBSD (ASan, UBsan, TSan, MSan, SafeStack, libFuzzer). -* Note.. - -.. NOTE - If you would like to document a larger change, then you can add a - subsection about it right here. You can copy the following boilerplate - and un-indent it (the indentation causes it to be inside this comment). - - Special New Feature - ------------------- - - Makes programs 10x faster by doing Special New Thing. Changes to the LLVM IR ---------------------- @@ -72,19 +61,17 @@ Changes to the LLVM IR to enable/disable specific floating-point optimizations. Making the optimizer respond appropriately to these flags is an ongoing effort. + Changes to the AArch64 Target ----------------------------- -During this release: +* Enabled the new GlobalISel instruction selection framework by default at ``-O0``. - * Enabled the new GlobalISel instruction selection framework by default at ``-O0``. Changes to the ARM Target ------------------------- -During this release the ARM target has: - -* Got support for enabling SjLj exception handling on platforms where it +* Support for enabling SjLj exception handling on platforms where it isn't the default. @@ -93,12 +80,12 @@ Changes to the Hexagon Target * The Hexagon backend now supports V65 ISA. -* The ``-mhvx`` option now takes an optional value that specified the ISA +* The ``-mhvx`` option now takes an optional value that specifies the ISA version of the HVX coprocessor. The available values are v60, v62 and v65. By default, the value is set to be the same as the CPU version. * The compiler option ``-mhvx-double`` is deprecated and will be removed in - the next release of the compiler. Programmers should use ``-mhvx-length`` + the next release of the compiler. Programmers should use the ``-mhvx-length`` option to specify the desired vector length: ``-mhvx-length=64b`` for 64-byte vectors and ``-mhvx-length=128b`` for 128-byte vectors. While the current default vector length is 64 bytes, users should always specify the @@ -130,8 +117,8 @@ Fixed numerous bugs: * Corrected the encoding of movep for microMIPS32r6. * Fixed an issue with the usage of insert instructions having an invalid set of operands. -* Fixed an issue where TLS symbols where not marked as such. -* Enabled the usage of register scavanging with MSA, due to its' shorter offsets +* Fixed an issue where TLS symbols were not marked as such. +* Enabled the usage of register scavenging with MSA, due to its shorter offsets for loads and stores. * Corrected the ELF headers when using the DSP ASE. @@ -152,10 +139,6 @@ Deprecation notices: * microMIPS64R6 support was been deprecated since 5.0, and has now been completely removed. -Changes to the PowerPC Target ------------------------------ - - During this release ... Changes to the SystemZ Target ----------------------------- @@ -204,33 +187,31 @@ During this release the X86 target has: * Gained initial support recognizing variable shuffles from vector element extracts and inserts. -* Improved documentation for SSE/AVX intrinsics in *intrin.h header files. +* Improved documentation for SSE/AVX intrinsics in intrin.h header files. -Changes to the AMDGPU Target ------------------------------ - - During this release ... - -Changes to the AVR Target ------------------------------ - - During this release ... - -Changes to the OCaml bindings ------------------------------ - - During this release ... - - -Changes to the C API --------------------- - - During this release ... +* Gained support for emitting `retpolines + `_, including automatic + insertion of the necessary thunks or using external thunks. External Open Source Projects Using LLVM 6 ========================================== +LDC - the LLVM-based D compiler +------------------------------- + +`D `_ is a language with C-like syntax and static typing. It +pragmatically combines efficiency, control, and modeling power, with safety and +programmer productivity. D supports powerful concepts like Compile-Time Function +Execution (CTFE) and Template Meta-Programming, provides an innovative approach +to concurrency and offers many classical paradigms. + +`LDC `_ uses the frontend from the reference compiler +combined with LLVM as backend to produce efficient native code. LDC targets +x86/x86_64 systems like Linux, OS X, FreeBSD and Windows and also Linux on ARM +and PowerPC (32/64 bit). Ports to other architectures like AArch64 and MIPS64 +are underway. + JFS - JIT Fuzzing Solver ------------------------ @@ -257,21 +238,6 @@ import of .h symbols - even inline functions and macros. Zig uses LLD combined with lazily building compiler-rt to provide out-of-the-box cross-compiling for all supported targets. -LDC - the LLVM-based D compiler -------------------------------- - -`D `_ is a language with C-like syntax and static typing. It -pragmatically combines efficiency, control, and modeling power, with safety and -programmer productivity. D supports powerful concepts like Compile-Time Function -Execution (CTFE) and Template Meta-Programming, provides an innovative approach -to concurrency and offers many classical paradigms. - -`LDC `_ uses the frontend from the reference compiler -combined with LLVM as backend to produce efficient native code. LDC targets -x86/x86_64 systems like Linux, OS X, FreeBSD and Windows and also Linux on ARM -and PowerPC (32/64 bit). Ports to other architectures like AArch64 and MIPS64 -are underway. - Additional Information ====================== diff --git a/lib/Target/AArch64/AArch64InstructionSelector.cpp b/lib/Target/AArch64/AArch64InstructionSelector.cpp index 0bc5b395499..7d2ec1be288 100644 --- a/lib/Target/AArch64/AArch64InstructionSelector.cpp +++ b/lib/Target/AArch64/AArch64InstructionSelector.cpp @@ -840,6 +840,7 @@ bool AArch64InstructionSelector::select(MachineInstr &I, case TargetOpcode::G_EXTRACT: { LLT SrcTy = MRI.getType(I.getOperand(1).getReg()); LLT DstTy = MRI.getType(I.getOperand(0).getReg()); + (void)DstTy; unsigned SrcSize = SrcTy.getSizeInBits(); // Larger extracts are vectors, same-size extracts should be something else // by now (either split up or simplified to a COPY). diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 9237833a2cd..10e19f92b4a 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -35520,7 +35520,7 @@ static SDValue combineFneg(SDNode *N, SelectionDAG &DAG, // If we're negating an FMA node, then we can adjust the // instruction to include the extra negation. unsigned NewOpcode = 0; - if (Arg.hasOneUse()) { + if (Arg.hasOneUse() && Subtarget.hasAnyFMA()) { switch (Arg.getOpcode()) { case ISD::FMA: NewOpcode = X86ISD::FNMSUB; break; case X86ISD::FMSUB: NewOpcode = X86ISD::FNMADD; break; diff --git a/test/CodeGen/X86/pr36553.ll b/test/CodeGen/X86/pr36553.ll new file mode 100644 index 00000000000..827f80a3e07 --- /dev/null +++ b/test/CodeGen/X86/pr36553.ll @@ -0,0 +1,20 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | FileCheck %s + +; Make sure we don't crash because we negated an fma when we didn't have any fma instructions. + +define float @pr36553(float %a, float %b, float %c) nounwind { +; CHECK-LABEL: pr36553: +; CHECK: ## %bb.0: ## %entry +; CHECK-NEXT: pushq %rax +; CHECK-NEXT: callq _fmaf +; CHECK-NEXT: xorps {{.*}}(%rip), %xmm0 +; CHECK-NEXT: popq %rax +; CHECK-NEXT: retq +entry: + %0 = tail call float @llvm.fma.f32(float %a, float %b, float %c) + %sub = fsub float -0.000000e+00, %0 + ret float %sub +} + +declare float @llvm.fma.f32(float, float, float) From 5c8694c6ce76fdf2c8630f569e375cf343894dab Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 4 Mar 2018 15:06:36 +0000 Subject: [PATCH 2/3] Vendor import of clang 6.0.0 release r326565: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_600/final@326565 --- docs/AttributeReference.rst | 38 ++--- docs/ReleaseNotes.rst | 247 ++++++++++++++------------------ include/clang/Basic/AttrDocs.td | 40 +++--- lib/Basic/Version.cpp | 2 +- 4 files changed, 151 insertions(+), 176 deletions(-) diff --git a/docs/AttributeReference.rst b/docs/AttributeReference.rst index 26965e4cd73..d0e02fa72b3 100644 --- a/docs/AttributeReference.rst +++ b/docs/AttributeReference.rst @@ -36,23 +36,23 @@ used to process multiple arguments from a single invocation from a SIMD loop concurrently. The syntax of the `declare simd` construct is as follows: - .. code-block:: c + .. code-block:: none - #pragma omp declare simd [clause[[,] clause] ...] new-line - [#pragma omp declare simd [clause[[,] clause] ...] new-line] - [...] - function definition or declaration + #pragma omp declare simd [clause[[,] clause] ...] new-line + [#pragma omp declare simd [clause[[,] clause] ...] new-line] + [...] + function definition or declaration where clause is one of the following: - .. code-block:: c + .. code-block:: none - simdlen(length) - linear(argument-list[:constant-linear-step]) - aligned(argument-list[:alignment]) - uniform(argument-list) - inbranch - notinbranch + simdlen(length) + linear(argument-list[:constant-linear-step]) + aligned(argument-list[:alignment]) + uniform(argument-list) + inbranch + notinbranch #pragma omp declare target @@ -69,9 +69,9 @@ The syntax of the declare target directive is as follows: .. code-block:: c - #pragma omp declare target new-line - declarations-definition-seq - #pragma omp end declare target new-line + #pragma omp declare target new-line + declarations-definition-seq + #pragma omp end declare target new-line _Noreturn @@ -557,7 +557,7 @@ available in C. int isdigit(int c); int isdigit(int c) __attribute__((enable_if(c <= -1 || c > 255, "chosen when 'c' is out of range"))) __attribute__((unavailable("'c' must have the value of an unsigned char or EOF"))); - + void foo(char c) { isdigit(c); isdigit(10); @@ -610,7 +610,7 @@ overload out of a number of viable overloads using enable_if. void f() __attribute__((enable_if(true, ""))); // #1 void f() __attribute__((enable_if(true, ""))) __attribute__((enable_if(true, ""))); // #2 - + void g(int i, int j) __attribute__((enable_if(i, ""))); // #1 void g(int i, int j) __attribute__((enable_if(j, ""))) __attribute__((enable_if(true))); // #2 @@ -1170,7 +1170,7 @@ potentially-evaluated discarded-value expression that is not explicitly cast to .. code-block: c++ struct [[nodiscard]] error_info { /*...*/ }; error_info enable_missile_safety_mode(); - + void launch_missiles(); void test_missiles() { enable_missile_safety_mode(); // diagnoses @@ -1451,7 +1451,7 @@ default name. can only be placed before an @protocol or @interface declaration: .. code-block:: objc - + __attribute__((objc_runtime_name("MyLocalName"))) @interface Message @end diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst index 521ab9ba135..d817907e223 100644 --- a/docs/ReleaseNotes.rst +++ b/docs/ReleaseNotes.rst @@ -32,13 +32,34 @@ here. Generic improvements to Clang as a whole or to its underlying infrastructure are described first, followed by language-specific sections with improvements to Clang's support for those languages. -Major New Features ------------------- +Non-comprehensive list of changes in this release +------------------------------------------------- + +- Support for `retpolines `_ + was added to help mitigate "branch target injection" (variant #2) of the + "Spectre" speculative side channels described by `Project Zero + `_ + and the `Spectre paper `_. + +- Bitrig OS was merged back into OpenBSD, so Bitrig support has been + removed from Clang/LLVM. + +- The default value of ``_MSC_VER`` was raised from 1800 to 1911, making it + compatible with the Visual Studio 2015 and 2017 C++ standard library headers. + Users should generally expect this to be regularly raised to match the most + recently released version of the Visual C++ compiler. + +- clang now defaults to ``.init_array`` if no gcc installation can be found. + If a gcc installation is found, it still prefers ``.ctors`` if the found + gcc is older than 4.7.0. + +- The new builtin preprocessor macros ``__is_target_arch``, + ``__is_target_vendor``, ``__is_target_os``, and ``__is_target_environment`` + can be used to to examine the individual components of the target triple. -- ... Improvements to Clang's diagnostics -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +----------------------------------- - ``-Wpragma-pack`` is a new warning that warns in the following cases: @@ -61,7 +82,7 @@ Improvements to Clang's diagnostics selector which could make the message send to ``id`` ambiguous. - ``-Wtautological-compare`` now warns when comparing an unsigned integer and 0 - regardless of whether the constant is signed or unsigned." + regardless of whether the constant is signed or unsigned. - ``-Wtautological-compare`` now warns about comparing a signed integer and 0 when the signed integer is coerced to an unsigned type for the comparison. @@ -90,37 +111,37 @@ Improvements to Clang's diagnostics - ``-Wunreachable-code`` can now reason about ``__try``, ``__except`` and ``__leave``. -Non-comprehensive list of changes in this release -------------------------------------------------- - -- Bitrig OS was merged back into OpenBSD, so Bitrig support has been - removed from Clang/LLVM. - -- The default value of _MSC_VER was raised from 1800 to 1911, making it - compatible with the Visual Studio 2015 and 2017 C++ standard library headers. - Users should generally expect this to be regularly raised to match the most - recently released version of the Visual C++ compiler. - -- clang now defaults to ``.init_array`` if no gcc installation can be found. - If a gcc installation is found, it still prefers ``.ctors`` if the found - gcc is older than 4.7.0. - -- The new builtin preprocessor macros ``__is_target_arch``, - ``__is_target_vendor``, ``__is_target_os``, and ``__is_target_environment`` - can be used to to examine the individual components of the target triple. New Compiler Flags ------------------ -- --autocomplete was implemented to obtain a list of flags and its arguments. This is used for shell autocompletion. +- Clang supports the ``-mretpoline`` flag to enable `retpolines + `_. Code compiled with this + flag will be hardened against variant #2 of the Spectre attack. Indirect + branches from switches or gotos removed from the code, and indirect calls + will be made through a "retpoline" thunk. The necessary thunks will + automatically be inserted into the generated code. Clang also supports + ``-mretpoline-external-thunk`` which works like ``-mretpoline`` but requires + the user to provide their own thunk definitions. The external thunk names + start with ``__x86_indirect_thunk_`` and end in a register name. For 64-bit + platforms, only an ``r11`` thunk is used, but for 32-bit platforms ``eax``, + ``ecx``, ``edx``, and ``edi`` thunks are used. + +- Clang now supports configuration files. These are collections of driver + options, which can be applied by specifying the configuration file, either + using command line option ``--config foo.cfg`` or encoding it into executable + name ``foo-clang``. Clang behaves as if the options from this file were inserted + before the options specified in command line. This feature is primary intended + to facilitate cross compilation. Details can be found in + `Clang Compiler User's Manual `_. - The ``-fdouble-square-bracket-attributes`` and corresponding ``-fno-double-square-bracket-attributes`` flags were added to enable or - disable [[]] attributes in any language mode. Currently, only a limited + disable ``[[]]`` attributes in any language mode. Currently, only a limited number of attributes are supported outside of C++ mode. See the Clang - attribute documentation for more information about which attributes are - supported for each syntax. - + `attribute documentation `_ for more information + about which attributes are supported for each syntax. + - Added the ``-std=c17``, ``-std=gnu17``, and ``-std=iso9899:2017`` language mode flags for compatibility with GCC. This enables support for the next version of the C standard, expected to be published by ISO in 2018. The only @@ -135,19 +156,6 @@ New Compiler Flags - New ``-nostdlib++`` flag to disable linking the C++ standard library. Similar to using ``clang`` instead of ``clang++`` but doesn't disable ``-lm``. -Deprecated Compiler Flags -------------------------- - -The following options are deprecated and ignored. They will be removed in -future versions of Clang. - -- ... - -New Pragmas in Clang ------------------------ - -Clang now supports the ... - Attribute Changes in Clang -------------------------- @@ -157,25 +165,15 @@ Attribute Changes in Clang in the ``clang`` vendor namespace (``[[clang::name]]``). Attributes whose syntax is specified by some other standard (such as CUDA and OpenCL attributes) continue to follow their respective specification. - + - Added the ``__has_c_attribute()`` builtin preprocessor macro which allows users to dynamically detect whether a double square-bracket attribute is supported in C mode. This attribute syntax can be enabled with the ``-fdouble-square-bracket-attributes`` flag. - -- The presence of __attribute__((availability(...))) on a declaration no longer - implies default visibility for that declaration on macOS. -- Clang now supports configuration files. These are collections of driver - options, which can be applied by specifying the configuration file, either - using command line option `--config foo.cfg` or encoding it into executable - name `foo-clang`. Clang behaves as if the options from this file were inserted - before the options specified in command line. This feature is primary intended - to facilitate cross compilation. Details can be found in - `Clang Compiler User's Manual - `. +- The presence of ``__attribute__((availability(...)))`` on a declaration no + longer implies default visibility for that declaration on macOS. -- ... Windows Support --------------- @@ -185,17 +183,6 @@ Windows Support - clang-cl now exposes the ``--version`` flag. -C Language Changes in Clang ---------------------------- - -- ... - -... - -C11 Feature Support -^^^^^^^^^^^^^^^^^^^ - -... C++ Language Changes in Clang ----------------------------- @@ -205,20 +192,38 @@ C++ Language Changes in Clang conforming GNU extensions. Projects incompatible with C++14 can add ``-std=gnu++98`` to their build settings to restore the previous behaviour. -C++1z Feature Support -^^^^^^^^^^^^^^^^^^^^^ +- Added support for some features from the C++ standard after C++17 + (provisionally known as C++2a but expected to be C++20). This support can be + enabled with the ``-std=c++2a`` flag. This enables: -... + - Support for ``__VA_OPT__``, to allow variadic macros to easily provide + different expansions when they are invoked without variadic arguments. -Objective-C Language Changes in Clang -------------------------------------- + - Recognition of the ``<=>`` token (the C++2a three-way comparison operator). -... + - Support for default member initializers for bit-fields. + + - Lambda capture of ``*this``. + + - Pointer-to-member calls using ``const &``-qualified pointers on temporary objects. + + All of these features other than ``__VA_OPT__`` and ``<=>`` are made + available with a warning in earlier C++ language modes. + +- A warning has been added for a ``<=`` token followed immediately by a ``>`` + character. Code containing such constructs will change meaning in C++2a due + to the addition of the ``<=>`` operator. + +- Clang implements the "destroying operator delete" feature described in C++ + committee paper `P0722R1 + `, + which is targeting inclusion in C++2a but has not yet been voted into the C++ + working draft. Support for this feature is enabled by the presence of the + standard library type ``std::destroying_delete_t``. OpenCL C Language Changes in Clang ---------------------------------- - - Added subgroup builtins to enqueue kernel support. - Added CL2.0 atomics as Clang builtins that now accept @@ -258,77 +263,72 @@ OpenCL C Language Changes in Clang - Miscellaneous improvements in vector diagnostics. - Added half float load and store builtins without enabling half as a legal type - (``__builtin_store_half for double``, ``__builtin_store_halff`` for double, - ``__builtin_load_half for double``, ``__builtin_load_halff`` for float). + (``__builtin_store_half`` for double, ``__builtin_store_halff`` for float, + ``__builtin_load_half`` for double, ``__builtin_load_halff`` for float). OpenMP Support in Clang ---------------------------------- -- Added options `-f[no]-openmp-simd` that support code emission only for OpenMP - SIMD-based directives, like `#pragma omp simd`, `#pragma omp parallel for simd` - etc. The code is emitted only for simd-based part of the combined directives +- Added options ``-f[no]-openmp-simd`` that support code emission only for OpenMP + SIMD-based directives, like ``#pragma omp simd``, ``#pragma omp parallel for simd`` + etc. The code is emitted only for SIMD-based part of the combined directives and clauses. - Added support for almost all target-based directives except for - `#pragma omp target teams distribute parallel for [simd]`. Although, please - note that `depend` clauses on target-based directives are not supported yet. + ``#pragma omp target teams distribute parallel for [simd]``. Although, please + note that ``depend`` clauses on target-based directives are not supported yet. Clang supports offloading to X86_64, AArch64 and PPC64[LE] devices. -- Added support for `reduction`-based clauses on `task`-based directives from +- Added support for ``reduction``-based clauses on ``task``-based directives from upcoming OpenMP 5.0. -- The LLVM OpenMP runtime `libomp` now supports the OpenMP Tools Interface (OMPT) +- The LLVM OpenMP runtime ``libomp`` now supports the OpenMP Tools Interface (OMPT) on x86, x86_64, AArch64, and PPC64 on Linux, Windows, and macOS. If you observe a measurable performance impact on one of your applications without a tool - attached, please rebuild the runtime library with `-DLIBOMP_OMPT_SUPPORT=OFF` and + attached, please rebuild the runtime library with ``-DLIBOMP_OMPT_SUPPORT=OFF`` and file a bug at `LLVM's Bugzilla `_ or send a message to the `OpenMP development list `_. -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 ------------ -The hasDeclaration matcher now works the same for Type and QualType and only +The ``hasDeclaration`` matcher now works the same for ``Type`` and ``QualType`` and only ever looks through one level of sugaring in a limited number of cases. There are two main patterns affected by this: -- qualType(hasDeclaration(recordDecl(...))): previously, we would look through - sugar like TypedefType to get at the underlying recordDecl; now, we need +- ``qualType(hasDeclaration(recordDecl(...)))``: previously, we would look through + sugar like ``TypedefType`` to get at the underlying ``recordDecl``; now, we need to explicitly remove the sugaring: - qualType(hasUnqualifiedDesugaredType(hasDeclaration(recordDecl(...)))) + ``qualType(hasUnqualifiedDesugaredType(hasDeclaration(recordDecl(...))))`` -- hasType(recordDecl(...)): hasType internally uses hasDeclaration; previously, - this matcher used to match for example TypedefTypes of the RecordType, but +- ``hasType(recordDecl(...))``: ``hasType`` internally uses ``hasDeclaration``; previously, + this matcher used to match for example ``TypedefTypes`` of the ``RecordType``, but after the change they don't; to fix, use: -:: - hasType(hasUnqualifiedDesugaredType( - recordType(hasDeclaration(recordDecl(...))))) + .. code-block:: c -- templateSpecializationType(hasDeclaration(classTemplateDecl(...))): - previously, we would directly match the underlying ClassTemplateDecl; - now, we can explicitly match the ClassTemplateSpecializationDecl, but that - requires to explicitly get the ClassTemplateDecl: + hasType(hasUnqualifiedDesugaredType( + recordType(hasDeclaration(recordDecl(...))))) + +- ``templateSpecializationType(hasDeclaration(classTemplateDecl(...)))``: + previously, we would directly match the underlying ``ClassTemplateDecl``; + now, we can explicitly match the ``ClassTemplateSpecializationDecl``, but that + requires to explicitly get the ``ClassTemplateDecl``: + + .. code-block:: c + + templateSpecializationType(hasDeclaration( + classTemplateSpecializationDecl( + hasSpecializedTemplate(classTemplateDecl(...))))) -:: - templateSpecializationType(hasDeclaration( - classTemplateSpecializationDecl( - hasSpecializedTemplate(classTemplateDecl(...))))) clang-format ------------ -* Option *IndentPPDirectives* added to indent preprocessor directives on +* Option ``IndentPPDirectives`` added to indent preprocessor directives on conditionals. +----------------------+----------------------+ @@ -343,10 +343,10 @@ clang-format | #endif | #endif | +----------------------+----------------------+ -* Option -verbose added to the command line. +* Option ``-verbose`` added to the command line. Shows the list of processed files. -* Option *IncludeBlocks* added to merge and regroup multiple ``#include`` blocks during sorting. +* Option ``IncludeBlocks`` added to merge and regroup multiple ``#include`` blocks during sorting. +-------------------------+-------------------------+-------------------------+ | Before (Preserve) | Merge | Regroup | @@ -359,19 +359,13 @@ clang-format | #include | | #include | +-------------------------+-------------------------+-------------------------+ -libclang --------- - -... - Static Analyzer --------------- -- Static Analyzer can now properly detect and diagnose unary pre-/post- +- The Static Analyzer can now properly detect and diagnose unary pre-/post- increment/decrement on an uninitialized value. -... Undefined Behavior Sanitizer (UBSan) ------------------------------------ @@ -381,25 +375,6 @@ Undefined Behavior Sanitizer (UBSan) issue logging and deduplication, and does not support ``-fsanitize=vptr`` checking. -Core Analysis Improvements -========================== - -- ... - -New Issues Found -================ - -- ... - -Python Binding Changes ----------------------- - -The following methods have been added: - -- ... - -Significant Known Problems -========================== Additional Information ====================== diff --git a/include/clang/Basic/AttrDocs.td b/include/clang/Basic/AttrDocs.td index ecff329c4cc..dc355832b87 100644 --- a/include/clang/Basic/AttrDocs.td +++ b/include/clang/Basic/AttrDocs.td @@ -353,7 +353,7 @@ available in C. int isdigit(int c); int isdigit(int c) __attribute__((enable_if(c <= -1 || c > 255, "chosen when 'c' is out of range"))) __attribute__((unavailable("'c' must have the value of an unsigned char or EOF"))); - + void foo(char c) { isdigit(c); isdigit(10); @@ -406,7 +406,7 @@ overload out of a number of viable overloads using enable_if. void f() __attribute__((enable_if(true, ""))); // #1 void f() __attribute__((enable_if(true, ""))) __attribute__((enable_if(true, ""))); // #2 - + void g(int i, int j) __attribute__((enable_if(i, ""))); // #1 void g(int i, int j) __attribute__((enable_if(j, ""))) __attribute__((enable_if(true))); // #2 @@ -918,11 +918,11 @@ default name. can only be placed before an @protocol or @interface declaration: .. code-block:: objc - + __attribute__((objc_runtime_name("MyLocalName"))) @interface Message @end - + }]; } @@ -1228,7 +1228,7 @@ potentially-evaluated discarded-value expression that is not explicitly cast to .. code-block: c++ struct [[nodiscard]] error_info { /*...*/ }; error_info enable_missile_safety_mode(); - + void launch_missiles(); void test_missiles() { enable_missile_safety_mode(); // diagnoses @@ -2641,23 +2641,23 @@ used to process multiple arguments from a single invocation from a SIMD loop concurrently. The syntax of the `declare simd` construct is as follows: - .. code-block:: c + .. code-block:: none - #pragma omp declare simd [clause[[,] clause] ...] new-line - [#pragma omp declare simd [clause[[,] clause] ...] new-line] - [...] - function definition or declaration + #pragma omp declare simd [clause[[,] clause] ...] new-line + [#pragma omp declare simd [clause[[,] clause] ...] new-line] + [...] + function definition or declaration where clause is one of the following: - .. code-block:: c + .. code-block:: none - simdlen(length) - linear(argument-list[:constant-linear-step]) - aligned(argument-list[:alignment]) - uniform(argument-list) - inbranch - notinbranch + simdlen(length) + linear(argument-list[:constant-linear-step]) + aligned(argument-list[:alignment]) + uniform(argument-list) + inbranch + notinbranch }]; } @@ -2673,9 +2673,9 @@ The syntax of the declare target directive is as follows: .. code-block:: c - #pragma omp declare target new-line - declarations-definition-seq - #pragma omp end declare target new-line + #pragma omp declare target new-line + declarations-definition-seq + #pragma omp end declare target new-line }]; } diff --git a/lib/Basic/Version.cpp b/lib/Basic/Version.cpp index 2dd16da9910..580bd94ccbe 100644 --- a/lib/Basic/Version.cpp +++ b/lib/Basic/Version.cpp @@ -36,7 +36,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_60/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_600/final/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); From f0d24653c11c321b090f5fce1fef226689eb7930 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 4 Mar 2018 15:07:16 +0000 Subject: [PATCH 3/3] Vendor import of lld 6.0.0 release r326565: https://llvm.org/svn/llvm-project/lld/tags/RELEASE_600/final@326565 --- docs/ReleaseNotes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst index d07ce1cd85f..ede0b2dcc5d 100644 --- a/docs/ReleaseNotes.rst +++ b/docs/ReleaseNotes.rst @@ -57,7 +57,7 @@ ELF Improvements * lld can now identify and patch a code sequence that triggers AArch64 errata 843419. Add ``--fix-cortex-a53-843419`` to enable the feature. -* lld can now generate thunks for out of range thunks. +* lld can now generate thunks for out of range branches. * MIPS port now generates all output dynamic relocations using Elf_Rel format only.