Command lines with multiple -arch arguments expand into multiple entries in the compilation database. However, the file writes are not appending, meaning subsequent writes end up overwriting the previous ones, resulting in garbled output.
This patch fixes that by always appending to the file.
rdar://90165004
I think if OPT_v then OPT_driver_only should call C.getJobs().Print() somehow... ideally, using the logic that's at the top of Compilation::ExecuteCommand(), also implementing the analogous CCPrintOptions, but that looks potentially awkward... you maybe want to call ExecuteJobs below with a flag that says "don't execute" or something.
Happy for those things to come in a follow-up though; just leave behind FIXME(s) if so.