2016-07-19 02:08:59 +08:00
|
|
|
===================================================
|
2019-01-16 18:57:02 +08:00
|
|
|
Extra Clang Tools 9.0.0 (In-Progress) Release Notes
|
2016-07-19 02:08:59 +08:00
|
|
|
===================================================
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
.. contents::
|
|
|
|
:local:
|
2016-03-30 20:05:33 +08:00
|
|
|
:depth: 3
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2018-09-10 16:52:04 +08:00
|
|
|
Written by the `LLVM Team <https://llvm.org/>`_
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
2019-01-16 18:57:02 +08:00
|
|
|
These are in-progress notes for the upcoming Extra Clang Tools 9 release.
|
2017-02-10 07:25:52 +08:00
|
|
|
Release notes for previous releases can be found on
|
2018-09-10 16:52:04 +08:00
|
|
|
`the Download Page <https://releases.llvm.org/download.html>`_.
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
|
|
|
This document contains the release notes for the Extra Clang Tools, part of the
|
2019-01-16 18:57:02 +08:00
|
|
|
Clang release 9.0.0. Here we describe the status of the Extra Clang Tools in
|
2016-09-07 01:52:44 +08:00
|
|
|
some detail, including major improvements from the previous release and new
|
|
|
|
feature work. All LLVM releases may be downloaded from the `LLVM releases web
|
2018-09-10 16:52:04 +08:00
|
|
|
site <https://llvm.org/releases/>`_.
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
For more information about Clang or LLVM, including information about
|
2018-09-10 16:52:04 +08:00
|
|
|
the latest release, please see the `Clang Web Site <https://clang.llvm.org>`_ or
|
|
|
|
the `LLVM Web Site <https://llvm.org>`_.
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
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
|
2018-09-10 16:52:04 +08:00
|
|
|
see the `releases page <https://llvm.org/releases/>`_.
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2019-01-16 18:57:02 +08:00
|
|
|
What's New in Extra Clang Tools 9.0.0?
|
2016-07-19 02:08:59 +08:00
|
|
|
======================================
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
Some of the major new features and improvements to Extra Clang Tools are listed
|
|
|
|
here. Generic improvements to Extra Clang Tools as a whole or to its underlying
|
|
|
|
infrastructure are described first, followed by tool-specific sections.
|
|
|
|
|
|
|
|
Major New Features
|
|
|
|
------------------
|
|
|
|
|
2016-07-19 02:08:59 +08:00
|
|
|
...
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2018-10-12 05:40:32 +08:00
|
|
|
Improvements to clangd
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
The improvements are...
|
|
|
|
|
|
|
|
Improvements to clang-doc
|
|
|
|
-------------------------
|
|
|
|
|
|
|
|
The improvements are...
|
|
|
|
|
2016-03-30 20:05:33 +08:00
|
|
|
Improvements to clang-query
|
|
|
|
---------------------------
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2019-01-16 18:57:02 +08:00
|
|
|
- ...
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2016-03-30 20:05:33 +08:00
|
|
|
Improvements to clang-rename
|
|
|
|
----------------------------
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2017-01-13 05:58:40 +08:00
|
|
|
The improvements are...
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2016-03-30 20:05:33 +08:00
|
|
|
Improvements to clang-tidy
|
|
|
|
--------------------------
|
2016-03-27 13:06:57 +08:00
|
|
|
|
[clang-tidy] A new OpenMP module
Summary:
Just the empty skeleton.
Previously reviewed as part of D57113.
Reviewers: JonasToth, aaron.ballman, alexfh, xazax.hun, hokein, gribozavr
Reviewed By: JonasToth, gribozavr
Subscribers: jdoerfert, mgorny, rnkovacs, guansong, arphaman, cfe-commits
Tags: #clang-tools-extra, #openmp, #clang
Differential Revision: https://reviews.llvm.org/D57571
llvm-svn: 356800
2019-03-23 03:46:01 +08:00
|
|
|
- New OpenMP module.
|
|
|
|
|
|
|
|
For checks specific to `OpenMP <https://www.openmp.org/>`_ API.
|
|
|
|
|
2019-01-28 22:03:09 +08:00
|
|
|
- New :doc:`abseil-duration-addition
|
|
|
|
<clang-tidy/checks/abseil-duration-addition>` check.
|
|
|
|
|
|
|
|
Checks for cases where addition should be performed in the ``absl::Time``
|
|
|
|
domain.
|
|
|
|
|
2019-01-18 04:37:35 +08:00
|
|
|
- New :doc:`abseil-duration-conversion-cast
|
|
|
|
<clang-tidy/checks/abseil-duration-conversion-cast>` check.
|
|
|
|
|
|
|
|
Checks for casts of ``absl::Duration`` conversion functions, and recommends
|
|
|
|
the right conversion function instead.
|
2019-01-03 07:35:57 +08:00
|
|
|
|
2019-02-05 03:28:20 +08:00
|
|
|
- New :doc:`abseil-duration-unnecessary-conversion
|
|
|
|
<clang-tidy/checks/abseil-duration-unnecessary-conversion>` check.
|
|
|
|
|
|
|
|
Finds and fixes cases where ``absl::Duration`` values are being converted to
|
|
|
|
numeric types and back again.
|
|
|
|
|
2019-03-12 00:47:45 +08:00
|
|
|
- New :doc:`abseil-time-comparison
|
|
|
|
<clang-tidy/checks/abseil-time-comparison>` check.
|
|
|
|
|
|
|
|
Prefer comparisons in the ``absl::Time`` domain instead of the integer
|
|
|
|
domain.
|
|
|
|
|
2019-02-28 04:08:50 +08:00
|
|
|
- New :doc:`abseil-time-subtraction
|
|
|
|
<clang-tidy/checks/abseil-time-subtraction>` check.
|
|
|
|
|
|
|
|
Finds and fixes ``absl::Time`` subtraction expressions to do subtraction
|
|
|
|
in the Time domain instead of the numeric domain.
|
|
|
|
|
2019-05-12 20:23:56 +08:00
|
|
|
- New :doc:`bugprone-unhandled-self-assignment
|
|
|
|
<clang-tidy/checks/bugprone-unhandled-self-assignment>` check.
|
|
|
|
|
|
|
|
Finds user-defined copy assignment operators which do not protect the code
|
|
|
|
against self-assignment either by checking self-assignment explicitly or
|
|
|
|
using the copy-and-swap or the copy-and-move method.
|
|
|
|
|
2019-01-25 18:03:49 +08:00
|
|
|
- New :doc:`google-readability-avoid-underscore-in-googletest-name
|
|
|
|
<clang-tidy/checks/google-readability-avoid-underscore-in-googletest-name>`
|
|
|
|
check.
|
|
|
|
|
|
|
|
Checks whether there are underscores in googletest test and test case names in
|
|
|
|
test macros, which is prohibited by the Googletest FAQ.
|
|
|
|
|
2019-04-18 06:29:06 +08:00
|
|
|
- New :doc:`objc-super-self <clang-tidy/checks/objc-super-self>` check.
|
|
|
|
|
|
|
|
Finds invocations of ``-self`` on super instances in initializers of
|
|
|
|
subclasses of ``NSObject`` and recommends calling a superclass initializer
|
|
|
|
instead.
|
|
|
|
|
2019-02-28 22:55:12 +08:00
|
|
|
- New alias :doc:`cppcoreguidelines-explicit-virtual-functions
|
|
|
|
<clang-tidy/checks/cppcoreguidelines-explicit-virtual-functions>` to
|
|
|
|
:doc:`modernize-use-override
|
|
|
|
<clang-tidy/checks/modernize-use-override>` was added.
|
|
|
|
|
2019-02-09 01:00:01 +08:00
|
|
|
- The :doc:`bugprone-argument-comment
|
|
|
|
<clang-tidy/checks/bugprone-argument-comment>` now supports
|
[clang-tidy] add OverrideMacro to modernize-use-override check
Summary:
The usefulness of **modernize-use-override** can be reduced if you have to live in an environment where you support multiple compilers, some of which sadly are not yet fully C++11 compliant
some codebases have to use override as a macro OVERRIDE e.g.
```
// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled.
```
This allows code to be compiled with C++11 compliant compilers and get warnings and errors that clang, MSVC,gcc can give, while still allowing other legacy pre C++11 compilers to compile the code. This can be an important step towards modernizing C++ code whilst living in a legacy codebase.
When it comes to clang tidy, the use of the **modernize-use-override** is one of the most useful checks, but the messages reported are inaccurate for that codebase if the standard approach is to use the macros OVERRIDE and/or FINAL.
When combined with fix-its that introduce the C++11 override keyword, they become fatal, resulting in the modernize-use-override check being turned off to prevent the introduction of such errors.
This revision, allows the possibility for the replacement **override **to be a macro instead, Allowing the clang-tidy check to be run on both pre and post C++11 code, and allowing fix-its to be applied.
Reviewers: alexfh, JonasToth, hokein, Eugene.Zelenko, aaron.ballman
Reviewed By: alexfh, JonasToth
Subscribers: lewmpk, malcolm.parsons, jdoerfert, xazax.hun, cfe-commits, llvm-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D57087
llvm-svn: 355132
2019-03-01 04:00:48 +08:00
|
|
|
`CommentBoolLiterals`, `CommentIntegerLiterals`, `CommentFloatLiterals`,
|
2019-02-09 01:00:01 +08:00
|
|
|
`CommentUserDefiniedLiterals`, `CommentStringLiterals`,
|
|
|
|
`CommentCharacterLiterals` & `CommentNullPtrs` options.
|
|
|
|
|
2019-04-14 20:47:48 +08:00
|
|
|
- The :doc:`bugprone-too-small-loop-variable
|
|
|
|
<clang-tidy/checks/bugprone-too-small-loop-variable>` now supports
|
|
|
|
`MagnitudeBitsUpperLimit` option. The default value was set to 16,
|
|
|
|
which greatly reduces warnings related to loops which are unlikely to
|
|
|
|
cause an actual functional bug.
|
|
|
|
|
[clang-tidy] Disable google-runtime-int in Objective-C++ 🔓
Summary:
In contrast to Google C++, Objective-C often uses built-in integer types
other than `int`. In fact, the Objective-C runtime itself defines the
types NSInteger¹ and NSUInteger² which are variant types depending on
the target architecture. The Objective-C style guide indicates that
usage of system types with variant sizes is appropriate when handling
values provided by system interfaces³. Objective-C++ is commonly the
result of conversion from Objective-C to Objective-C++ for the purpose
of integrating C++ functionality. The opposite of Objective-C++ being
used to expose Objective-C functionality to C++ is less common,
potentially because Objective-C has a signficantly more uneven presence
on different platforms compared to C++. This generally predisposes
Objective-C++ to commonly being more Objective-C than C++. Forcing
Objective-C++ developers to perform conversions between variant system types
and fixed size integer types depending on target architecture when
Objective-C++ commonly uses variant system types from Objective-C is
likely to lead to more bugs and overhead than benefit. For that reason,
this change proposes to disable google-runtime-int in Objective-C++.
[1] https://developer.apple.com/documentation/objectivec/nsinteger?language=objc
[2] https://developer.apple.com/documentation/objectivec/nsuinteger?language=objc
[3] "Types long, NSInteger, NSUInteger, and CGFloat vary in size between
32- and 64-bit builds. Use of these types is appropriate when handling
values exposed by system interfaces, but they should be avoided for most
other computations."
https://github.com/google/styleguide/blob/gh-pages/objcguide.md#types-with-inconsistent-sizes
Subscribers: xazax.hun, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59336
llvm-svn: 356627
2019-03-21 07:05:00 +08:00
|
|
|
- The :doc:`google-runtime-int <clang-tidy/checks/google-runtime-int>`
|
|
|
|
check has been disabled in Objective-C++.
|
|
|
|
|
2019-02-16 12:27:12 +08:00
|
|
|
- The `Acronyms` and `IncludeDefaultAcronyms` options for the
|
|
|
|
:doc:`objc-property-declaration <clang-tidy/checks/objc-property-declaration>`
|
|
|
|
check have been removed.
|
|
|
|
|
[clang-tidy] add OverrideMacro to modernize-use-override check
Summary:
The usefulness of **modernize-use-override** can be reduced if you have to live in an environment where you support multiple compilers, some of which sadly are not yet fully C++11 compliant
some codebases have to use override as a macro OVERRIDE e.g.
```
// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled.
```
This allows code to be compiled with C++11 compliant compilers and get warnings and errors that clang, MSVC,gcc can give, while still allowing other legacy pre C++11 compilers to compile the code. This can be an important step towards modernizing C++ code whilst living in a legacy codebase.
When it comes to clang tidy, the use of the **modernize-use-override** is one of the most useful checks, but the messages reported are inaccurate for that codebase if the standard approach is to use the macros OVERRIDE and/or FINAL.
When combined with fix-its that introduce the C++11 override keyword, they become fatal, resulting in the modernize-use-override check being turned off to prevent the introduction of such errors.
This revision, allows the possibility for the replacement **override **to be a macro instead, Allowing the clang-tidy check to be run on both pre and post C++11 code, and allowing fix-its to be applied.
Reviewers: alexfh, JonasToth, hokein, Eugene.Zelenko, aaron.ballman
Reviewed By: alexfh, JonasToth
Subscribers: lewmpk, malcolm.parsons, jdoerfert, xazax.hun, cfe-commits, llvm-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D57087
llvm-svn: 355132
2019-03-01 04:00:48 +08:00
|
|
|
- The :doc:`modernize-use-override
|
|
|
|
<clang-tidy/checks/modernize-use-override>` now supports `OverrideSpelling`
|
|
|
|
and `FinalSpelling` options.
|
|
|
|
|
[clang-tidy] Add new checker: llvm-prefer-isa-or-dyn-cast-in-conditionals
Summary:
Looks at conditionals and finds cases of ``cast<>``, which will
assert rather than return a null pointer, and ``dyn_cast<>`` where
the return value is not captured. Additionally, finds cases that
match the pattern ``var.foo() && isa<X>(var.foo())``, where the
method is called twice and could be expensive.
.. code-block:: c++
// Finds cases like these:
if (auto x = cast<X>(y)) <...>
if (cast<X>(y)) <...>
// But not cases like these:
if (auto f = cast<Z>(y)->foo()) <...>
if (cast<Z>(y)->foo()) <...>
Reviewers: alexfh, rjmccall, hokein, aaron.ballman, JonasToth
Reviewed By: aaron.ballman
Subscribers: xbolva00, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D59802
llvm-svn: 359142
2019-04-25 05:25:57 +08:00
|
|
|
- New :doc:`llvm-prefer-isa-or-dyn-cast-in-conditionals
|
|
|
|
<clang-tidy/checks/llvm-prefer-isa-or-dyn-cast-in-conditionals>` check.
|
|
|
|
|
|
|
|
Looks at conditionals and finds and replaces cases of ``cast<>``,
|
|
|
|
which will assert rather than return a null pointer, and
|
|
|
|
``dyn_cast<>`` where the return value is not captured. Additionally,
|
|
|
|
finds and replaces cases that match the pattern ``var &&
|
|
|
|
isa<X>(var)``, where ``var`` is evaluated twice.
|
|
|
|
|
2019-05-11 00:24:28 +08:00
|
|
|
- New :doc:`modernize-use-trailing-return-type
|
|
|
|
<clang-tidy/checks/modernize-use-trailing-return-type>` check.
|
|
|
|
|
|
|
|
Rewrites function signatures to use a trailing return type.
|
|
|
|
|
|
|
|
Improvements to include-fixer
|
|
|
|
-----------------------------
|
|
|
|
|
[clang-tidy] openmp-exception-escape - a new check
Summary:
Finally, we are here!
Analyzes OpenMP Structured Blocks and checks that no exception escapes
out of the Structured Block it was thrown in.
As per the OpenMP specification, structured block is an executable statement,
possibly compound, with a single entry at the top and a single exit at the
bottom. Which means, ``throw`` may not be used to to 'exit' out of the
structured block. If an exception is not caught in the same structured block
it was thrown in, the behaviour is undefined / implementation defined,
the program will likely terminate.
Reviewers: JonasToth, aaron.ballman, baloghadamsoftware, gribozavr
Reviewed By: aaron.ballman, gribozavr
Subscribers: mgorny, xazax.hun, rnkovacs, guansong, jdoerfert, cfe-commits, ABataev
Tags: #clang-tools-extra, #openmp, #clang
Differential Revision: https://reviews.llvm.org/D59466
llvm-svn: 356802
2019-03-23 03:46:25 +08:00
|
|
|
- New :doc:`openmp-exception-escape
|
|
|
|
<clang-tidy/checks/openmp-exception-escape>` check.
|
|
|
|
|
|
|
|
Analyzes OpenMP Structured Blocks and checks that no exception escapes
|
|
|
|
out of the Structured Block it was thrown in.
|
|
|
|
|
[clang-tidy] openmp-use-default-none - a new check
Summary:
Finds OpenMP directives that are allowed to contain `default` clause,
but either don't specify it, or the clause is specified but with the kind
other than `none`, and suggests to use `default(none)` clause.
Using `default(none)` clause changes the default variable visibility from
being implicitly determined, and thus forces developer to be explicit about the
desired data scoping for each variable.
Reviewers: JonasToth, aaron.ballman, xazax.hun, hokein, gribozavr
Reviewed By: JonasToth, aaron.ballman
Subscribers: jdoerfert, openmp-commits, klimek, sbenza, arphaman, Eugene.Zelenko, ABataev, mgorny, rnkovacs, guansong, cfe-commits
Tags: #clang-tools-extra, #openmp, #clang
Differential Revision: https://reviews.llvm.org/D57113
llvm-svn: 356801
2019-03-23 03:46:12 +08:00
|
|
|
- New :doc:`openmp-use-default-none
|
|
|
|
<clang-tidy/checks/openmp-use-default-none>` check.
|
|
|
|
|
|
|
|
Finds OpenMP directives that are allowed to contain a ``default`` clause,
|
|
|
|
but either don't specify it or the clause is specified but with the kind
|
|
|
|
other than ``none``, and suggests to use the ``default(none)`` clause.
|
|
|
|
|
2019-03-25 22:09:10 +08:00
|
|
|
Improvements to clang-include-fixer
|
2019-03-26 00:50:24 +08:00
|
|
|
-----------------------------------
|
2016-03-30 20:05:33 +08:00
|
|
|
|
2017-01-13 05:58:40 +08:00
|
|
|
The improvements are...
|
2016-03-30 20:05:33 +08:00
|
|
|
|
|
|
|
Improvements to modularize
|
|
|
|
--------------------------
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
The improvements are...
|
[pp-trace] Delete -ignore and add a new option -callbacks
Summary:
-ignore specifies a list of PP callbacks to ignore. It cannot express a
whitelist, which may be more useful than a blacklist.
Add a new option -callbacks to replace it.
-ignore= (default) => -callbacks='*' (default)
-ignore=FileChanged,FileSkipped => -callbacks='*,-FileChanged,-FileSkipped'
-callbacks='Macro*' : print only MacroDefined,MacroExpands,MacroUndefined,...
Reviewers: juliehockett, aaron.ballman, alexfh, ioeric
Reviewed By: aaron.ballman
Subscribers: nemanjai, kbarton, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59296
llvm-svn: 356366
2019-03-18 21:30:17 +08:00
|
|
|
|
|
|
|
Improvements to pp-trace
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
- Added a new option `-callbacks` to filter preprocessor callbacks. It replaces
|
|
|
|
the `-ignore` option.
|