[PATCH] D49013: [Support] Allow formatv() to consume llvm::Error by-value without crashing.

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 10 08:57:45 PDT 2018


sammccall added a comment.

In https://reviews.llvm.org/D49013#1157440, @zturner wrote:

> In the samples you gave in the original code review, it was always just
>  `formatv(“Error: {0}”, E);`
>
> Is it always this simple and consistent?  Or do you frequently construct
>  complex messages with many other parameters in the same format string?  If
>  it’s always (or even often) that simple, maybe you just need a function
>  like void `logError(Error E)`


No, there are custom messages and other parameters.
First example from the initial migration in https://reviews.llvm.org/D49008:
`elog("Failed to update {0}: {1}", File, Contents.takeError());`

(where elog forwards its args to `formatv` and then sends the results to the current logger)


Repository:
  rL LLVM

https://reviews.llvm.org/D49013





More information about the llvm-commits mailing list