Diagnostics that happen during driver time do not have color output
support unless -fcolor-diagonostic is explicitly passed into the driver.
OTOH, it works great for cc1 mode since dianostic arguments are properly
handled and color is enabled by default if the terminal supports it.
This patch fix this behavior by using the same logic present in -cc1
argument construction to decide whether it should use colors. I tried to
find a way to refactor this logic into a common place that could be used
from both lib/Driver/Tools.cpp and lib/Frontend/CompilerInvocation.cpp,
but could not see any options besides libBasic, which also seems wrong
because it's not the ideal place to put options parsing code either. So
I duplicated part of the logic and changed some driver unrelated logic.
(look for ShowColors in lib/Driver/Tools.cpp for details). Ideas welcome.
I do not see a way to write a testcase for this.