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

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 13 15:39:58 PDT 2018


inglorion added inline comments.


================
Comment at: include/lld/Common/ErrorHandler.h:75-76
+}
+inline LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg,
+                                          const Twine &Origin = "") {
+  errorHandler().fatal(Msg, Origin);
----------------
chrisjackson wrote:
> ruiu wrote:
> > I don't like a function with a default argument as it is too easy to mess up. People casually add additional parameters to existing functions, and the result would be a function that has tons of parameters. Please avoid doing this if possible.
> I left a a default argument so that existing error() and warn() calls needn't be changed. The message output from existing single parameter calls will therefore not be altered by the addition of the VS compatibility mode. I experimented with forcing a message and src parameter but this means every warn() and error() call site must have a source parameter created.
@ruiu, do you have an alternative proposal? A good number of calls to error() and fatal() have file information, and a good number don't. Unless we want to convert all of those to have file information (what is the file information for an unrecognized command line option?), we need to support both of these cases. There are several ways we could do this, so I'm curious what you have in mind.


https://reviews.llvm.org/D47540





More information about the llvm-commits mailing list