Commit 7ab7b979 authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Bump the trunk major version to 12

and clear the release notes.
parent 2e10b7a3
Loading
Loading
Loading
Loading
+5 −185
Original line number Diff line number Diff line
====================================================
Extra Clang Tools 11.0.0 (In-Progress) Release Notes
Extra Clang Tools 12.0.0 (In-Progress) Release Notes
====================================================

.. contents::
@@ -10,7 +10,7 @@ Written by the `LLVM Team <https://llvm.org/>`_

.. warning::

   These are in-progress notes for the upcoming Extra Clang Tools 11 release.
   These are in-progress notes for the upcoming Extra Clang Tools 12 release.
   Release notes for previous releases can be found on
   `the Download Page <https://releases.llvm.org/download.html>`_.

@@ -18,7 +18,7 @@ Introduction
============

This document contains the release notes for the Extra Clang Tools, part of the
Clang release 11.0.0. Here we describe the status of the Extra Clang Tools in
Clang release 12.0.0. Here we describe the status of the Extra Clang Tools in
some detail, including major improvements from the previous release and new
feature work. All LLVM releases may be downloaded from the `LLVM releases web
site <https://llvm.org/releases/>`_.
@@ -32,7 +32,7 @@ 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 <https://llvm.org/releases/>`_.

What's New in Extra Clang Tools 11.0.0?
What's New in Extra Clang Tools 12.0.0?
=======================================

Some of the major new features and improvements to Extra Clang Tools are listed
@@ -67,187 +67,7 @@ The improvements are...
Improvements to clang-tidy
--------------------------

New module
^^^^^^^^^^
- New module `llvmlibc`.

  This module contains checks related to the LLVM-libc coding standards.

New checks
^^^^^^^^^^

- New :doc:`abseil-string-find-str-contains
  <clang-tidy/checks/abseil-string-find-str-contains>` check.

  Finds ``s.find(...) == string::npos`` comparisons (for various string-like types)
  and suggests replacing with ``absl::StrContains()``.

- New :doc:`cppcoreguidelines-avoid-non-const-global-variables
  <clang-tidy/checks/cppcoreguidelines-avoid-non-const-global-variables>` check.
  Finds non-const global variables as described in check I.2 of C++ Core
  Guidelines.

- New :doc:`bugprone-misplaced-pointer-arithmetic-in-alloc
  <clang-tidy/checks/bugprone-misplaced-pointer-arithmetic-in-alloc>` check.

  Finds cases where an integer expression is added to or subtracted from the
  result of a memory allocation function (``malloc()``, ``calloc()``,
  ``realloc()``, ``alloca()``) instead of its argument.

- New :doc:`bugprone-no-escape
  <clang-tidy/checks/bugprone-no-escape>` check.

  Finds pointers with the ``noescape`` attribute that are captured by an
  asynchronously-executed block.

- New :doc:`bugprone-spuriously-wake-up-functions
  <clang-tidy/checks/bugprone-spuriously-wake-up-functions>` check.

  Finds ``cnd_wait``, ``cnd_timedwait``, ``wait``, ``wait_for``, or
  ``wait_until`` function calls when the function is not invoked from a loop
  that checks whether a condition predicate holds or the function has a
  condition parameter.

- New :doc:`bugprone-reserved-identifier
  <clang-tidy/checks/bugprone-reserved-identifier>` check.

  Checks for usages of identifiers reserved for use by the implementation.

- New :doc:`bugprone-suspicious-include
  <clang-tidy/checks/bugprone-suspicious-include>` check.

  Finds cases where an include refers to what appears to be an implementation
  file, which often leads to hard-to-track-down ODR violations, and diagnoses
  them.

- New :doc:`cert-oop57-cpp
  <clang-tidy/checks/cert-oop57-cpp>` check.

  Flags use of the `C` standard library functions ``memset``, ``memcpy`` and
  ``memcmp`` and similar derivatives on non-trivial types.

- New :doc:`llvmlibc-callee-namespace
  <clang-tidy/checks/llvmlibc-callee-namespace>` check.

  Checks all calls resolve to functions within ``__llvm_libc`` namespace.

- New :doc:`llvmlibc-implementation-in-namespace
  <clang-tidy/checks/llvmlibc-implementation-in-namespace>` check.

  Checks all llvm-libc implementation is within the correct namespace.

- New :doc:`llvmlibc-restrict-system-libc-headers
  <clang-tidy/checks/llvmlibc-restrict-system-libc-headers>` check.

  Finds includes of system libc headers not provided by the compiler within
  llvm-libc implementations.

- New :doc:`modernize-replace-disallow-copy-and-assign-macro
  <clang-tidy/checks/modernize-replace-disallow-copy-and-assign-macro>` check.

  Finds macro expansions of ``DISALLOW_COPY_AND_ASSIGN`` and replaces them with
  a deleted copy constructor and a deleted assignment operator.

- New :doc:`objc-dealloc-in-category
  <clang-tidy/checks/objc-dealloc-in-category>` check.

  Finds implementations of -dealloc in Objective-C categories.

- New :doc:`misc-no-recursion
  <clang-tidy/checks/misc-no-recursion>` check.

  Finds recursive functions and diagnoses them.

- New :doc:`objc-nsinvocation-argument-lifetime
  <clang-tidy/checks/objc-nsinvocation-argument-lifetime>` check.

  Finds calls to ``NSInvocation`` methods under ARC that don't have proper
  argument object lifetimes.

- New :doc:`readability-use-anyofallof
  <clang-tidy/checks/readability-use-anyofallof>` check.

  Finds range-based for loops that can be replaced by a call to ``std::any_of``
  or ``std::all_of``.

New check aliases
^^^^^^^^^^^^^^^^^

- New alias :doc:`cert-con36-c
  <clang-tidy/checks/cert-con36-c>` to
  :doc:`bugprone-spuriously-wake-up-functions
  <clang-tidy/checks/bugprone-spuriously-wake-up-functions>` was added.

- New alias :doc:`cert-con54-cpp
  <clang-tidy/checks/cert-con54-cpp>` to
  :doc:`bugprone-spuriously-wake-up-functions
  <clang-tidy/checks/bugprone-spuriously-wake-up-functions>` was added.

- New alias :doc:`cert-dcl37-c
  <clang-tidy/checks/cert-dcl37-c>` to
  :doc:`bugprone-reserved-identifier
  <clang-tidy/checks/bugprone-reserved-identifier>` was added.

- New alias :doc:`cert-dcl51-cpp
  <clang-tidy/checks/cert-dcl51-cpp>` to
  :doc:`bugprone-reserved-identifier
  <clang-tidy/checks/bugprone-reserved-identifier>` was added.

- New alias :doc:`cert-str34-c
  <clang-tidy/checks/cert-str34-c>` to
  :doc:`bugprone-signed-char-misuse
  <clang-tidy/checks/bugprone-signed-char-misuse>` was added.

- New alias :doc:`llvm-else-after-return
  <clang-tidy/checks/llvm-else-after-return>` to
  :doc:`readability-else-after-return
  <clang-tidy/checks/readability-else-after-return>` was added.

Changes in existing checks
^^^^^^^^^^^^^^^^^^^^^^^^^^

- Improved :doc:`performance-faster-string-find
  <clang-tidy/checks/performance-faster-string-find>` check.

  Now checks ``std::basic_string_view`` by default.

- Improved :doc:`readability-else-after-return
  <clang-tidy/checks/readability-else-after-return>` check now supports a
  `WarnOnConditionVariables` option to control whether to refactor condition
  variables where possible.

- Improved :doc:`readability-identifier-naming
  <clang-tidy/checks/readability-identifier-naming>` check.

  Now able to rename member references in class template definitions with
  explicit access.

- Improved :doc:`readability-qualified-auto
  <clang-tidy/checks/readability-qualified-auto>` check now supports a
  `AddConstToQualified` to enable adding ``const`` qualifiers to variables
  typed with ``auto *`` and ``auto &``.

- Improved :doc:`readability-redundant-string-init
  <clang-tidy/checks/readability-redundant-string-init>` check now supports a
  `StringNames` option enabling its application to custom string classes. The
  check now detects in class initializers and constructor initializers which
  are deemed to be redundant.

- Checks supporting the ``HeaderFileExtensions`` flag now support ``;`` as a
  delimiter in addition to ``,``, with the latter being deprecated as of this
  release. This simplifies how one specifies the options on the command line:
  ``--config="{CheckOptions: [{ key: HeaderFileExtensions, value: h;;hpp;hxx }]}"``

Renamed checks
^^^^^^^^^^^^^^

- The 'fuchsia-restrict-system-headers' check was renamed to :doc:`portability-restrict-system-includes
  <clang-tidy/checks/portability-restrict-system-includes>`

Other improvements
^^^^^^^^^^^^^^^^^^

- For 'run-clang-tidy.py' add option to use alpha checkers from clang-analyzer.
The improvements are...

Improvements to include-fixer
-----------------------------
+2 −2
Original line number Diff line number Diff line
@@ -49,9 +49,9 @@ copyright = u'2007-%d, The Clang Team' % date.today().year
# built documents.
#
# The short version.
version = '11'
version = '12'
# The full version, including alpha/beta/rc tags.
release = '11'
release = '12'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
+15 −260
Original line number Diff line number Diff line
========================================
Clang 11.0.0 (In-Progress) Release Notes
Clang 12.0.0 (In-Progress) Release Notes
========================================

.. contents::
@@ -10,7 +10,7 @@ Written by the `LLVM Team <https://llvm.org/>`_

.. warning::

   These are in-progress notes for the upcoming Clang 11 release.
   These are in-progress notes for the upcoming Clang 12 release.
   Release notes for previous releases can be found on
   `the Download Page <https://releases.llvm.org/download.html>`_.

@@ -18,7 +18,7 @@ Introduction
============

This document contains the release notes for the Clang C/C++/Objective-C
frontend, part of the LLVM Compiler Infrastructure, release 11.0.0. Here we
frontend, part of the LLVM Compiler Infrastructure, release 12.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
general LLVM release notes, see `the LLVM
@@ -35,7 +35,7 @@ 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 <https://llvm.org/releases/>`_.

What's New in Clang 11.0.0?
What's New in Clang 12.0.0?
===========================

Some of the major new features and improvements to Clang are listed
@@ -51,69 +51,17 @@ Major New Features
Improvements to Clang's diagnostics
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- -Wpointer-to-int-cast is a new warning group. This group warns about C-style
  casts of pointers to a integer type too small to hold all possible values.

- -Wuninitialized-const-reference is a new warning controlled by 
  -Wuninitialized. It warns on cases where uninitialized variables are passed
  as const reference arguments to a function.
- ...

Non-comprehensive list of changes in this release
-------------------------------------------------

- For the ARM target, C-language intrinsics are now provided for the full Arm
  v8.1-M MVE instruction set. ``<arm_mve.h>`` supports the complete API defined
  in the Arm C Language Extensions.

- For the ARM target, C-language intrinsics ``<arm_cde.h>`` for the CDE
  instruction set are now provided.

- clang adds support for a set of  extended integer types (``_ExtInt(N)``) that
  permit non-power of 2 integers, exposing the LLVM integer types. Since a major
  motivating use case for these types is to limit 'bit' usage, these types don't
  automatically promote to 'int' when operations are done between two
  ``ExtInt(N)`` types, instead math occurs at the size of the largest
  ``ExtInt(N)`` type.

- Users of UBSan, PGO, and coverage on Windows will now need to add clang's
  library resource directory to their library search path. These features all
  use runtime libraries, and Clang provides these libraries in its resource
  directory. For example, if LLVM is installed in ``C:\Program Files\LLVM``,
  then the profile runtime library will appear at
  ``C:\Program Files\LLVM\lib\clang\11.0.0\lib\windows\clang_rt.profile-x86_64.lib``.
  To ensure that the linker can find the appropriate library, users should pass
  ``/LIBPATH:C:\Program Files\LLVM\lib\clang\11.0.0\lib\windows`` to the
  linker. If the user links the program with the ``clang`` or ``clang-cl``
  drivers, the driver will pass this flag for them.

- Clang's profile files generated through ``-fprofile-instr-generate`` are using
  a fixed hashing algorithm that prevents some collision when loading
  out-of-date profile informations. Clang can still read old profile files.
- ...

New Compiler Flags
------------------

- -fstack-clash-protection will provide a protection against the stack clash
  attack for x86, s390x and ppc64 architectures through automatic probing of
  each page of allocated stack.

- -ffp-exception-behavior={ignore,maytrap,strict} allows the user to specify
  the floating-point exception behavior. The default setting is ``ignore``.

- -ffp-model={precise,strict,fast} provides the user an umbrella option to
  simplify access to the many single purpose floating point options. The default
  setting is ``precise``.

- The default module cache has moved from /tmp to a per-user cache directory.
  By default, this is ~/.cache but on some platforms or installations, this
  might be elsewhere. The -fmodules-cache-path=... flag continues to work.

- -fpch-instantiate-templates tries to instantiate templates already while
  generating a precompiled header. Such templates do not need to be
  instantiated every time the precompiled header is used, which saves compile
  time. This may result in an error during the precompiled header generation
  if the source header file is not self-contained. This option is enabled
  by default for clang-cl.
- ...

Deprecated Compiler Flags
-------------------------
@@ -126,29 +74,7 @@ future versions of Clang.
Modified Compiler Flags
-----------------------

- -fno-common has been enabled as the default for all targets.  Therefore, C
  code that uses tentative definitions as definitions of a variable in multiple
  translation units will trigger multiple-definition linker errors. Generally,
  this occurs when the use of the ``extern`` keyword is neglected in the
  declaration of a variable in a header file. In some cases, no specific
  translation unit provides a definition of the variable. The previous
  behavior can be restored by specifying ``-fcommon``.
- -Wasm-ignored-qualifier (ex. `asm const ("")`) has been removed and replaced
  with an error (this matches a recent change in GCC-9).
- -Wasm-file-asm-volatile (ex. `asm volatile ("")` at global scope) has been
  removed and replaced with an error (this matches GCC's behavior).
- Duplicate qualifiers on asm statements (ex. `asm volatile volatile ("")`) no
  longer produces a warning via -Wduplicate-decl-specifier, but now an error
  (this matches GCC's behavior).
- The deprecated argument ``-f[no-]sanitize-recover`` has changed to mean
  ``-f[no-]sanitize-recover=all`` instead of
  ``-f[no-]sanitize-recover=undefined,integer`` and is no longer deprecated.
- The argument to ``-f[no-]sanitize-trap=...`` is now optional and defaults to
  ``all``.
- ``-fno-char8_t`` now disables the ``char8_t`` keyword, not just the use of
  ``char8_t`` as the character type of ``u8`` literals. This restores the
  Clang 8 behavior that regressed in Clang 9 and 10.
- -print-targets has been added to print the registered targets.
- ...

New Pragmas in Clang
--------------------
@@ -158,9 +84,7 @@ New Pragmas in Clang
Attribute Changes in Clang
--------------------------

- Attributes can now be specified by clang plugins. See the
  `Clang Plugins <ClangPlugins.html#defining-attributes>`_ documentation for
  details.
- ...

Windows Support
---------------
@@ -168,58 +92,15 @@ Windows Support
C Language Changes in Clang
---------------------------

- The default C language standard used when `-std=` is not specified has been
  upgraded from gnu11 to gnu17.

- Clang now supports the GNU C extension `asm inline`; it won't do anything
  *yet*, but it will be parsed.

- ...

C++ Language Changes in Clang
-----------------------------

- Clang now implements a restriction on giving non-C-compatible anonymous
  structs a typedef name for linkage purposes, as described in C++ committee
  paper `P1766R1 <http://wg21.link/p1766r1>`. This paper was adopted by the
  C++ committee as a Defect Report resolution, so it is applied retroactively
  to all C++ standard versions. This affects code such as:

  .. code-block:: c++

    typedef struct {
      int f() { return 0; }
    } S;

  Previous versions of Clang rejected some constructs of this form
  (specifically, where the linkage of the type happened to be computed
  before the parser reached the typedef name); those cases are still rejected
  in Clang 11. In addition, cases that previous versions of Clang did not
  reject now produce an extension warning. This warning can be disabled with
  the warning flag ``-Wno-non-c-typedef-for-linkage``.

  Affected code should be updated to provide a tag name for the anonymous
  struct:

  .. code-block:: c++

    struct S {
      int f() { return 0; }
    };

  If the code is shared with a C compilation (for example, if the parts that
  are not C-compatible are guarded with ``#ifdef __cplusplus``), the typedef
  declaration should be retained, but a tag name should still be provided:

  .. code-block:: c++

    typedef struct S {
      int f() { return 0; }
    } S;
- ...

C++1z Feature Support
^^^^^^^^^^^^^^^^^^^^^

...

Objective-C Language Changes in Clang
@@ -246,49 +127,19 @@ CUDA Support in Clang
Internal API Changes
--------------------

These are major API changes that have happened since the 10.0.0 release of
These are major API changes that have happened since the 11.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.

- ``RecursiveASTVisitor`` no longer calls separate methods to visit specific
  operator kinds. Previously, ``RecursiveASTVisitor`` treated unary, binary,
  and compound assignment operators as if they were subclasses of the
  corresponding AST node. For example, the binary operator plus was treated as
  if it was a ``BinAdd`` subclass of the ``BinaryOperator`` class: during AST
  traversal of a ``BinaryOperator`` AST node that had a ``BO_Add`` opcode,
  ``RecursiveASTVisitor`` was calling the ``TraverseBinAdd`` method instead of
  ``TraverseBinaryOperator``. This feature was contributing a non-trivial
  amount of complexity to the implementation of ``RecursiveASTVisitor``, it was
  used only in a minor way in Clang, was not tested, and as a result it was
  buggy. Furthermore, this feature was creating a non-uniformity in the API.
  Since this feature was not documented, it was quite difficult to figure out
  how to use ``RecursiveASTVisitor`` to visit operators.

  To update your code to the new uniform API, move the code from separate
  visitation methods into methods that correspond to the actual AST node and
  perform case analysis based on the operator opcode as needed:

  * ``TraverseUnary*() => TraverseUnaryOperator()``
  * ``WalkUpFromUnary*() => WalkUpFromUnaryOperator()``
  * ``VisitUnary*() => VisiUnaryOperator()``
  * ``TraverseBin*() => TraverseBinaryOperator()``
  * ``WalkUpFromBin*() => WalkUpFromBinaryOperator()``
  * ``VisitBin*() => VisiBinaryOperator()``
  * ``TraverseBin*Assign() => TraverseCompoundAssignOperator()``
  * ``WalkUpFromBin*Assign() => WalkUpFromCompoundAssignOperator()``
  * ``VisitBin*Assign() => VisiCompoundAssignOperator()``
- ...

Build System Changes
--------------------

These are major changes to the build system that have happened since the 10.0.0
These are major changes to the build system that have happened since the 11.0.0
release of Clang. Users of the build system should adjust accordingly.

- clang-tidy and clang-include-fixer are no longer compiled into libclang by
  default. You can set ``LIBCLANG_INCLUDE_CLANG_TOOLS_EXTRA=ON`` to undo that,
  but it's expected that that setting will go away eventually. If this is
  something you need, please reach out to the mailing list to discuss possible
  ways forward.
- ...

AST Matchers
------------
@@ -298,103 +149,7 @@ AST Matchers
clang-format
------------

- Option ``IndentExternBlock`` has been added to optionally apply indenting inside ``extern "C"`` and ``extern "C++"`` blocks.

- ``IndentExternBlock`` option accepts ``AfterExternBlock`` to use the old behavior, as well as Indent and NoIndent options, which map to true and false, respectively.

  .. code-block:: c++

    Indent:                       NoIndent:
     #ifdef __cplusplus          #ifdef __cplusplus
     extern "C" {                extern "C++" {
     #endif                      #endif

          void f(void);          void f(void);

     #ifdef __cplusplus          #ifdef __cplusplus
     }                           }
     #endif                      #endif

- Option ``IndentCaseBlocks`` has been added to support treating the block
  following a switch case label as a scope block which gets indented itself.
  It helps avoid having the closing bracket align with the switch statement's
  closing bracket (when ``IndentCaseLabels`` is ``false``).

  .. code-block:: c++

    switch (fool) {                vs.     switch (fool) {
    case 1:                                case 1: {
      {                                      bar();
         bar();                            } break;
      }                                    default: {
      break;                                 plop();
    default:                               }
      {                                    }
        plop();
      }
    }

- Option ``ObjCBreakBeforeNestedBlockParam`` has been added to optionally apply
  linebreaks for function arguments declarations before nested blocks.

- Option ``InsertTrailingCommas`` can be set to ``TCS_Wrapped`` to insert
  trailing commas in container literals (arrays and objects) that wrap across
  multiple lines. It is currently only available for JavaScript and disabled by
  default (``TCS_None``).

- Option ``BraceWrapping.BeforeLambdaBody`` has been added to manage lambda
  line break inside function parameter call in Allman style.

  .. code-block:: c++

      true:
      connect(
        []()
        {
          foo();
          bar();
        });

      false:
      connect([]() {
          foo();
          bar();
        });

- Option ``AlignConsecutiveBitFields`` has been added to align bit field
  declarations across multiple adjacent lines

  .. code-block:: c++

      true:
        bool aaa  : 1;
        bool a    : 1;
        bool bb   : 1;

      false:
        bool aaa : 1;
        bool a : 1;
        bool bb : 1;

- Option ``BraceWrapping.BeforeWhile`` has been added to allow wrapping
  before the ```while`` in a do..while loop. By default the value is (``false``)

  In previous releases ``IndentBraces`` implied ``BraceWrapping.BeforeWhile``.
  If using a Custom BraceWrapping style you may need to now set
  ``BraceWrapping.BeforeWhile`` to (``true``) to be explicit.

  .. code-block:: c++

      true:
      do {
        foo();
      }
      while(1);

      false:
      do {
        foo();
      } while(1);
- ...

libclang
--------
+2 −2
Original line number Diff line number Diff line
@@ -49,9 +49,9 @@ copyright = u'2013-%d, Analyzer Team' % date.today().year
# built documents.
#
# The short version.
version = '11'
version = '12'
# The full version, including alpha/beta/rc tags.
release = '11'
release = '12'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
+2 −2
Original line number Diff line number Diff line
@@ -50,9 +50,9 @@ copyright = u'2007-%d, The Clang Team' % date.today().year
# built documents.
#
# The short version.
version = '11'
version = '12'
# The full version, including alpha/beta/rc tags.
release = '11'
release = '12'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Loading