diff options
author | Scott Linder <scott@scottlinder.com> | 2018-12-14 15:38:15 +0000 |
---|---|---|
committer | Scott Linder <scott@scottlinder.com> | 2018-12-14 15:38:15 +0000 |
commit | de6beb02a530a8da6e0525e99b9c1ab24252064e (patch) | |
tree | 23a53e12d9046af6eb2e210c8cf2b20816819193 /clang/docs | |
parent | eed7b2eeca6ee764ee3560c66f496cead2247b39 (diff) |
Implement -frecord-command-line (-frecord-gcc-switches)
Implement options in clang to enable recording the driver command-line
in an ELF section.
Implement a new special named metadata, llvm.commandline, to support
frontends embedding their command-line options in IR/ASM/ELF.
This differs from the GCC implementation in some key ways:
* In GCC there is only one command-line possible per compilation-unit,
in LLVM it mirrors llvm.ident and multiple are allowed.
* In GCC individual options are separated by NULL bytes, in LLVM entire
command-lines are separated by NULL bytes. The advantage of the GCC
approach is to clearly delineate options in the face of embedded
spaces. The advantage of the LLVM approach is to support merging
multiple command-lines unambiguously, while handling embedded spaces
with escaping.
Differential Revision: https://reviews.llvm.org/D54487
Clang Differential Revision: https://reviews.llvm.org/D54489
llvm-svn: 349155
Diffstat (limited to 'clang/docs')
-rw-r--r-- | clang/docs/ClangCommandLineReference.rst | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/docs/ClangCommandLineReference.rst b/clang/docs/ClangCommandLineReference.rst index 540c8527d280..61abd05e0cc9 100644 --- a/clang/docs/ClangCommandLineReference.rst +++ b/clang/docs/ClangCommandLineReference.rst @@ -792,6 +792,16 @@ Don't use blacklist file for sanitizers .. option:: -fparse-all-comments +.. option:: -frecord-command-line, -frecord-gcc-switches, -fno-record-command-line, -fno-record-gcc-switches + +Generate a section named ".GCC.command.line" containing the clang driver +command-line. After linking, the section may contain multiple command lines, +which will be individually terminated by null bytes. Separate arguments within +a command line are combined with spaces; spaces and backslashes within an +argument are escaped with backslashes. This format differs from the format of +the equivalent section produced by GCC with the -frecord-gcc-switches flag. +This option is currently only supported on ELF targets. + .. option:: -fsanitize-address-field-padding=<arg> Level of field padding for AddressSanitizer @@ -2831,7 +2841,7 @@ Embed source text in DWARF debug sections .. option:: -gpubnames, -gno-pubnames -.. option:: -grecord-gcc-switches, -gno-record-gcc-switches +.. option:: -grecord-command-line, -grecord-gcc-switches, -gno-record-command-line, -gno-record-gcc-switches .. option:: -gsplit-dwarf |