Added new pair of Driver options -mcomment-section and -mno-comment-section that add the full command-line used for the invocation to the output file.
-mcomment-section is the default, and enables the feature.
For C/C++ files, the information is added to:
- The .comment section of the ELF file for ELF format output
- As .ident directives for -S output
- As llvm.ident tags for LLVM IR output
For assembly source files, the information is added to the .comment section of the ELF file for ELF format outputs only.
Having the feature on by default requires modifying several clang tests that use -### to check the command-line, and replacing -### with -### -mno-comment-section to avoid false positive and false negative checks.
An alternative implementation would be to have -mno-comment-section as the default. This would avoid the need to modify a large number of tests.
Python has been added to the config file for the clang tests, as helper scripts are required to make sure that the command-line options added using this feature match the input, and to check that the version information string is correct.
I wonder if this also works if the original compiler invokation included a ";" ? Something like (in a Unix like shell)