diff options
Diffstat (limited to 'docs/ReleaseNotes.rst')
-rw-r--r-- | docs/ReleaseNotes.rst | 322 |
1 files changed, 155 insertions, 167 deletions
diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst index 886271c40ab5e..badb2737dae39 100644 --- a/docs/ReleaseNotes.rst +++ b/docs/ReleaseNotes.rst @@ -1,6 +1,6 @@ -======================= -Clang 3.8 Release Notes -======================= +===================================== +Clang 3.9 (In-Progress) Release Notes +===================================== .. contents:: :local: @@ -8,15 +8,21 @@ Clang 3.8 Release Notes Written by the `LLVM Team <http://llvm.org/>`_ +.. warning:: + + These are in-progress notes for the upcoming Clang 3.9 release. You may + prefer the `Clang 3.8 Release Notes + <http://llvm.org/releases/3.8.0/tools/clang/docs/ReleaseNotes.html>`_. + Introduction ============ This document contains the release notes for the Clang C/C++/Objective-C -frontend, part of the LLVM Compiler Infrastructure, release 3.8. Here we +frontend, part of the LLVM Compiler Infrastructure, release 3.9. Here we describe the status of Clang in some detail, including major improvements from the previous release and new feature work. For the general LLVM release notes, see `the LLVM -documentation <../../../docs/ReleaseNotes.html>`_. All LLVM +documentation <http://llvm.org/docs/ReleaseNotes.html>`_. All LLVM releases may be downloaded from the `LLVM releases web site <http://llvm.org/releases/>`_. @@ -25,7 +31,12 @@ the latest release, please check out the main please see the `Clang Web Site <http://clang.llvm.org>`_ or the `LLVM Web Site <http://llvm.org>`_. -What's New in Clang 3.8? +Note that if you are reading this file from a Subversion checkout or the +main Clang web page, this document applies to the *next* release, not +the current one. To see the release notes for a specific release, please +see the `releases page <http://llvm.org/releases/>`_. + +What's New in Clang 3.9? ======================== Some of the major new features and improvements to Clang are listed @@ -33,230 +44,207 @@ 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 +------------------ + +- Clang will no longer passes --build-id by default to the linker. In modern + linkers that is a relatively expensive option. It can be passed explicitly + with -Wl,--build-id. To have clang always pass it, build clang with + -DENABLE_LINKER_BUILD_ID. +- On Itanium ABI targets, attribute abi_tag is now supported for compatibility + with GCC. Clang implementation of abi_tag is mostly compatible with GCC ABI + version 10. + Improvements to Clang's diagnostics ------------------------------------ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Clang's diagnostics are constantly being improved to catch more issues, explain them more clearly, and provide more accurate source information -about them. The improvements since the 3.7 release include: +about them. The improvements since the 3.8 release include: -- ``-Wmicrosoft`` has been split into many targeted flags, so that projects can - choose to enable only a subset of these warnings. ``-Wno-microsoft`` still - disables all these warnings, and ``-Wmicrosoft`` still enables them all. +- ... New Compiler Flags ------------------ -Clang can "tune" DWARF debugging information to suit one of several different -debuggers. This fine-tuning can mean omitting DWARF features that the -debugger does not need or use, or including DWARF extensions specific to the -debugger. Clang supports tuning for three debuggers, as follows. +The option .... + + +New Pragmas in Clang +----------------------- + +Clang now supports the ... + + +Attribute Changes in Clang +-------------------------- -- ``-ggdb`` is equivalent to ``-g`` plus tuning for the GDB debugger. For - compatibility with GCC, Clang allows this option to be followed by a - single digit from 0 to 3 indicating the debugging information "level." - For example, ``-ggdb1`` is equivalent to ``-ggdb -g1``. +- The ``nodebug`` attribute may now be applied to static, global, and local + variables (but not parameters or non-static data members). This will suppress + all debugging information for the variable (and its type, if there are no + other uses of the type). -- ``-glldb`` is equivalent to ``-g`` plus tuning for the LLDB debugger. -- ``-gsce`` is equivalent to ``-g`` plus tuning for the Sony Computer - Entertainment debugger. +Windows Support +--------------- -Specifying ``-g`` without a tuning option will use a target-dependent default. +Clang's support for building native Windows programs ... -The new ``-fstrict-vtable-pointers`` flag enables better devirtualization -support (experimental). +TLS is enabled for Cygwin defaults to -femulated-tls. C Language Changes in Clang --------------------------- +The -faltivec and -maltivec flags no longer silently include altivec.h on Power platforms. -Better support for ``__builtin_object_size`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +`RenderScript +<https://developer.android.com/guide/topics/renderscript/compute.html>`_ +support added to the Frontend and enabled by the '-x renderscript' option or +the '.rs' file extension. -Clang 3.8 has expanded support for the ``__builtin_object_size`` intrinsic. -Specifically, ``__builtin_object_size`` will now fail less often when you're -trying to get the size of a subobject. Additionally, the ``pass_object_size`` -attribute was added, which allows ``__builtin_object_size`` to successfully -report the size of function parameters, without requiring that the function be -inlined. +... +C11 Feature Support +^^^^^^^^^^^^^^^^^^^ -``overloadable`` attribute relaxations -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... -Previously, functions marked ``overloadable`` in C would strictly use C++'s -type conversion rules, so the following code would not compile: +C++ Language Changes in Clang +----------------------------- -.. code-block:: c +- Clang now enforces the rule that a *using-declaration* cannot name an enumerator of a + scoped enumeration. - void foo(char *bar, char *baz) __attribute__((overloadable)); - void foo(char *bar) __attribute__((overloadable)); + .. code-block:: c++ - void callFoo() { - int a; - foo(&a); - } + namespace Foo { enum class E { e }; } + namespace Bar { + using Foo::E::e; // error + constexpr auto e = Foo::E::e; // ok + } -Now, Clang is able to selectively use C's type conversion rules during overload -resolution in C, which allows the above example to compile (albeit potentially -with a warning about an implicit conversion from ``int*`` to ``char*``). +- Clang now enforces the rule that an enumerator of an unscoped enumeration declared at + class scope can only be named by a *using-declaration* in a derived class. -OpenCL C Language Changes in Clang ----------------------------------- + .. code-block:: c++ + + class Foo { enum E { e }; } + using Foo::e; // error + static constexpr auto e = Foo::e; // ok -Several OpenCL 2.0 features have been added, including: +... -- Command-line option ``-std=CL2.0``. +C++1z Feature Support +^^^^^^^^^^^^^^^^^^^^^ -- Generic address space (``__generic``) along with new conversion rules - between different address spaces and default address space deduction. +Clang's experimental support for the upcoming C++1z standard can be enabled with ``-std=c++1z``. +Changes to C++1z features since Clang 3.8: -- Support for program scope variables with ``__global`` address space. +- The ``[[fallthrough]]``, ``[[nodiscard]]``, and ``[[maybe_unused]]`` attributes are + supported in C++11 onwards, and are largely synonymous with Clang's existing attributes + ``[[clang::fallthrough]]``, ``[[gnu::warn_unused_result]]``, and ``[[gnu::unused]]``. + Use ``-Wimplicit-fallthrough`` to warn on unannotated fallthrough within ``switch`` + statements. -- Pipe specifier was added (although no pipe functions are supported yet). +- In C++1z mode, aggregate initialization can be performed for classes with base classes: -- Atomic types: ``atomic_int``, ``atomic_uint``, ``atomic_long``, - ``atomic_ulong``, ``atomic_float``, ``atomic_double``, ``atomic_flag``, - ``atomic_intptr_t``, ``atomic_uintptr_t``, ``atomic_size_t``, - ``atomic_ptrdiff_t`` and their usage with C11 style builtin functions. + .. code-block:: c++ -- Image types: ``image2d_depth_t``, ``image2d_array_depth_t``, - ``image2d_msaa_t``, ``image2d_array_msaa_t``, ``image2d_msaa_depth_t``, - ``image2d_array_msaa_depth_t``. + struct A { int n; }; + struct B : A { int x, y; }; + B b = { 1, 2, 3 }; // b.n == 1, b.x == 2, b.y == 3 -- Other types (for pipes and device side enqueue): ``clk_event_t``, - ``queue_t``, ``ndrange_t``, ``reserve_id_t``. +- The range in a range-based ``for`` statement can have different types for its ``begin`` + and ``end`` iterators. This is permitted as an extension in C++11 onwards. -Several additional features/bugfixes have been added to the previous standards: +- Lambda-expressions can explicitly capture ``*this`` (to capture the surrounding object + by copy). This is permitted as an extension in C++11 onwards. -- A set of floating point arithmetic relaxation flags: ``-cl-no-signed-zeros``, - ``-cl-unsafe-math-optimizations``, ``-cl-finite-math-only``, - ``-cl-fast-relaxed-math``. +- Objects of enumeration type can be direct-list-initialized from a value of the underlying + type. ``E{n}`` is equivalent to ``E(n)``, except that it implies a check for a narrowing + conversion. -- Added ``^^`` to the list of reserved operations. +- Unary *fold-expression*\s over an empty pack are now rejected for all operators + other than ``&&``, ``||``, and ``,``. -- Improved vector support and diagnostics. +... -- Improved diagnostics for function pointers. +Objective-C Language Changes in Clang +------------------------------------- + +... + +OpenCL C Language Changes in Clang +---------------------------------- + +... OpenMP Support in Clang ------------------------ +---------------------------------- + +Added support for all non-offloading features from OpenMP 4.5, including using +data members in private clauses of non-static member functions. Additionally, +data members can be used as loop control variables in loop-based directives. -OpenMP 3.1 is fully supported and is enabled by default with ``-fopenmp`` -which now uses the Clang OpenMP library instead of the GCC OpenMP library. -The runtime can be built in-tree. - -In addition to OpenMP 3.1, several important elements of the OpenMP 4.0/4.5 -are supported as well. We continue to aim to complete OpenMP 4.5 - -- ``map`` clause -- task dependencies -- ``num_teams`` clause -- ``thread_limit`` clause -- ``target`` and ``target data`` directive -- ``target`` directive with implicit data mapping -- ``target enter data`` and ``target exit data`` directive -- Array sections [2.4, Array Sections]. -- Directive name modifiers for ``if`` clause [2.12, if Clause]. -- ``linear`` clause can be used in loop-based directives [2.7.2, loop Construct]. -- ``simdlen`` clause [2.8, SIMD Construct]. -- ``hint`` clause [2.13.2, critical Construct]. -- Parsing/semantic analysis of all non-device directives introduced in OpenMP 4.5. - -The codegen for OpenMP constructs was significantly improved allowing us to produce much more stable and fast code. -Full test cases of IR are also implemented. - -CUDA Support in Clang ---------------------- -Clang has experimental support for end-to-end CUDA compilation now: - -- The driver now detects CUDA installation, creates host and device compilation - pipelines, links device-side code with appropriate CUDA bitcode and produces - single object file with host and GPU code. - -- Implemented target attribute-based function overloading which allows Clang to - compile CUDA sources without splitting them into separate host/device TUs. +Currently Clang supports OpenMP 3.1 and all non-offloading features of +OpenMP 4.0/4.5. Offloading features are under development. Clang defines macro +_OPENMP and sets it to OpenMP 3.1 (in accordance with OpenMP standard) by +default. User may change this value using ``-fopenmp-version=[31|40|45]`` option. + +The codegen for OpenMP constructs was significantly improved to produce much +more stable and faster code. Internal API Changes -------------------- -These are major API changes that have happened since the 3.7 release of +These are major API changes that have happened since the 3.8 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. -* With this release, the autoconf build system is deprecated. It will be removed - in the 3.9 release. Please migrate to using CMake. For more information see: - `Building LLVM with CMake <http://llvm.org/docs/CMake.html>`_ +- ... AST Matchers ------------ -The AST matcher functions were renamed to reflect the exact AST node names, -which is a breaking change to AST matching code. The following matchers were -affected: - -======================= ============================ -Previous Matcher Name New Matcher Name -======================= ============================ -recordDecl recordDecl and cxxRecordDecl -ctorInitializer cxxCtorInitializer -constructorDecl cxxConstructorDecl -destructorDecl cxxDestructorDecl -methodDecl cxxMethodDecl -conversionDecl cxxConversionDecl -memberCallExpr cxxMemberCallExpr -constructExpr cxxConstructExpr -unresolvedConstructExpr cxxUnresolvedConstructExpr -thisExpr cxxThisExpr -bindTemporaryExpr cxxBindTemporaryExpr -newExpr cxxNewExpr -deleteExpr cxxDeleteExpr -defaultArgExpr cxxDefaultArgExpr -operatorCallExpr cxxOperatorCallExpr -forRangeStmt cxxForRangeStmt -catchStmt cxxCatchStmt -tryStmt cxxTryStmt -throwExpr cxxThrowExpr -boolLiteral cxxBoolLiteral -nullPtrLiteralExpr cxxNullPtrLiteralExpr -reinterpretCastExpr cxxReinterpretCastExpr -staticCastExpr cxxStaticCastExpr -dynamicCastExpr cxxDynamicCastExpr -constCastExpr cxxConstCastExpr -functionalCastExpr cxxFunctionalCastExpr -temporaryObjectExpr cxxTemporaryObjectExpr -CUDAKernalCallExpr cudaKernelCallExpr -======================= ============================ - -recordDecl() previously matched AST nodes of type CXXRecordDecl, but now -matches AST nodes of type RecordDecl. If a CXXRecordDecl is required, use the -cxxRecordDecl() matcher instead. +- has and hasAnyArgument: Matchers no longer ignores parentheses and implicit + casts on the argument before applying the inner matcher. The fix was done to + allow for greater control by the user. In all existing checkers that use this + matcher all instances of code ``hasAnyArgument(<inner matcher>)`` or + ``has(<inner matcher>)`` must be changed to + ``hasAnyArgument(ignoringParenImpCasts(<inner matcher>))`` or + ``has(ignoringParenImpCasts(<inner matcher>))``. + +... + +libclang +-------- + +... Static Analyzer --------------- -The scan-build and scan-view tools will now be installed with Clang. Use these -tools to run the static analyzer on projects and view the produced results. +... + +Core Analysis Improvements +========================== + +- ... + +New Issues Found +================ + +- ... -Static analysis of C++ lambdas has been greatly improved, including -interprocedural analysis of lambda applications. +Python Binding Changes +---------------------- -Several new checks were added: +The following methods have been added: -- The analyzer now checks for misuse of ``vfork()``. -- The analyzer can now detect excessively-padded structs. This check can be - enabled by passing the following command to scan-build: - ``-enable-checker optin.performance.Padding``. -- The checks to detect misuse of ``_Nonnull`` type qualifiers as well as checks - to detect misuse of Objective-C generics were added. -- The analyzer now has opt in checks to detect localization errors in Cocoa - applications. The checks warn about uses of non-localized ``NSStrings`` - passed to UI methods expecting localized strings and on ``NSLocalizedString`` - macros that are missing the comment argument. These can be enabled by passing - the following command to scan-build: - ``-enable-checker optin.osx.cocoa.localizability``. +- ... +Significant Known Problems +========================== Additional Information ====================== |