<p dir="ltr">Sure, will do</p>
<div class="gmail_quote">On Dec 17, 2015 6:44 PM, "Aaron Ballman" <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Can you also be sure to update the release notes for this change?<br>
<br>
~Aaron<br>
<br>
On Thu, Dec 17, 2015 at 6:49 AM, Alexander Kornienko via cfe-commits<br>
<<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
> Author: alexfh<br>
> Date: Thu Dec 17 05:49:19 2015<br>
> New Revision: 255886<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=255886&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=255886&view=rev</a><br>
> Log:<br>
> Remove clang-modernize.<br>
><br>
> Summary:<br>
> clang-modernize transforms have moved to clang-tidy. Removing<br>
> the old tool now.<br>
><br>
> Reviewers: klimek<br>
><br>
> Subscribers: cfe-commits<br>
><br>
> Differential Revision: <a href="http://reviews.llvm.org/D15606" rel="noreferrer" target="_blank">http://reviews.llvm.org/D15606</a><br>
><br>
> Removed:<br>
> clang-tools-extra/trunk/clang-modernize/<br>
> clang-tools-extra/trunk/docs/AddOverrideTransform.rst<br>
> clang-tools-extra/trunk/docs/LoopConvertTransform.rst<br>
> clang-tools-extra/trunk/docs/MigratorUsage.rst<br>
> clang-tools-extra/trunk/docs/ModernizerUsage.rst<br>
> clang-tools-extra/trunk/docs/PassByValueTransform.rst<br>
> clang-tools-extra/trunk/docs/ReplaceAutoPtrTransform.rst<br>
> clang-tools-extra/trunk/docs/UseAutoTransform.rst<br>
> clang-tools-extra/trunk/docs/UseNullptrTransform.rst<br>
> clang-tools-extra/trunk/test/clang-modernize/<br>
> clang-tools-extra/trunk/unittests/clang-modernize/<br>
> clang-tools-extra/trunk/unittests/include/common/Utility.h<br>
> Modified:<br>
> clang-tools-extra/trunk/CMakeLists.txt<br>
> clang-tools-extra/trunk/Makefile<br>
> clang-tools-extra/trunk/docs/clang-modernize.rst<br>
> clang-tools-extra/trunk/docs/cpp11-migrate.rst<br>
> clang-tools-extra/trunk/docs/index.rst<br>
> clang-tools-extra/trunk/test/CMakeLists.txt<br>
> clang-tools-extra/trunk/unittests/CMakeLists.txt<br>
> clang-tools-extra/trunk/unittests/Makefile<br>
><br>
> Modified: clang-tools-extra/trunk/CMakeLists.txt<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/CMakeLists.txt?rev=255886&r1=255885&r2=255886&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/CMakeLists.txt?rev=255886&r1=255885&r2=255886&view=diff</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/CMakeLists.txt (original)<br>
> +++ clang-tools-extra/trunk/CMakeLists.txt Thu Dec 17 05:49:19 2015<br>
> @@ -1,5 +1,4 @@<br>
> add_subdirectory(clang-apply-replacements)<br>
> -add_subdirectory(clang-modernize)<br>
> add_subdirectory(clang-rename)<br>
> add_subdirectory(modularize)<br>
> if(CLANG_ENABLE_STATIC_ANALYZER)<br>
><br>
> Modified: clang-tools-extra/trunk/Makefile<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/Makefile?rev=255886&r1=255885&r2=255886&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/Makefile?rev=255886&r1=255885&r2=255886&view=diff</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/Makefile (original)<br>
> +++ clang-tools-extra/trunk/Makefile Thu Dec 17 05:49:19 2015<br>
> @@ -12,8 +12,7 @@ CLANG_LEVEL := ../..<br>
> include $(CLANG_LEVEL)/../../Makefile.config<br>
><br>
> PARALLEL_DIRS := tool-template modularize pp-trace<br>
> -DIRS := clang-apply-replacements clang-modernize clang-rename clang-tidy \<br>
> - clang-query unittests<br>
> +DIRS := clang-apply-replacements clang-rename clang-tidy clang-query unittests<br>
><br>
> include $(CLANG_LEVEL)/Makefile<br>
><br>
><br>
> Removed: clang-tools-extra/trunk/docs/AddOverrideTransform.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/AddOverrideTransform.rst?rev=255885&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/AddOverrideTransform.rst?rev=255885&view=auto</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/docs/AddOverrideTransform.rst (original)<br>
> +++ clang-tools-extra/trunk/docs/AddOverrideTransform.rst (removed)<br>
> @@ -1,54 +0,0 @@<br>
> -.. index:: Add-Override Transform<br>
> -<br>
> -======================<br>
> -Add-Override Transform<br>
> -======================<br>
> -<br>
> -The Add-Override Transform adds the ``override`` specifier to member<br>
> -functions that override a virtual function in a base class and that<br>
> -don't already have the specifier. The transform is enabled with the<br>
> -:option:`-add-override` option of :program:`clang-modernize`.<br>
> -For example:<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - class A {<br>
> - public:<br>
> - virtual void h() const;<br>
> - };<br>
> -<br>
> - class B : public A {<br>
> - public:<br>
> - void h() const;<br>
> -<br>
> - // The declaration of h is transformed to<br>
> - void h() const override;<br>
> - };<br>
> -<br>
> -Using Expands-to-Override Macros<br>
> -================================<br>
> -<br>
> -Like LLVM's ``LLVM_OVERRIDE``, several projects have macros that conditionally<br>
> -expand to the ``override`` keyword when compiling with C++11 features enabled.<br>
> -To maintain compatibility with non-C++11 builds, the Add-Override Transform<br>
> -supports detection and use of these macros instead of using the ``override``<br>
> -keyword directly. Specify ``-override-macros`` on the command line to the<br>
> -Modernizer to enable this behavior.<br>
> -<br>
> -<br>
> -Known Limitations<br>
> -=================<br>
> -* This transform will not insert the override keyword if a method is<br>
> - pure. At the moment it's not possible to track down the pure<br>
> - specifier location.<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - class B : public A {<br>
> - public:<br>
> - virtual void h() const = 0;<br>
> -<br>
> - // The declaration of h is NOT transformed to<br>
> - virtual void h() const override = 0;<br>
> - };<br>
> -<br>
><br>
> Removed: clang-tools-extra/trunk/docs/LoopConvertTransform.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/LoopConvertTransform.rst?rev=255885&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/LoopConvertTransform.rst?rev=255885&view=auto</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/docs/LoopConvertTransform.rst (original)<br>
> +++ clang-tools-extra/trunk/docs/LoopConvertTransform.rst (removed)<br>
> @@ -1,257 +0,0 @@<br>
> -.. index:: Loop Convert Transform<br>
> -<br>
> -======================<br>
> -Loop Convert Transform<br>
> -======================<br>
> -<br>
> -The Loop Convert Transform is a transformation to convert ``for(...; ...;<br>
> -...)`` loops to use the new range-based loops in C++11. The transform is enabled<br>
> -with the :option:`-loop-convert` option of :program:`clang-modernize`.<br>
> -<br>
> -Three kinds of loops can be converted:<br>
> -<br>
> -- Loops over statically allocated arrays<br>
> -- Loops over containers, using iterators<br>
> -- Loops over array-like containers, using ``operator[]`` and ``at()``<br>
> -<br>
> -Risk<br>
> -====<br>
> -<br>
> -Risky<br>
> ------<br>
> -<br>
> -In loops where the container expression is more complex than just a<br>
> -reference to a declared expression (a variable, function, enum, etc.),<br>
> -and some part of it appears elsewhere in the loop, we lower our confidence<br>
> -in the transformation due to the increased risk of changing semantics.<br>
> -Transformations for these loops are marked as `risky`, and thus will only<br>
> -be converted if the acceptable risk level is set to ``-risk=risky``.<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - int arr[10][20];<br>
> - int l = 5;<br>
> -<br>
> - for (int j = 0; j < 20; ++j)<br>
> - int k = arr[l][j] + l; // using l outside arr[l] is considered risky<br>
> -<br>
> - for (int i = 0; i < obj.getVector().size(); ++i)<br>
> - obj.foo(10); // using 'obj' is considered risky<br>
> -<br>
> -See<br>
> -:ref:`Range-based loops evaluate end() only once<IncorrectRiskyTransformation>`<br>
> -for an example of an incorrect transformation when the maximum acceptable risk<br>
> -level is set to `risky`.<br>
> -<br>
> -Reasonable (Default)<br>
> ---------------------<br>
> -<br>
> -If a loop calls ``.end()`` or ``.size()`` after each iteration, the<br>
> -transformation for that loop is marked as `reasonable`, and thus will<br>
> -be converted if the acceptable risk level is set to ``-risk=reasonable``<br>
> -(default) or higher.<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - // using size() is considered reasonable<br>
> - for (int i = 0; i < container.size(); ++i)<br>
> - cout << container[i];<br>
> -<br>
> -Safe<br>
> -----<br>
> -<br>
> -Any other loops that do not match the above criteria to be marked as<br>
> -`risky` or `reasonable` are marked `safe`, and thus will be converted<br>
> -if the acceptable risk level is set to ``-risk=safe`` or higher.<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - int arr[] = {1,2,3};<br>
> -<br>
> - for (int i = 0; i < 3; ++i)<br>
> - cout << arr[i];<br>
> -<br>
> -Example<br>
> -=======<br>
> -<br>
> -Original:<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - const int N = 5;<br>
> - int arr[] = {1,2,3,4,5};<br>
> - vector<int> v;<br>
> - v.push_back(1);<br>
> - v.push_back(2);<br>
> - v.push_back(3);<br>
> -<br>
> - // safe transform<br>
> - for (int i = 0; i < N; ++i)<br>
> - cout << arr[i];<br>
> -<br>
> - // reasonable transform<br>
> - for (vector<int>::iterator it = v.begin(); it != v.end(); ++it)<br>
> - cout << *it;*<br>
> -<br>
> - // reasonable transform<br>
> - for (int i = 0; i < v.size(); ++i)<br>
> - cout << v[i];<br>
> -<br>
> -After transformation with risk level set to ``-risk=reasonable`` (default):<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - const int N = 5;<br>
> - int arr[] = {1,2,3,4,5};<br>
> - vector<int> v;<br>
> - v.push_back(1);<br>
> - v.push_back(2);<br>
> - v.push_back(3);<br>
> -<br>
> - // safe transform<br>
> - for (auto & elem : arr)<br>
> - cout << elem;<br>
> -<br>
> - // reasonable transform<br>
> - for (auto & elem : v)<br>
> - cout << elem;<br>
> -<br>
> - // reasonable transform<br>
> - for (auto & elem : v)<br>
> - cout << elem;<br>
> -<br>
> -Limitations<br>
> -===========<br>
> -<br>
> -There are certain situations where the tool may erroneously perform<br>
> -transformations that remove information and change semantics. Users of the tool<br>
> -should be aware of the behaviour and limitations of the transform outlined by<br>
> -the cases below.<br>
> -<br>
> -Comments inside loop headers<br>
> -----------------------------<br>
> -<br>
> -Comments inside the original loop header are ignored and deleted when<br>
> -transformed.<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - for (int i = 0; i < N; /* This will be deleted */ ++i) { }<br>
> -<br>
> -Range-based loops evaluate end() only once<br>
> -------------------------------------------<br>
> -<br>
> -The C++11 range-based for loop calls ``.end()`` only once during the<br>
> -initialization of the loop. If in the original loop ``.end()`` is called after<br>
> -each iteration the semantics of the transformed loop may differ.<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - // The following is semantically equivalent to the C++11 range-based for loop,<br>
> - // therefore the semantics of the header will not change.<br>
> - for (iterator it = container.begin(), e = container.end(); it != e; ++it) { }<br>
> -<br>
> - // Instead of calling .end() after each iteration, this loop will be<br>
> - // transformed to call .end() only once during the initialization of the loop,<br>
> - // which may affect semantics.<br>
> - for (iterator it = container.begin(); it != container.end(); ++it) { }<br>
> -<br>
> -.. _IncorrectRiskyTransformation:<br>
> -<br>
> -As explained above, calling member functions of the container in the body<br>
> -of the loop is considered `risky`. If the called member function modifies the<br>
> -container the semantics of the converted loop will differ due to ``.end()``<br>
> -being called only once.<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - bool flag = false;<br>
> - for (vector<T>::iterator it = vec.begin(); it != vec.end(); ++it) {<br>
> - // Add a copy of the first element to the end of the vector.<br>
> - if (!flag) {<br>
> - // This line makes this transformation 'risky'.<br>
> - vec.push_back(*it);<br>
> - flag = true;<br>
> - }<br>
> - cout << *it;<br>
> - }<br>
> -<br>
> -The original code above prints out the contents of the container including the<br>
> -newly added element while the converted loop, shown below, will only print the<br>
> -original contents and not the newly added element.<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - bool flag = false;<br>
> - for (auto & elem : vec) {<br>
> - // Add a copy of the first element to the end of the vector.<br>
> - if (!flag) {<br>
> - // This line makes this transformation 'risky'<br>
> - vec.push_back(elem);<br>
> - flag = true;<br>
> - }<br>
> - cout << elem;<br>
> - }<br>
> -<br>
> -Semantics will also be affected if ``.end()`` has side effects. For example, in<br>
> -the case where calls to ``.end()`` are logged the semantics will change in the<br>
> -transformed loop if ``.end()`` was originally called after each iteration.<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - iterator end() {<br>
> - num_of_end_calls++;<br>
> - return container.end();<br>
> - }<br>
> -<br>
> -Overloaded operator->() with side effects<br>
> ------------------------------------------<br>
> -<br>
> -Similarly, if ``operator->()`` was overloaded to have side effects, such as<br>
> -logging, the semantics will change. If the iterator's ``operator->()`` was used<br>
> -in the original loop it will be replaced with ``<container element>.<member>``<br>
> -instead due to the implicit dereference as part of the range-based for loop.<br>
> -Therefore any side effect of the overloaded ``operator->()`` will no longer be<br>
> -performed.<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - for (iterator it = c.begin(); it != c.end(); ++it) {<br>
> - it->func(); // Using operator->()<br>
> - }<br>
> - // Will be transformed to:<br>
> - for (auto & elem : c) {<br>
> - elem.func(); // No longer using operator->()<br>
> - }<br>
> -<br>
> -Pointers and references to containers<br>
> --------------------------------------<br>
> -<br>
> -While most of the transform's risk analysis is dedicated to determining whether<br>
> -the iterator or container was modified within the loop, it is possible to<br>
> -circumvent the analysis by accessing and modifying the container through a<br>
> -pointer or reference.<br>
> -<br>
> -If the container were directly used instead of using the pointer or reference<br>
> -the following transformation would have only been applied at the ``-risk=risky``<br>
> -level since calling a member function of the container is considered `risky`.<br>
> -The transform cannot identify expressions associated with the container that are<br>
> -different than the one used in the loop header, therefore the transformation<br>
> -below ends up being performed at the ``-risk=safe`` level.<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - vector<int> vec;<br>
> -<br>
> - vector<int> *ptr = &vec;<br>
> - vector<int> &ref = vec;<br>
> -<br>
> - for (vector<int>::iterator it = vec.begin(), e = vec.end(); it != e; ++it) {<br>
> - if (!flag) {<br>
> - // Accessing and modifying the container is considered risky, but the risk<br>
> - // level is not raised here.<br>
> - ptr->push_back(*it);<br>
> - ref.push_back(*it);<br>
> - flag = true;<br>
> - }<br>
> - }<br>
><br>
> Removed: clang-tools-extra/trunk/docs/MigratorUsage.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/MigratorUsage.rst?rev=255885&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/MigratorUsage.rst?rev=255885&view=auto</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/docs/MigratorUsage.rst (original)<br>
> +++ clang-tools-extra/trunk/docs/MigratorUsage.rst (removed)<br>
> @@ -1,6 +0,0 @@<br>
> -===================<br>
> -cpp11-migrate Usage<br>
> -===================<br>
> -<br>
> -This program has been renamed :doc:`clang-modernize <clang-modernize>`, and its usage is now<br>
> -found in :doc:`ModernizerUsage`.<br>
><br>
> Removed: clang-tools-extra/trunk/docs/ModernizerUsage.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/ModernizerUsage.rst?rev=255885&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/ModernizerUsage.rst?rev=255885&view=auto</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/docs/ModernizerUsage.rst (original)<br>
> +++ clang-tools-extra/trunk/docs/ModernizerUsage.rst (removed)<br>
> @@ -1,313 +0,0 @@<br>
> -=====================<br>
> -clang-modernize Usage<br>
> -=====================<br>
> -<br>
> -``clang-modernize [options] [<sources>...] [-- [args]]``<br>
> -<br>
> -``<source#>`` specifies the path to the source to migrate. This path may be<br>
> -relative to the current directory. If no sources are provided, a compilation<br>
> -database provided with `-p`_ can be used to provide sources together with the<br>
> -`include/exclude options`_.<br>
> -<br>
> -By default all transformations are applied. There are two ways to enable a<br>
> -subset of the transformations:<br>
> -<br>
> -1. Explicitly, by referring to the transform options directly, see<br>
> - :ref:`transform-specific-command-line-options`.<br>
> -2. Implicitly, based on the compilers to support, see<br>
> - :ref:`-for-compilers=\<string\> <for-compilers-option>`.<br>
> -<br>
> -If both ways of specifying transforms are used only explicitly specified<br>
> -transformations that are supported by the given compilers will be applied.<br>
> -<br>
> -General Command Line Options<br>
> -============================<br>
> -<br>
> -.. option:: -help<br>
> -<br>
> - Displays tool usage instructions and command line options.<br>
> -<br>
> -.. option:: -version<br>
> -<br>
> - Displays the version information of this tool.<br>
> -<br>
> -.. _-p:<br>
> -<br>
> -.. option:: -p=<build-path><br>
> -<br>
> - ``<build-path>`` is the directory containing a *compilation databasefile*, a<br>
> - file named ``compile_commands.json``, which provides compiler arguments for<br>
> - building each source file. CMake can generate this file by specifying<br>
> - ``-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`` when running CMake. Ninja_, since v1.2<br>
> - can also generate this file with ``ninja -t compdb``. If the compilation<br>
> - database cannot be used for any reason, an error is reported.<br>
> -<br>
> - This option is ignored if ``--`` is present.<br>
> -<br>
> - Files in the compilation database will be transformed if no sources are<br>
> - provided and paths to files are explicitly included using ``-include`` or<br>
> - ``-include-from``.<br>
> - In order to transform all files in a compilation database the following<br>
> - command line can be used:<br>
> -<br>
> - ``clang-modernize -p=<build-path> -include=<project_root>``<br>
> -<br>
> - Use ``-exclude`` or ``-exclude-from`` to limit the scope of ``-include``.<br>
> -<br>
> -.. _Ninja: <a href="http://martine.github.io/ninja/" rel="noreferrer" target="_blank">http://martine.github.io/ninja/</a><br>
> -<br>
> -.. option:: -- [args]<br>
> -<br>
> - Another way to provide compiler arguments is to specify all arguments on the<br>
> - command line following ``--``. Arguments provided this way are used for<br>
> - *every* source file.<br>
> -<br>
> - If neither ``--`` nor ``-p`` are specified a compilation database is<br>
> - searched for starting with the path of the first-provided source file and<br>
> - proceeding through parent directories. If no compilation database is found or<br>
> - one is found and cannot be used for any reason then ``-std=c++11`` is used as<br>
> - the only compiler argument.<br>
> -<br>
> -.. option:: -risk=<risk-level><br>
> -<br>
> - Some transformations may cause a change in semantics. In such cases the<br>
> - maximum acceptable risk level specified through the ``-risk`` command<br>
> - line option decides whether or not a transformation is applied.<br>
> -<br>
> - Three different risk level options are available:<br>
> -<br>
> - ``-risk=safe``<br>
> - Perform only safe transformations.<br>
> - ``-risk=reasonable`` (default)<br>
> - Enable transformations that may change semantics.<br>
> - ``-risk=risky``<br>
> - Enable transformations that are likely to change semantics.<br>
> -<br>
> - The meaning of risk is handled differently for each transform. See<br>
> - :ref:`transform documentation <transforms>` for details.<br>
> -<br>
> -.. option:: -final-syntax-check<br>
> -<br>
> - After applying the final transform to a file, parse the file to ensure the<br>
> - last transform did not introduce syntax errors. Syntax errors introduced by<br>
> - earlier transforms are already caught when subsequent transforms parse the<br>
> - file.<br>
> -<br>
> -.. option:: -summary<br>
> -<br>
> - Displays a summary of the number of changes each transform made or could have<br>
> - made to each source file immediately after each transform is applied.<br>
> - **Accepted** changes are those actually made. **Rejected** changes are those<br>
> - that could have been made if the acceptable risk level were higher.<br>
> - **Deferred** changes are those that might be possible but they might conflict<br>
> - with other accepted changes. Re-applying the transform will resolve deferred<br>
> - changes.<br>
> -<br>
> -.. _for-compilers-option:<br>
> -<br>
> -.. option:: -for-compilers=<string><br>
> -<br>
> - Select transforms targeting the intersection of language features supported by<br>
> - the given compilers.<br>
> -<br>
> - Four compilers are supported. The transforms are enabled according to this<br>
> - table:<br>
> -<br>
> - =============== ===== === ==== ====<br>
> - Transforms clang gcc icc mscv<br>
> - =============== ===== === ==== ====<br>
> - AddOverride (1) 3.0 4.7 14 8<br>
> - LoopConvert 3.0 4.6 13 11<br>
> - PassByValue 3.0 4.6 13 11<br>
> - ReplaceAutoPtr 3.0 4.6 13 11<br>
> - UseAuto 2.9 4.4 12 10<br>
> - UseNullptr 3.0 4.6 12.1 10<br>
> - =============== ===== === ==== ====<br>
> -<br>
> - (1): if *-override-macros* is provided it's assumed that the macros are C++11<br>
> - aware and the transform is enabled without regard to the supported compilers.<br>
> -<br>
> - The structure of the argument to the `-for-compilers` option is<br>
> - **<compiler>-<major ver>[.<minor ver>]** where **<compiler>** is one of the<br>
> - compilers from the above table.<br>
> -<br>
> - Some examples:<br>
> -<br>
> - 1. To support `Clang >= 3.0`, `gcc >= 4.6` and `MSVC >= 11`:<br>
> -<br>
> - ``clang-modernize -for-compilers=clang-3.0,gcc-4.6,msvc-11 <args..>``<br>
> -<br>
> - Enables LoopConvert, ReplaceAutoPtr, UseAuto, UseNullptr.<br>
> -<br>
> - 2. To support `icc >= 12` while using a C++11-aware macro for the `override`<br>
> - virtual specifier:<br>
> -<br>
> - ``clang-modernize -for-compilers=icc-12 -override-macros <args..>``<br>
> -<br>
> - Enables AddOverride and UseAuto.<br>
> -<br>
> - .. warning::<br>
> -<br>
> - If your version of Clang depends on the GCC headers (e.g: when `libc++` is<br>
> - not used), then you probably want to add the GCC version to the targeted<br>
> - platforms as well.<br>
> -<br>
> -.. option:: -perf[=<directory>]<br>
> -<br>
> - Turns on performance measurement and output functionality. The time it takes to<br>
> - apply each transform is recorded by the migrator and written in JSON format<br>
> - to a uniquely named file in the given ``<directory>``. All sources processed<br>
> - by a single Modernizer process are written to the same output file. If<br>
> - ``<directory>`` is not provided the default is ``./migrate_perf/``.<br>
> -<br>
> - The time recorded for a transform includes parsing and creating source code<br>
> - replacements.<br>
> -<br>
> -.. option:: -serialize-replacements<br>
> -<br>
> - Causes the modernizer to generate replacements and serialize them to disk but<br>
> - not apply them. This can be useful for debugging or for manually running<br>
> - ``clang-apply-replacements``. Replacements are serialized in YAML_ format.<br>
> - By default serialzied replacements are written to a temporary directory whose<br>
> - name is written to stderr when serialization is complete.<br>
> -<br>
> -.. _YAML: <a href="http://www.yaml.org/" rel="noreferrer" target="_blank">http://www.yaml.org/</a><br>
> -<br>
> -.. option:: -serialize-dir=<string><br>
> -<br>
> - Choose a directory to serialize replacements to. The directory must exist.<br>
> -<br>
> -.. _include/exclude options:<br>
> -<br>
> -Path Inclusion/Exclusion Options<br>
> -================================<br>
> -<br>
> -.. option:: -include=<path1>,<path2>,...,<pathN><br>
> -<br>
> - Use this option to indicate which directories contain files that can be<br>
> - changed by the modernizer. Inidividual files may be specified if desired.<br>
> - Multiple paths can be specified as a comma-separated list. Sources mentioned<br>
> - explicitly on the command line are always included so this option controls<br>
> - which other files (e.g. headers) may be changed while transforming<br>
> - translation units.<br>
> -<br>
> -.. option:: -exclude=<path1>,<path2>,...,<pathN><br>
> -<br>
> - Used with ``-include`` to provide finer control over which files and<br>
> - directories can be transformed. Individual files and files within directories<br>
> - specified by this option **will not** be transformed. Multiple paths can be<br>
> - specified as a comma-separated list.<br>
> -<br>
> -.. option:: -include-from=<filename><br>
> -<br>
> - Like ``-include`` but read paths from the given file. Paths should be one per<br>
> - line.<br>
> -<br>
> -.. option:: -exclude-from=<filename><br>
> -<br>
> - Like ``-exclude`` but read paths from the given file. Paths are listed one<br>
> - per line.<br>
> -<br>
> -Formatting Command Line Options<br>
> -===============================<br>
> -<br>
> -.. option:: -format<br>
> -<br>
> - Enable reformatting of code changed by transforms. Formatting is done after<br>
> - every transform.<br>
> -<br>
> -.. option:: -style=<string><br>
> -<br>
> - Specifies how formatting should be done. The behaviour of this option is<br>
> - identical to the same option provided by clang-format_. Refer to<br>
> - `clang-format's style options`_ for more details.<br>
> -<br>
> -.. option:: -style-config=<dir><br>
> -<br>
> - When using ``-style=file``, the default behaviour is to look for<br>
> - ``.clang-format`` starting in the current directory and then in ancestors. To<br>
> - specify a directory to find the style configuration file, use this option.<br>
> -<br>
> -Example:<br>
> -<br>
> -.. code-block:: c++<br>
> - :emphasize-lines: 10-12,18<br>
> -<br>
> - // file.cpp<br>
> - for (std::vector<int>::const_iterator I = my_container.begin(),<br>
> - E = my_container.end();<br>
> - I != E; ++I) {<br>
> - std::cout << *I << std::endl;<br>
> - }<br>
> -<br>
> - // No reformatting:<br>
> - // clang-modernize -use-auto file.cpp<br>
> - for (auto I = my_container.begin(),<br>
> - E = my_container.end();<br>
> - I != E; ++I) {<br>
> - std::cout << *I << std::endl;<br>
> - }<br>
> -<br>
> - // With reformatting enabled:<br>
> - // clang-modernize -format -use-auto file.cpp<br>
> - for (auto I = my_container.begin(), E = my_container.end(); I != E; ++I) {<br>
> - std::cout << *I << std::endl;<br>
> - }<br>
> -<br>
> -.. _clang-format: <a href="http://clang.llvm.org/docs/ClangFormat.html" rel="noreferrer" target="_blank">http://clang.llvm.org/docs/ClangFormat.html</a><br>
> -.. _clang-format's style options: <a href="http://clang.llvm.org/docs/ClangFormatStyleOptions.html" rel="noreferrer" target="_blank">http://clang.llvm.org/docs/ClangFormatStyleOptions.html</a><br>
> -<br>
> -<br>
> -.. _transform-specific-command-line-options:<br>
> -<br>
> -Transform-Specific Command Line Options<br>
> -=======================================<br>
> -<br>
> -.. option:: -loop-convert<br>
> -<br>
> - Makes use of C++11 range-based for loops where possible. See<br>
> - :doc:`LoopConvertTransform`.<br>
> -<br>
> -.. option:: -use-nullptr<br>
> -<br>
> - Makes use of the new C++11 keyword ``nullptr`` where possible.<br>
> - See :doc:`UseNullptrTransform`.<br>
> -<br>
> -.. option:: -user-null-macros=<string><br>
> -<br>
> - ``<string>`` is a comma-separated list of user-defined macros that behave like<br>
> - the ``NULL`` macro. The :option:`-use-nullptr` transform will replace these<br>
> - macros along with ``NULL``. See :doc:`UseNullptrTransform`.<br>
> -<br>
> -.. option:: -use-auto<br>
> -<br>
> - Replace the type specifier of variable declarations with the ``auto`` type<br>
> - specifier. See :doc:`UseAutoTransform`.<br>
> -<br>
> -.. option:: -add-override<br>
> -<br>
> - Adds the override specifier to member functions where it is appropriate. That<br>
> - is, the override specifier is added to member functions that override a<br>
> - virtual function in a base class and that don't already have the specifier.<br>
> - See :doc:`AddOverrideTransform`.<br>
> -<br>
> -.. option:: -override-macros<br>
> -<br>
> - Tells the Add Override Transform to locate a macro that expands to<br>
> - ``override`` and use that macro instead of the ``override`` keyword directly.<br>
> - If no such macro is found, ``override`` is still used. This option enables<br>
> - projects that use such macros to maintain build compatibility with non-C++11<br>
> - code.<br>
> -<br>
> -.. option:: -pass-by-value<br>
> -<br>
> - Replace const-reference parameters by values in situations where it can be<br>
> - beneficial.<br>
> - See :doc:`PassByValueTransform`.<br>
> -<br>
> -.. option:: -replace-auto_ptr<br>
> -<br>
> - Replace ``std::auto_ptr`` (deprecated in C++11) by ``std::unique_ptr`` and<br>
> - wrap calls to the copy constructor and assignment operator with<br>
> - ``std::move()``.<br>
> - See :doc:`ReplaceAutoPtrTransform`.<br>
><br>
> Removed: clang-tools-extra/trunk/docs/PassByValueTransform.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/PassByValueTransform.rst?rev=255885&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/PassByValueTransform.rst?rev=255885&view=auto</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/docs/PassByValueTransform.rst (original)<br>
> +++ clang-tools-extra/trunk/docs/PassByValueTransform.rst (removed)<br>
> @@ -1,165 +0,0 @@<br>
> -.. index:: Pass-By-Value Transform<br>
> -<br>
> -=======================<br>
> -Pass-By-Value Transform<br>
> -=======================<br>
> -<br>
> -The Pass-By-Value Transform makes use of the pass-by-value idiom when possible.<br>
> -<br>
> -With move semantics added to the language and the standard library updated with<br>
> -move constructors added for many types it is now interesting to take an argument<br>
> -directly by value, instead of by const-reference, and then copy. This<br>
> -transformation allows the compiler to take care of choosing the best way to<br>
> -construct the copy.<br>
> -<br>
> -The transformation is usually beneficial when the calling code passes an<br>
> -*rvalue* and assumes the move construction is a cheap operation. This short<br>
> -example illustrates how the construction of the value happens:<br>
> -<br>
> - .. code-block:: c++<br>
> -<br>
> - void foo(std::string s);<br>
> - std::string get_str();<br>
> -<br>
> - void f(const std::string &str) {<br>
> - foo(str); // lvalue -> copy construction<br>
> - foo(get_str()); // prvalue -> move construction<br>
> - }<br>
> -<br>
> -.. note::<br>
> -<br>
> - Currently only constructors are transformed to make use of pass-by-value.<br>
> - Contributions that handle other situations are welcome!<br>
> -<br>
> -<br>
> -Pass-by-value in constructors<br>
> ------------------------------<br>
> -<br>
> -Replaces the uses of const-references constructor parameters that are copied<br>
> -into class fields. The parameter is then moved with `std::move()`.<br>
> -<br>
> -Since `std::move()` is a library function declared in `<utility>` it may be<br>
> -necessary to add this include. The transform will add the include directive when<br>
> -necessary.<br>
> -<br>
> -Example::<br>
> -<br>
> - $ clang-modernize -pass-by-value ctor.cpp<br>
> -<br>
> -**ctor.cpp**<br>
> -<br>
> - .. code-block:: c++<br>
> -<br>
> - #include <string><br>
> -<br>
> - class Foo {<br>
> - public:<br>
> - - Foo(const std::string &Copied, const std::string &ReadOnly)<br>
> - - : Copied(Copied), ReadOnly(ReadOnly)<br>
> - + Foo(std::string Copied, const std::string &ReadOnly)<br>
> - + : Copied(std::move(Copied)), ReadOnly(ReadOnly)<br>
> - {}<br>
> -<br>
> - private:<br>
> - std::string Copied;<br>
> - const std::string &ReadOnly;<br>
> - };<br>
> -<br>
> - std::string get_cwd();<br>
> -<br>
> - void f(const std::string &Path) {<br>
> - // The parameter corresponding to 'get_cwd()' is move-constructed. By<br>
> - // using pass-by-value in the Foo constructor we managed to avoid a<br>
> - // copy-construction.<br>
> - Foo foo(get_cwd(), Path);<br>
> - }<br>
> -<br>
> -<br>
> -If the parameter is used more than once no transformation is performed since<br>
> -moved objects have an undefined state. It means the following code will be left<br>
> -untouched:<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - #include <string><br>
> -<br>
> - void pass(const std::string &S);<br>
> -<br>
> - struct Foo {<br>
> - Foo(const std::string &S) : Str(S) {<br>
> - pass(S);<br>
> - }<br>
> -<br>
> - std::string Str;<br>
> - };<br>
> -<br>
> -<br>
> -Risk<br>
> -^^^^<br>
> -<br>
> -This modification is considered **reasonably safe** (see :option:`-risk`<br>
> -option).<br>
> -<br>
> -A situation where the generated code can be wrong is when the object referenced<br>
> -is modified before the assignment in the init-list through a "hidden" reference.<br>
> -<br>
> -Example:<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - std::string s("foo");<br>
> -<br>
> - struct Base {<br>
> - Base() {<br>
> - s = "bar";<br>
> - }<br>
> - };<br>
> -<br>
> - struct Derived : Base {<br>
> - - Derived(const std::string &S) : Field(S)<br>
> - + Derived(std::string S) : Field(std::move(S))<br>
> - { }<br>
> -<br>
> - std::string Field;<br>
> - };<br>
> -<br>
> - void f() {<br>
> - - Derived d(s); // d.Field holds "bar"<br>
> - + Derived d(s); // d.Field holds "foo"<br>
> - }<br>
> -<br>
> -<br>
> -Note about delayed template parsing<br>
> -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>
> -<br>
> -When delayed template parsing is enabled, constructors part of templated<br>
> -contexts; templated constructors, constructors in class templates, constructors<br>
> -of inner classes of template classes, etc., are not transformed. Delayed<br>
> -template parsing is enabled by default on Windows as a Microsoft extension:<br>
> -`Clang Compiler User’s Manual - Microsoft extensions`_.<br>
> -<br>
> -Delayed template parsing can be enabled using the `-fdelayed-template-parsing`<br>
> -flag and disabled using `-fno-delayed-template-parsing`.<br>
> -<br>
> -Example:<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - template <typename T> class C {<br>
> - std::string S;<br>
> -<br>
> - public:<br>
> - = // using -fdelayed-template-parsing (default on Windows)<br>
> - = C(const std::string &S) : S(S) {}<br>
> -<br>
> - + // using -fno-delayed-template-parsing (default on non-Windows systems)<br>
> - + C(std::string S) : S(std::move(S)) {}<br>
> - };<br>
> -<br>
> -.. _Clang Compiler User’s Manual - Microsoft extensions: <a href="http://clang.llvm.org/docs/UsersManual.html#microsoft-extensions" rel="noreferrer" target="_blank">http://clang.llvm.org/docs/UsersManual.html#microsoft-extensions</a><br>
> -<br>
> -.. seealso::<br>
> -<br>
> - For more information about the pass-by-value idiom, read: `Want Speed? Pass by Value`_.<br>
> -<br>
> - .. _Want Speed? Pass by Value: <a href="http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/" rel="noreferrer" target="_blank">http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/</a><br>
><br>
> Removed: clang-tools-extra/trunk/docs/ReplaceAutoPtrTransform.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/ReplaceAutoPtrTransform.rst?rev=255885&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/ReplaceAutoPtrTransform.rst?rev=255885&view=auto</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/docs/ReplaceAutoPtrTransform.rst (original)<br>
> +++ clang-tools-extra/trunk/docs/ReplaceAutoPtrTransform.rst (removed)<br>
> @@ -1,72 +0,0 @@<br>
> -.. index:: Replace-AutoPtr Transform<br>
> -<br>
> -=========================<br>
> -Replace-AutoPtr Transform<br>
> -=========================<br>
> -<br>
> -The Replace-AutoPtr Transform replaces the uses of the deprecated class<br>
> -``std::auto_ptr`` by ``std::unique_ptr`` (introduced in C++11). The transfer of<br>
> -ownership, done by the copy-constructor and the assignment operator, is changed<br>
> -to match ``std::unique_ptr`` usage by using explicit calls to ``std::move()``.<br>
> -The transform is enabled with the :option:`-replace-auto_ptr` option of<br>
> -:program:`clang-modernize`.<br>
> -<br>
> -Migration example:<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - -void take_ownership_fn(std::auto_ptr<int> int_ptr);<br>
> - +void take_ownership_fn(std::unique_ptr<int> int_ptr);<br>
> -<br>
> - void f(int x) {<br>
> - - std::auto_ptr<int> a(new int(x));<br>
> - - std::auto_ptr<int> b;<br>
> - + std::unique_ptr<int> a(new int(x));<br>
> - + std::unique_ptr<int> b;<br>
> -<br>
> - - b = a;<br>
> - - take_ownership_fn(b);<br>
> - + b = std::move(a);<br>
> - + take_ownership_fn(std::move(b));<br>
> - }<br>
> -<br>
> -<br>
> -Known Limitations<br>
> -=================<br>
> -* If headers modification is not activated or if a header is not allowed to be<br>
> - changed this transform will produce broken code (compilation error), where the<br>
> - the headers' code will stay unchanged while the code using them will be<br>
> - changed.<br>
> -<br>
> -* Client code that declares a reference to an ``std::auto_ptr`` coming from code<br>
> - that can't be migrated (such as a header coming from a 3\ :sup:`rd` party<br>
> - library) will produce a compilation error after migration. This is because the<br>
> - type of the reference will be changed to ``std::unique_ptr`` but the type<br>
> - returned by the library won't change, binding a reference to<br>
> - ``std::unique_ptr`` from an ``std::auto_ptr``. This pattern doesn't make much<br>
> - sense and usually ``std::auto_ptr`` are stored by value (otherwise what is the<br>
> - point in using them instead of a reference or a pointer?).<br>
> -<br>
> - .. code-block:: c++<br>
> -<br>
> - // <3rd-party header...><br>
> - std::auto_ptr<int> get_value();<br>
> - const std::auto_ptr<int> & get_ref();<br>
> -<br>
> - // <calling code (with migration)...><br>
> - -std::auto_ptr<int> a(get_value());<br>
> - +std::unique_ptr<int> a(get_value()); // ok, unique_ptr constructed from auto_ptr<br>
> -<br>
> - -const std::auto_ptr<int> & p = get_ptr();<br>
> - +const std::unique_ptr<int> & p = get_ptr(); // won't compile<br>
> -<br>
> -* Non-instantiated templates aren't modified.<br>
> -<br>
> - .. code-block:: c++<br>
> -<br>
> - template <typename X><br>
> - void f() {<br>
> - std::auto_ptr<X> p;<br>
> - }<br>
> -<br>
> - // only 'f<int>()' (or similar) will trigger the replacement<br>
><br>
> Removed: clang-tools-extra/trunk/docs/UseAutoTransform.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/UseAutoTransform.rst?rev=255885&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/UseAutoTransform.rst?rev=255885&view=auto</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/docs/UseAutoTransform.rst (original)<br>
> +++ clang-tools-extra/trunk/docs/UseAutoTransform.rst (removed)<br>
> @@ -1,137 +0,0 @@<br>
> -.. index:: Use-Auto Transform<br>
> -<br>
> -==================<br>
> -Use-Auto Transform<br>
> -==================<br>
> -<br>
> -The Use-Auto Transform is responsible for using the ``auto`` type specifier for<br>
> -variable declarations to *improve code readability and maintainability*. The<br>
> -transform is enabled with the :option:`-use-auto` option of<br>
> -:program:`clang-modernize`. For example:<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - std::vector<int>::iterator I = my_container.begin();<br>
> -<br>
> - // transforms to:<br>
> -<br>
> - auto I = my_container.begin();<br>
> -<br>
> -The ``auto`` type specifier will only be introduced in situations where the<br>
> -variable type matches the type of the initializer expression. In other words<br>
> -``auto`` should deduce the same type that was originally spelled in the source.<br>
> -However, not every situation should be transformed:<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - int val = 42;<br>
> - InfoStruct &I = SomeObject.getInfo();<br>
> -<br>
> - // Should not become:<br>
> -<br>
> - auto val = 42;<br>
> - auto &I = SomeObject.getInfo();<br>
> -<br>
> -In this example using ``auto`` for builtins doesn't improve readability. In<br>
> -other situations it makes the code less self-documenting impairing readability<br>
> -and maintainability. As a result, ``auto`` is used only introduced in specific<br>
> -situations described below.<br>
> -<br>
> -Iterators<br>
> -=========<br>
> -<br>
> -Iterator type specifiers tend to be long and used frequently, especially in<br>
> -loop constructs. Since the functions generating iterators have a common format,<br>
> -the type specifier can be replaced without obscuring the meaning of code while<br>
> -improving readability and maintainability.<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - for (std::vector<int>::iterator I = my_container.begin(),<br>
> - E = my_container.end();<br>
> - I != E; ++I) {<br>
> - }<br>
> -<br>
> - // becomes<br>
> -<br>
> - for (auto I = my_container.begin(), E = my_container.end(); I != E; ++I) {<br>
> - }<br>
> -<br>
> -The transform will only replace iterator type-specifiers when all of the<br>
> -following conditions are satisfied:<br>
> -* The iterator is for one of the standard container in ``std`` namespace:<br>
> -<br>
> - * ``array``<br>
> -<br>
> - * ``deque``<br>
> -<br>
> - * ``forward_list``<br>
> -<br>
> - * ``list``<br>
> -<br>
> - * ``vector``<br>
> -<br>
> - * ``map``<br>
> -<br>
> - * ``multimap``<br>
> -<br>
> - * ``set``<br>
> -<br>
> - * ``multiset``<br>
> -<br>
> - * ``unordered_map``<br>
> -<br>
> - * ``unordered_multimap``<br>
> -<br>
> - * ``unordered_set``<br>
> -<br>
> - * ``unordered_multiset``<br>
> -<br>
> - * ``queue``<br>
> -<br>
> - * ``priority_queue``<br>
> -<br>
> - * ``stack``<br>
> -<br>
> -* The iterator is one of the possible iterator types for standard containers:<br>
> -<br>
> - * ``iterator``<br>
> -<br>
> - * ``reverse_iterator``<br>
> -<br>
> - * ``const_iterator``<br>
> -<br>
> - * ``const_reverse_iterator``<br>
> -<br>
> -* In addition to using iterator types directly, typedefs or other ways of<br>
> - referring to those types are also allowed. However, implementation-specific<br>
> - types for which a type like ``std::vector<int>::iterator`` is itself a<br>
> - typedef will not be transformed. Consider the following examples:<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - // The following direct uses of iterator types will be transformed.<br>
> - std::vector<int>::iterator I = MyVec.begin();<br>
> - {<br>
> - using namespace std;<br>
> - list<int>::iterator I = MyList.begin();<br>
> - }<br>
> -<br>
> - // The type specifier for J would transform to auto since it's a typedef<br>
> - // to a standard iterator type.<br>
> - typedef std::map<int, std::string>::const_iterator map_iterator;<br>
> - map_iterator J = MyMap.begin();<br>
> -<br>
> - // The following implementation-specific iterator type for which<br>
> - // std::vector<int>::iterator could be a typedef would not be transformed.<br>
> - __gnu_cxx::__normal_iterator<int*, std::vector> K = MyVec.begin();<br>
> -<br>
> -* The initializer for the variable being declared is not a braced initializer<br>
> - list. Otherwise, use of ``auto`` would cause the type of the variable to be<br>
> - deduced as``std::initializer_list``.<br>
> -<br>
> -Known Limitations<br>
> -=================<br>
> -* If the initializer is an explicit conversion constructor, the transform will<br>
> - not replace the type specifier even though it would be safe to do so.<br>
> -* User-defined iterators are not handled at this time.<br>
><br>
> Removed: clang-tools-extra/trunk/docs/UseNullptrTransform.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/UseNullptrTransform.rst?rev=255885&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/UseNullptrTransform.rst?rev=255885&view=auto</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/docs/UseNullptrTransform.rst (original)<br>
> +++ clang-tools-extra/trunk/docs/UseNullptrTransform.rst (removed)<br>
> @@ -1,82 +0,0 @@<br>
> -.. index:: Use-Nullptr Transform<br>
> -<br>
> -=====================<br>
> -Use-Nullptr Transform<br>
> -=====================<br>
> -<br>
> -The Use-Nullptr Transform is a transformation to convert the usage of null<br>
> -pointer constants (eg. ``NULL``, ``0``) to use the new C++11 ``nullptr``<br>
> -keyword. The transform is enabled with the :option:`-use-nullptr` option of<br>
> -:program:`clang-modernize`.<br>
> -<br>
> -Example<br>
> -=======<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - void assignment() {<br>
> - char *a = NULL;<br>
> - char *b = 0;<br>
> - char c = 0;<br>
> - }<br>
> -<br>
> - int *ret_ptr() {<br>
> - return 0;<br>
> - }<br>
> -<br>
> -<br>
> -transforms to:<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - void assignment() {<br>
> - char *a = nullptr;<br>
> - char *b = nullptr;<br>
> - char c = 0;<br>
> - }<br>
> -<br>
> - int *ret_ptr() {<br>
> - return nullptr;<br>
> - }<br>
> -<br>
> -<br>
> -User defined macros<br>
> -===================<br>
> -<br>
> -By default this transform will only replace the ``NULL`` macro and will skip any<br>
> -user-defined macros that behaves like ``NULL``. The user can use the<br>
> -:option:`-user-null-macros` option to specify a comma-separated list of macro<br>
> -names that will be transformed along with ``NULL``.<br>
> -<br>
> -Example<br>
> --------<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - #define MY_NULL (void*)0<br>
> - void assignment() {<br>
> - void *p = MY_NULL;<br>
> - }<br>
> -<br>
> -<br>
> -using the command-line<br>
> -<br>
> -.. code-block:: bash<br>
> -<br>
> - clang-modernize -use-nullptr -user-null-macros=MY_NULL foo.cpp<br>
> -<br>
> -<br>
> -transforms to:<br>
> -<br>
> -.. code-block:: c++<br>
> -<br>
> - #define MY_NULL NULL<br>
> - void assignment() {<br>
> - int *p = nullptr;<br>
> - }<br>
> -<br>
> -<br>
> -Risk<br>
> -====<br>
> -<br>
> -:option:`-risk` has no effect in this transform.<br>
><br>
> Modified: clang-tools-extra/trunk/docs/clang-modernize.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-modernize.rst?rev=255886&r1=255885&r2=255886&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-modernize.rst?rev=255886&r1=255885&r2=255886&view=diff</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/docs/clang-modernize.rst (original)<br>
> +++ clang-tools-extra/trunk/docs/clang-modernize.rst Thu Dec 17 05:49:19 2015<br>
> @@ -1,112 +1,2 @@<br>
> -.. index:: clang-modernize<br>
> -<br>
> -.. note::<br>
> -<br>
> - **Deprecation**<br>
> -<br>
> - As of September 2015 all :program:`clang-modernize` transforms have been<br>
> - ported to :doc:`clang-tidy/index`. :program:`clang-modernize` is deprecated<br>
> - and is going to be removed soon.<br>
> -<br>
> -<br>
> -==================================<br>
> -Clang C++ Modernizer User's Manual<br>
> -==================================<br>
> -<br>
> -.. toctree::<br>
> - :hidden:<br>
> -<br>
> - UseAutoTransform<br>
> - UseNullptrTransform<br>
> - LoopConvertTransform<br>
> - AddOverrideTransform<br>
> - PassByValueTransform<br>
> - ReplaceAutoPtrTransform<br>
> - ModernizerUsage<br>
> - cpp11-migrate<br>
> - MigratorUsage<br>
> -<br>
> -:program:`clang-modernize` is a standalone tool used to automatically convert<br>
> -C++ code written against old standards to use features of the newest C++<br>
> -standard where appropriate.<br>
> -<br>
> -Getting Started<br>
> -===============<br>
> -<br>
> -To build from source:<br>
> -<br>
> -1. Read `Getting Started with the LLVM System`_ and `Clang Tools<br>
> - Documentation`_ for information on getting sources for LLVM, Clang, and<br>
> - Clang Extra Tools.<br>
> -<br>
> -2. `Getting Started with the LLVM System`_ and `Building LLVM with CMake`_ give<br>
> - directions for how to build. With sources all checked out into the<br>
> - right place the LLVM build will build Clang Extra Tools and their<br>
> - dependencies automatically.<br>
> -<br>
> - * If using CMake, you can also use the ``clang-modernize`` target to build<br>
> - just the Modernizer and its dependencies.<br>
> -<br>
> -Before continuing, take a look at :doc:`ModernizerUsage` to see how to invoke<br>
> -the Modernizer.<br>
> -<br>
> -Before running the Modernizer on code you'll need the arguments you'd normally<br>
> -pass to the compiler. If you're migrating a single file with few compiler<br>
> -arguments, it might be easier to pass the compiler args on the command line<br>
> -after ``--``. If you don't have any compiler arguments then ``--`` is not needed.<br>
> -If you're working with multiple files or even a single file with many compiler<br>
> -args, it's probably best to use a *compilation database*.<br>
> -<br>
> -A `compilation database`_ contains the command-line arguments for multiple<br>
> -files. If the code you want to transform can be built with CMake, you can<br>
> -generate this database easily by running CMake with the<br>
> -``-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`` option. The Ninja_ build system, since<br>
> -v1.2, can create this file too using the *compdb* tool: ``ninja -t compdb``. If<br>
> -you're not already using either of these tools or cannot easily make use of<br>
> -them you might consider looking into Bear_.<br>
> -<br>
> -In addition to the compiler arguments you usually build your code with, you must<br>
> -provide the option for enabling C++11 features. For clang and versions of gcc<br>
> -≥ v4.8 this is ``-std=c++11``.<br>
> -<br>
> -With compiler arguments in hand, the modernizer can be applied to sources. Each<br>
> -transform is applied to all sources before the next transform. All the changes<br>
> -generated by each transform pass are serialized to disk and applied using<br>
> -``clang-apply-replacements``. This executable must be located on the ``PATH``<br>
> -or be present in the same directory as the ``clang-modernizer`` executable. If<br>
> -any changes fail to apply, the modernizer will **not** proceed to the next<br>
> -transform and will halt.<br>
> -<br>
> -There's a small chance that changes made by a transform will produce code that<br>
> -doesn't compile, also causing the modernizer to halt. This can happen with<br>
> -bugs in the transforms or use of the pre-processor to make the same code behave<br>
> -differently between translation units. Before logging a bug, be sure which<br>
> -situation you are dealing with.<br>
> -<br>
> -.. _Ninja: <a href="http://martine.github.io/ninja/" rel="noreferrer" target="_blank">http://martine.github.io/ninja/</a><br>
> -.. _Bear: <a href="https://github.com/rizsotto/Bear" rel="noreferrer" target="_blank">https://github.com/rizsotto/Bear</a><br>
> -.. _compilation database: <a href="http://clang.llvm.org/docs/JSONCompilationDatabase.html" rel="noreferrer" target="_blank">http://clang.llvm.org/docs/JSONCompilationDatabase.html</a><br>
> -.. _Getting Started with the LLVM System: <a href="http://llvm.org/docs/GettingStarted.html" rel="noreferrer" target="_blank">http://llvm.org/docs/GettingStarted.html</a><br>
> -.. _Building LLVM with CMake: <a href="http://llvm.org/docs/CMake.html" rel="noreferrer" target="_blank">http://llvm.org/docs/CMake.html</a><br>
> -.. _Clang Tools Documentation: <a href="http://clang.llvm.org/docs/ClangTools.html" rel="noreferrer" target="_blank">http://clang.llvm.org/docs/ClangTools.html</a><br>
> -<br>
> -<br>
> -.. _transforms:<br>
> -<br>
> -Transformations<br>
> -===============<br>
> -<br>
> -The Modernizer is a collection of independent transforms which can be<br>
> -independently enabled. The transforms currently implemented are:<br>
> -<br>
> -* :doc:`LoopConvertTransform`<br>
> -<br>
> -* :doc:`UseNullptrTransform`<br>
> -<br>
> -* :doc:`UseAutoTransform`<br>
> -<br>
> -* :doc:`AddOverrideTransform`<br>
> -<br>
> -* :doc:`PassByValueTransform`<br>
> -<br>
> -* :doc:`ReplaceAutoPtrTransform`<br>
> +All :program:`clang-modernize` transforms have moved to :doc:`clang-tidy/index`<br>
> +(see the ``modernize`` module).<br>
><br>
> Modified: clang-tools-extra/trunk/docs/cpp11-migrate.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/cpp11-migrate.rst?rev=255886&r1=255885&r2=255886&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/cpp11-migrate.rst?rev=255886&r1=255885&r2=255886&view=diff</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/docs/cpp11-migrate.rst (original)<br>
> +++ clang-tools-extra/trunk/docs/cpp11-migrate.rst Thu Dec 17 05:49:19 2015<br>
> @@ -1,5 +1,2 @@<br>
> -============================<br>
> -C++11 Migrator User's Manual<br>
> -============================<br>
> -<br>
> -This tool has been renamed :doc:`clang-modernize <clang-modernize>`.<br>
> +All :program:`clang-modernize` transforms have moved to :doc:`clang-tidy/index`<br>
> +(see the ``modernize`` module).<br>
><br>
> Modified: clang-tools-extra/trunk/docs/index.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/index.rst?rev=255886&r1=255885&r2=255886&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/index.rst?rev=255886&r1=255885&r2=255886&view=diff</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/docs/index.rst (original)<br>
> +++ clang-tools-extra/trunk/docs/index.rst Thu Dec 17 05:49:19 2015<br>
> @@ -15,7 +15,6 @@ Contents<br>
> .. toctree::<br>
> :maxdepth: 1<br>
><br>
> - clang-modernize<br>
> clang-tidy/index<br>
> modularize<br>
> pp-trace<br>
><br>
> Modified: clang-tools-extra/trunk/test/CMakeLists.txt<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/CMakeLists.txt?rev=255886&r1=255885&r2=255886&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/CMakeLists.txt?rev=255886&r1=255885&r2=255886&view=diff</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/test/CMakeLists.txt (original)<br>
> +++ clang-tools-extra/trunk/test/CMakeLists.txt Thu Dec 17 05:49:19 2015<br>
> @@ -36,7 +36,6 @@ set(CLANG_TOOLS_TEST_DEPS<br>
><br>
> # Individual tools we test.<br>
> clang-apply-replacements<br>
> - clang-modernize<br>
> clang-rename<br>
> clang-query<br>
> clang-tidy<br>
><br>
> Modified: clang-tools-extra/trunk/unittests/CMakeLists.txt<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/CMakeLists.txt?rev=255886&r1=255885&r2=255886&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/CMakeLists.txt?rev=255886&r1=255885&r2=255886&view=diff</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/unittests/CMakeLists.txt (original)<br>
> +++ clang-tools-extra/trunk/unittests/CMakeLists.txt Thu Dec 17 05:49:19 2015<br>
> @@ -6,7 +6,6 @@ function(add_extra_unittest test_dirname<br>
> endfunction()<br>
><br>
> add_subdirectory(clang-apply-replacements)<br>
> -add_subdirectory(clang-modernize)<br>
> add_subdirectory(clang-rename)<br>
> add_subdirectory(clang-query)<br>
> add_subdirectory(clang-tidy)<br>
><br>
> Modified: clang-tools-extra/trunk/unittests/Makefile<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/Makefile?rev=255886&r1=255885&r2=255886&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/Makefile?rev=255886&r1=255885&r2=255886&view=diff</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/unittests/Makefile (original)<br>
> +++ clang-tools-extra/trunk/unittests/Makefile Thu Dec 17 05:49:19 2015<br>
> @@ -10,6 +10,6 @@<br>
> CLANG_LEVEL := ../../..<br>
> include $(CLANG_LEVEL)/../../Makefile.config<br>
><br>
> -PARALLEL_DIRS := clang-apply-replacements clang-modernize clang-query clang-tidy clang-rename<br>
> +PARALLEL_DIRS := clang-apply-replacements clang-query clang-tidy clang-rename<br>
><br>
> include $(CLANG_LEVEL)/Makefile<br>
><br>
> Removed: clang-tools-extra/trunk/unittests/include/common/Utility.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/include/common/Utility.h?rev=255885&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/include/common/Utility.h?rev=255885&view=auto</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/unittests/include/common/Utility.h (original)<br>
> +++ clang-tools-extra/trunk/unittests/include/common/Utility.h (removed)<br>
> @@ -1,25 +0,0 @@<br>
> -//=-- clang-modernize/Utility.h - Utility functions and macros---*- C++ -*-===//<br>
> -//<br>
> -// The LLVM Compiler Infrastructure<br>
> -//<br>
> -// This file is distributed under the University of Illinois Open Source<br>
> -// License. See LICENSE.TXT for details.<br>
> -//<br>
> -//===----------------------------------------------------------------------===//<br>
> -<br>
> -#ifndef CLANG_MODERNIZE_UNITTESTS_UTILITY_H<br>
> -#define CLANG_MODERNIZE_UNITTESTS_UTILITY_H<br>
> -<br>
> -// FIXME: copied from unittests/Support/Path.cpp<br>
> -#define ASSERT_NO_ERROR(x) \<br>
> - if (std::error_code ASSERT_NO_ERROR_ec = x) { \<br>
> - llvm::SmallString<128> MessageStorage; \<br>
> - llvm::raw_svector_ostream Message(MessageStorage); \<br>
> - Message << #x ": did not return errc::success.\n" \<br>
> - << "error number: " << ASSERT_NO_ERROR_ec.value() << "\n" \<br>
> - << "error message: " << ASSERT_NO_ERROR_ec.message() << "\n"; \<br>
> - GTEST_FATAL_FAILURE_(MessageStorage.c_str()); \<br>
> - } else { \<br>
> - }<br>
> -<br>
> -#endif // CLANG_MODERNIZE_UNITTESTS_UTILITY_H<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>