Adds diagnostic output functions to enable Visual Studio
compatibility with the flag --vs-diagnostics. Clang has a
flag which enables similar support, see
"-fdiagnostics-format=clang/msvc/vi" described
in https://clang.llvm.org/docs/UsersManual.html.
The existing diagnostics output format for warning and error messages is
not fully compatible with Visual Studio (VS) and can even cause VS to become
unresponsive.
The format accepted by VS
(https://msdn.microsoft.com/en-us/library/yxkt8b26.aspx):
{filename (line# [, column#]) | toolname} : [any text] {error | warning}
code####:localizable string [ any text ]
or more simply:
Origin : {warning|error} code#### : Message
The current default lld format uses the lld executable path for Origin.
Clicking the message inside VS will lead to a hang or long delay as VS
attempts to access the executable as a source code origin. Additionally, the
line and column information accepted by VS differs from the lld format.
I've included an additional lit test to ensure diagnostics output in
--vs-diagnostics mode is as expected. All existing lit tests that check
diagnostic output also help ensure that the previous lld output format
is maintained when the flag is not enabled.
s/paranthesised/parenthesized/