aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-03-04 15:06:36 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-03-04 15:06:36 +0000
commit5c8694c6ce76fdf2c8630f569e375cf343894dab (patch)
tree66345079da8a47fd9009393584f12ffad806b9cf
parent93179bb90b8042f256bd2adc00b7e39ef42869c4 (diff)
downloadsrc-5c8694c6ce76fdf2c8630f569e375cf343894dab.tar.gz
src-5c8694c6ce76fdf2c8630f569e375cf343894dab.zip
Vendor import of clang 6.0.0 release r326565:vendor/clang/clang-release_600-r326565
Notes
Notes: svn path=/vendor/clang/dist-release_60/; revision=330377 svn path=/vendor/clang/clang-release_600-r326565/; revision=330378; tag=vendor/clang/clang-release_600-r326565
-rw-r--r--docs/AttributeReference.rst38
-rw-r--r--docs/ReleaseNotes.rst247
-rw-r--r--include/clang/Basic/AttrDocs.td40
-rw-r--r--lib/Basic/Version.cpp2
4 files changed, 151 insertions, 176 deletions
diff --git a/docs/AttributeReference.rst b/docs/AttributeReference.rst
index 26965e4cd737..d0e02fa72b33 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 521ab9ba135c..d817907e2230 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 <https://support.google.com/faqs/answer/7625886>`_
+ was added to help mitigate "branch target injection" (variant #2) of the
+ "Spectre" speculative side channels described by `Project Zero
+ <https://googleprojectzero.blogspot.com/2018/01/reading-privileged-memory-with-side.html>`_
+ and the `Spectre paper <https://spectreattack.com/spectre.pdf>`_.
+
+- 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
+ <https://support.google.com/faqs/answer/7625886>`_. 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 <UsersManual.html#configuration-files>`_.
- 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 <AttributeReference.html>`_ 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
- <http://clang.llvm.org/docs/UsersManual.html#configuration-files>`.
+- 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.
+
+ - Recognition of the ``<=>`` token (the C++2a three-way comparison operator).
+
+ - Support for default member initializers for bit-fields.
-...
+ - Lambda capture of ``*this``.
-Objective-C Language Changes in Clang
--------------------------------------
+ - 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
+ <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0722r1.html>`,
+ 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 <https://bugs.llvm.org/>`_ or send a message to the
`OpenMP development list <http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev>`_.
-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 <lib/main.h> | | #include <lib/main.h> |
+-------------------------+-------------------------+-------------------------+
-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 ecff329c4ccb..dc355832b875 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 2dd16da99104..580bd94ccbef 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"));