blob: 76385eeab88f3d5550aa2033ab0f7290d444b0df [file] [log] [blame]
Edwin Vanee4e7c242013-03-09 03:33:50 +00001.. index:: cpp11-migrate
2
Edwin Vane30f70042013-02-25 20:37:03 +00003===========================
4cpp11-migrate User's Manual
5===========================
6
Edwin Vane3b9f08d2013-03-08 23:26:00 +00007.. toctree::
8 :hidden:
9
10 UseAutoTransform
Edwin Vanee4e7c242013-03-09 03:33:50 +000011 UseNullptrTransform
12 LoopConvertTransform
Edwin Vane3b9f08d2013-03-08 23:26:00 +000013
Edwin Vane30f70042013-02-25 20:37:03 +000014:program:`cpp11-migrate` is a standalone tool used to automatically convert
15C++98 and C++03 code to use features of the new C++11 standard where
16appropriate.
17
18Basic Usage
19===========
20
21``cpp11-migrate [options] <source0> [... <sourceN>]``
22
23``<source0>...`` specify the paths of files in the CMake source tree,
24with the same requirements as other tools built on LibTooling.
25
26Command Line Options
27--------------------
28
29.. option:: -fatal-assembler-warnings
30
31 Treat all compiler warnings as errors.
32
33.. option:: -help
34
35 Displays tool usage instructions and command line options.
36
37.. option:: -loop-convert
38
Edwin Vanee4e7c242013-03-09 03:33:50 +000039 Makes use of C++11 range-based for loops where possible. See
40 :doc:`LoopConvertTransform`.
41
42.. option:: -use-nullptr
43
44 Makes use of the new C++11 keyword ``nullptr`` where possible.
45 See :doc:`UseNullptrTransform`.
Edwin Vane30f70042013-02-25 20:37:03 +000046
Edwin Vane3b9f08d2013-03-08 23:26:00 +000047.. option:: -use-auto
48
49 Replace the type specifier of variable declarations with the ``auto`` type
50 specifier. See :doc:`UseAutoTransform`.
51
Edwin Vane30f70042013-02-25 20:37:03 +000052.. option:: -p=<build-path>
53
54 ``<build-path>`` is a CMake build directory containing a file named
55 ``compile_commands.json`` which provides compiler options for building
56 each source file and can be generated by specifying
57 ``-DCMAKE_EXPORT_COMPILE_COMMANDS`` when running CMake. If ``<build-path>``
58 is not provided the ``compile_commands.json`` file is searched for through
59 all parent directories.
60
61 Alternatively, one can provide compile options to be applied to every
62 source file after the optional ``--``.
63
64.. option:: -risk=<risk-level>
65
66 Some transformations may cause a change in semantics. In such cases the
67 maximum acceptable risk level specified through the ``-risk`` command
68 line option decides whether or not a transformation is applied.
69
70 Three different risk level options are available:
71
72 ``-risk=safe``
73 Perform only safe transformations.
74 ``-risk=reasonable`` (default)
75 Enable transformations that may change semantics.
76 ``-risk=risky``
77 Enable transformations that are likely to change semantics.
78
Edwin Vanee4e7c242013-03-09 03:33:50 +000079 The meaning of risk is handled differently for each transform. See
80 :ref:`transform documentation <transforms>` for details.
Edwin Vane30f70042013-02-25 20:37:03 +000081
Edwin Vane30f70042013-02-25 20:37:03 +000082
83.. option:: -version
84
85 Displays the version information of this tool.
86
Edwin Vanee4e7c242013-03-09 03:33:50 +000087.. _transforms:
Edwin Vane30f70042013-02-25 20:37:03 +000088
89Transformations
90===============
91
Edwin Vanee4e7c242013-03-09 03:33:50 +000092* :doc:`LoopConvertTransform`
Edwin Vane30f70042013-02-25 20:37:03 +000093
Edwin Vanee4e7c242013-03-09 03:33:50 +000094* :doc:`UseNullptrTransform`
Edwin Vane30f70042013-02-25 20:37:03 +000095
Edwin Vanee4e7c242013-03-09 03:33:50 +000096* :doc:`UseAutoTransform`