diff options
| author | 2017-03-14 08:07:52 +0000 | |
|---|---|---|
| committer | 2017-03-14 08:07:52 +0000 | |
| commit | 1cb66ada17adf0954eaadba4d02ec2470365a3ac (patch) | |
| tree | 521159d8f39562a43fffd680147eb5a71709b9b1 /gnu/llvm/tools/clang/docs | |
| parent | Mark the sshd_config UsePrivilegeSeparation option as deprecated, (diff) | |
| download | wireguard-openbsd-1cb66ada17adf0954eaadba4d02ec2470365a3ac.tar.xz wireguard-openbsd-1cb66ada17adf0954eaadba4d02ec2470365a3ac.zip | |
Import LLVM 4.0.0 release including clang and lld.
Diffstat (limited to 'gnu/llvm/tools/clang/docs')
| -rw-r--r-- | gnu/llvm/tools/clang/docs/AutomaticReferenceCounting.rst | 7 | ||||
| -rw-r--r-- | gnu/llvm/tools/clang/docs/LanguageExtensions.rst | 40 | ||||
| -rw-r--r-- | gnu/llvm/tools/clang/docs/ReleaseNotes.rst | 182 | ||||
| -rw-r--r-- | gnu/llvm/tools/clang/docs/UsersManual.rst | 39 | ||||
| -rw-r--r-- | gnu/llvm/tools/clang/docs/conf.py | 4 |
5 files changed, 165 insertions, 107 deletions
diff --git a/gnu/llvm/tools/clang/docs/AutomaticReferenceCounting.rst b/gnu/llvm/tools/clang/docs/AutomaticReferenceCounting.rst index aa2a28399d1..fbd1ba4c4d4 100644 --- a/gnu/llvm/tools/clang/docs/AutomaticReferenceCounting.rst +++ b/gnu/llvm/tools/clang/docs/AutomaticReferenceCounting.rst @@ -2258,16 +2258,13 @@ non-block type [*]_. Equivalent to the following code: .. code-block:: objc - id objc_storeStrong(id *object, id value) { - value = [value retain]; + void objc_storeStrong(id *object, id value) { id oldValue = *object; + value = [value retain]; *object = value; [oldValue release]; - return value; } -Always returns ``value``. - .. [*] This does not imply that a ``__strong`` object of block type is an invalid argument to this function. Rather it implies that an ``objc_retain`` and not an ``objc_retainBlock`` operation will be emitted if the argument is diff --git a/gnu/llvm/tools/clang/docs/LanguageExtensions.rst b/gnu/llvm/tools/clang/docs/LanguageExtensions.rst index 64e6ffb7f3e..885ad579ba7 100644 --- a/gnu/llvm/tools/clang/docs/LanguageExtensions.rst +++ b/gnu/llvm/tools/clang/docs/LanguageExtensions.rst @@ -1776,6 +1776,46 @@ numeric primitives such as frexp. See `LLVM canonicalize intrinsic <http://llvm.org/docs/LangRef.html#llvm-canonicalize-intrinsic>`_ for more information on the semantics. +String builtins +--------------- + +Clang provides constant expression evaluation support for builtins forms of +the following functions from the C standard library ``<strings.h>`` header: + +* ``memchr`` +* ``memcmp`` +* ``strchr`` +* ``strcmp`` +* ``strlen`` +* ``strncmp`` +* ``wcschr`` +* ``wcscmp`` +* ``wcslen`` +* ``wcsncmp`` +* ``wmemchr`` +* ``wmemcmp`` + +In each case, the builtin form has the name of the C library function prefixed +by ``__builtin_``. Example: + +.. code-block:: c + + void *p = __builtin_memchr("foobar", 'b', 5); + +In addition to the above, one further builtin is provided: + +.. code-block:: c + + char *__builtin_char_memchr(const char *haystack, int needle, size_t size); + +``__builtin_char_memchr(a, b, c)`` is identical to +``(char*)__builtin_memchr(a, b, c)`` except that its use is permitted within +constant expressions in C++11 onwards (where a cast from ``void*`` to ``char*`` +is disallowed in general). + +Support for constant expression evaluation for the above builtins be detected +with ``__has_feature(cxx_constexpr_string_builtins)``. + .. _langext-__c11_atomic: __c11_atomic builtins diff --git a/gnu/llvm/tools/clang/docs/ReleaseNotes.rst b/gnu/llvm/tools/clang/docs/ReleaseNotes.rst index 25ea577ba51..3278bcc0338 100644 --- a/gnu/llvm/tools/clang/docs/ReleaseNotes.rst +++ b/gnu/llvm/tools/clang/docs/ReleaseNotes.rst @@ -1,6 +1,6 @@ -======================================= -Clang 4.0.0 (In-Progress) Release Notes -======================================= +========================= +Clang 4.0.0 Release Notes +========================= .. contents:: :local: @@ -8,16 +8,10 @@ Clang 4.0.0 (In-Progress) Release Notes Written by the `LLVM Team <http://llvm.org/>`_ -.. warning:: - - These are in-progress notes for the upcoming Clang 4.0.0 release. You may - prefer the `Clang 3.9 Release Notes - <http://llvm.org/releases/3.9.0/tools/clang/docs/ReleaseNotes.html>`_. - Introduction ============ -This document contains the release notes for the Clang C/C++/Objective-C +This document contains the release notes for the Clang C/C++/Objective-C/OpenCL frontend, part of the LLVM Compiler Infrastructure, release 4.0.0. Here we describe the status of Clang in some detail, including major improvements from the previous release and new feature work. For the @@ -42,7 +36,8 @@ sections with improvements to Clang's support for those languages. Major New Features ------------------ -- The ``diagnose_if`` attribute has been added to clang. This attribute allows +- The `diagnose_if <AttributeReference.html#diagnose-if>`_ attribute has been + added to clang. This attribute allows clang to emit a warning or error if a function call meets one or more user-specified conditions. @@ -65,134 +60,123 @@ Major New Features } -- ... - Improvements to ThinLTO (-flto=thin) ------------------------------------ - Integration with profile data (PGO). When available, profile data enables more accurate function importing decisions, as well as cross-module indirect call promotion. - Significant build-time and binary-size improvements when compiling with debug - info (-g). - -Improvements to Clang's diagnostics -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -- ... + info (``-g``). New Compiler Flags ------------------ -The option -Og has been added to optimize the debugging experience. -For now, this option is exactly the same as -O1. However, in the future, -some other optimizations might be enabled or disabled. - -The option -MJ has been added to simplify adding JSON compilation -database output into existing build systems. - -The option .... - -New Pragmas in Clang ------------------------ - -Clang now supports the ... - - -Attribute Changes in Clang --------------------------- - -- ... - -Windows Support ---------------- - -Clang's support for building native Windows programs ... - +- The option ``-Og`` has been added to optimize the debugging experience. + For now, this option is exactly the same as ``-O1``. However, in the future, + some other optimizations might be enabled or disabled. -C Language Changes in Clang ---------------------------- +- The option ``-MJ`` has been added to simplify adding JSON compilation + database output into existing build systems. -- ... -... - -C11 Feature Support -^^^^^^^^^^^^^^^^^^^ - -... +OpenCL C Language Changes in Clang +---------------------------------- -C++ Language Changes in Clang ------------------------------ +**The following bugs in the OpenCL header have been fixed:** -... +* Added missing ``overloadable`` and ``convergent`` attributes. +* Removed some erroneous extra ``native_*`` functions. -C++1z Feature Support -^^^^^^^^^^^^^^^^^^^^^ +**The following bugs in the generation of metadata have been fixed:** -... +* Corrected the SPIR version depending on the OpenCL version. +* Source level address spaces are taken from the SPIR specification. +* Image types now contain no access qualifier. -Objective-C Language Changes in Clang -------------------------------------- +**The following bugs in the AMD target have been fixed:** -... +* Corrected the bitwidth of ``size_t`` and NULL pointer value with respect to + address spaces. +* Added ``cl_khr_subgroups``, ``cl_amd_media_ops`` and ``cl_amd_media_ops2`` + extensions. +* Added ``cl-denorms-are-zero`` support. +* Changed address spaces for image objects to be ``constant``. +* Added little-endian. -OpenCL C Language Changes in Clang ----------------------------------- +**The following bugs in OpenCL 2.0 have been fixed:** -... +* Fixed pipe builtin function return type, added extra argument to generated + IR intrinsics to propagate size and alignment information of the pipe packed + type. +* Improved pipe type to accommodate access qualifiers. +* Added correct address space to the ObjC block generation and ``enqueue_kernel`` + prototype. +* Improved handling of integer parameters of ``enqueue_kernel`` prototype. We + now allow ``size_t`` instead of ``int`` for specifying block parameter sizes. +* Allow using NULL (aka ``CLK_NULL_QUEUE``) with ``queue_t``. -OpenMP Support in Clang ----------------------------------- -... +**Improved the following diagnostics:** -Internal API Changes --------------------- +* Disallow address spaces other than ``global`` for kernel pointer parameters. +* Correct the use of half type argument and pointer assignment with + dereferencing. +* Disallow variadic arguments in functions and blocks. +* Allow partial initializer for array and struct. -These are major API changes that have happened since the 3.9 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. +**Some changes to OpenCL extensions have been made:** -- ... +* Added ``cl_khr_mipmap_image``. +* Added ``-cl-ext`` flag to allow overwriting supported extensions otherwise + set by the target compiled for (Example: ``-cl-ext=-all,+cl_khr_fp16``). +* New types and functions can now be flexibly added to extensions using the + following pragmas instead of modifying the Clang source code: -AST Matchers ------------- + .. code-block:: c -... + #pragma OPENCL EXTENSION the_new_extension_name : begin + // declare types and functions associated with the extension here + #pragma OPENCL EXTENSION the_new_extension_name : end -libclang --------- -... +**Miscellaneous changes:** -With the option --show-description, scan-build's list of defects will also -show the description of the defects. +* Fix ``__builtin_astype`` to cast between different address space objects. +* Allow using ``opencl_unroll_hint`` with earlier OpenCL versions than 2.0. +* Improved handling of floating point literal to default to single precision if + fp64 extension is not enabled. +* Refactor ``sampler_t`` implementation to simplify initializer representation + which is now handled as a compiler builtin function with an integer value + passed into it. +* Change fake address space map to use the SPIR convention. +* Added `the OpenCL manual <UsersManual.html#opencl-features>`_ to Clang + documentation. Static Analyzer --------------- -... - -Core Analysis Improvements -========================== - -- ... - -New Issues Found -================ - -- ... +With the option ``--show-description``, scan-build's list of defects will also +show the description of the defects. -Python Binding Changes ----------------------- +The analyzer now provides better support of code that uses gtest. -The following methods have been added: +Several new checks were added: -- ... +- The analyzer warns when virtual calls are made from constructors or + destructors. This check is off by default but can be enabled by passing the + following command to scan-build: ``-enable-checker optin.cplusplus.VirtualCall``. +- The analyzer checks for synthesized copy properties of mutable types in + Objective C, such as ``NSMutableArray``. Calling the setter for these properties + will store an immutable copy of the value. +- The analyzer checks for calls to ``dispatch_once()`` that use an Objective-C + instance variable as the predicate. Using an instance variable as a predicate + may result in the passed-in block being executed multiple times or not at all. + These calls should be rewritten either to use a lock or to store the predicate + in a global or static variable. +- The analyzer checks for unintended comparisons of ``NSNumber``, ``CFNumberRef``, and + other Cocoa number objects to scalar values. -Significant Known Problems -========================== Additional Information ====================== diff --git a/gnu/llvm/tools/clang/docs/UsersManual.rst b/gnu/llvm/tools/clang/docs/UsersManual.rst index 04023dd2060..6c8355776b7 100644 --- a/gnu/llvm/tools/clang/docs/UsersManual.rst +++ b/gnu/llvm/tools/clang/docs/UsersManual.rst @@ -2056,6 +2056,8 @@ can be given manually. In this case the kernel code should contain ``#include <opencl-c.h>`` just as a regular C include. +.. _opencl_cl_ext: + .. option:: -cl-ext Disables support of OpenCL extensions. All OpenCL targets provide a list @@ -2177,6 +2179,41 @@ To enable modules for OpenCL: $ clang -target spir-unknown-unknown -c -emit-llvm -Xclang -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=<path to the generated module> test.cl +OpenCL Extensions +----------------- + +All of the ``cl_khr_*`` extensions from `the official OpenCL specification +<https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/EXTENSION.html>`_ +up to and including version 2.0 are available and set per target depending on the +support available in the specific architecture. + +It is possible to alter the default extensions setting per target using +``-cl-ext`` flag. (See :ref:`flags description <opencl_cl_ext>` for more details). + +Vendor extensions can be added flexibly by declaring the list of types and +functions associated with each extensions enclosed within the following +compiler pragma directives: + + .. code-block:: c + + #pragma OPENCL EXTENSION the_new_extension_name : begin + // declare types and functions associated with the extension here + #pragma OPENCL EXTENSION the_new_extension_name : end + +For example, parsing the following code adds ``my_t`` type and ``my_func`` +function to the custom ``my_ext`` extension. + + .. code-block:: c + + #pragma OPENCL EXTENSION my_ext : begin + typedef struct{ + int a; + }my_t; + void my_func(my_t); + #pragma OPENCL EXTENSION my_ext : end + +Declaring the same types in different vendor extensions is disallowed. + OpenCL Metadata --------------- @@ -2215,7 +2252,7 @@ does not have any effect on the IR. For more details reffer to the specification <https://www.khronos.org/registry/cl/specs/opencl-2.0-openclc.pdf#49>`_ -opencl_hint_unroll +opencl_unroll_hint ^^^^^^^^^^^^^^^^^^ The implementation of this feature mirrors the unroll hint for C. diff --git a/gnu/llvm/tools/clang/docs/conf.py b/gnu/llvm/tools/clang/docs/conf.py index 4683ca567ec..9cf8d377295 100644 --- a/gnu/llvm/tools/clang/docs/conf.py +++ b/gnu/llvm/tools/clang/docs/conf.py @@ -49,9 +49,9 @@ copyright = u'2007-%d, The Clang Team' % date.today().year # built documents. # # The short X.Y version. -version = '4.0' +version = '4' # The full version, including alpha/beta/rc tags. -release = '4.0' +release = '4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. |
