[raw_ostream] When printing color on Windows, use correct bg color.
authorZachary Turner <zturner@google.com>
Sat, 28 Feb 2015 19:08:27 +0000 (19:08 +0000)
committerZachary Turner <zturner@google.com>
Sat, 28 Feb 2015 19:08:27 +0000 (19:08 +0000)
commita0a46d15952124de09651c8d7c855fd2543068c4
treecc9e05b1278c1194012108ac8d7e5b8bbbb6dba4
parentae27891f8e2528f0006e849ee34c1106b8d86425
[raw_ostream] When printing color on Windows, use correct bg color.

When using SetConsoleTextAttribute() to set the foreground or
background color, if you don't explicitly set both colors, then
a default value of black will be chosen for whichever you don't
specify a value for.

This is annoying when you have a non default console background
color, for example, and you try to set the foreground color.

This patch gets the existing fg/bg color and when you set one
attribute, sets the opposite attribute to its existing color
prior to comitting the update.

Reviewed by: Aaron Ballman
Differential Revision: http://reviews.llvm.org/D7967

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230859 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Windows/Process.inc