[PATCH] D47540: [lld] Enable Visual Studio compatible output

Chris Jackson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 30 09:17:01 PDT 2018


chrisjackson created this revision.
chrisjackson added a reviewer: ruiu.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: espindola.

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.


https://reviews.llvm.org/D47540

Files:
  Common/ErrorHandler.cpp
  ELF/Driver.cpp
  ELF/DriverUtils.cpp
  ELF/InputFiles.cpp
  ELF/Options.td
  ELF/Relocations.cpp
  include/lld/Common/ErrorHandler.h
  test/ELF/vs-diagnostics.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47540.149137.patch
Type: text/x-patch
Size: 10698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180530/c0ad7a6c/attachment-0001.bin>


More information about the llvm-commits mailing list