This patch is the LLVM part of the differential:
Link
If -grecord-gcc-switches is set, DW_AT_producer will be combination of DICompileUnit::Producer and Flags.
Also considering if it is good to create a new dwarf variable like DW_AT_flags to store the command line options.
Since on Darwin, it will create a DW_AT_APPLE_flags to store options.
Looks like we're creating a StringRef to a temporary string here, which will give us undefined behavior when we use it on line 431. Please see http://llvm.org/docs/ProgrammersManual.html#llvm-adt-stringref-h .