This is a chromium related bug, referred to: Link
I created this bug and updated the info on bugzilla, please refer to: Link
GCC provides -grecord-gcc-switches option, which is set on as default, to record user command line options and store them DW_AT_producer in DWARF file.
While DW_AT_producer in clang only records the full version info of current clang.
The implementation enabled the -grecord-gcc-switches option. When user turn it on, driver will record the arguments from command line and reuse CC1Option
"-dwarf-debug-flags".
Finally the CGDebugInfo could access the CodeGenOptions of "-dwarf-debug-flags" from and set Producer to clang full version plus command line options.
Nit: can we use a SmallString<256> that we initialize to "-record-cmd-opts=" instead?