Skip to content

Commit 95ea436

Browse files
authored
[clang][docs] Add docs for CCC_OVERRIDE_OPTIONS. (#142396)
As was noted in #140556 (comment), there is no documentation for `CCC_OVERRIDE_OPTIONS`. This adds the missing documentation. The information is duplicate of what we have for `FCC_OVERRIDE_OPTIONS` in flang. Once this goes in and available at https://clang.llvm.org/docs/UsersManual.html then the flang documentation can be changed to refer to it.
1 parent 75ec944 commit 95ea436

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

clang/docs/UsersManual.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3743,6 +3743,35 @@ Doxygen-style comments and ignores ordinary comments starting with ``//`` and
37433743
``-fcomment-block-commands=foo -fcomment-block-commands=bar`` does the same
37443744
as above.
37453745

3746+
.. _ccc-override-options:
3747+
3748+
CCC_OVERRIDE_OPTIONS
3749+
--------------------
3750+
The environment variable ``CCC_OVERRIDE_OPTIONS`` can be used to edit clang's
3751+
command line arguments. The value of this variable is a space-separated list of
3752+
edits to perform. The edits are applied in the order in which they appear in
3753+
``CCC_OVERRIDE_OPTIONS``. Each edit should be one of the following forms:
3754+
3755+
- ``#``: Silence information about the changes to the command line arguments.
3756+
3757+
- ``^FOO``: Add ``FOO`` as a new argument at the beginning of the command line
3758+
right after the name of the compiler executable.
3759+
3760+
- ``+FOO``: Add ``FOO`` as a new argument at the end of the command line.
3761+
3762+
- ``s/XXX/YYY/``: Substitute the regular expression ``XXX`` with ``YYY`` in the
3763+
command line.
3764+
3765+
- ``xOPTION``: Removes all instances of the literal argument ``OPTION``.
3766+
3767+
- ``XOPTION``: Removes all instances of the literal argument ``OPTION``, and the
3768+
following argument.
3769+
3770+
- ``Ox``: Removes all flags matching ``O`` or ``O[sz0-9]`` and adds ``Ox`` at
3771+
the end of the command line.
3772+
3773+
This environment variable does not affect the options added by the config files.
3774+
37463775
.. _c:
37473776

37483777
C Language Features

0 commit comments

Comments
 (0)