This patch is written on top of D155561 and D155562, but it can be
rebased and applied first, with the other two coming in on top of
this as well.
I'm undecided about whether this is a good thing or not. The duplicated
logic is clearly not great. But this on the other hand includes a lot
of very obscure variable setting that only makes sense in the context
of the *-clangcl.cfg.in files.