[PATCH] D52143: Make initializeOutputStream() return false on error and true on success.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 15 18:19:54 PDT 2018


False on Error os more common and in fact there has been some effort in
llvm to standardize. Several support functions have been changed in the
past because false on success is so confusing. If the function returns an
int (status) or an error that’s a different story, but with a bool false on
error and true on success I think has been generally agreed upon to be what
we should be doing for new code. Not formally in any kind of mailing list
discussion, but it’s come up in several reviews (just that I’ve seen) and
functions have been changed or rewritten to return false on failure
On Sat, Sep 15, 2018 at 6:02 PM Erik Pilkington via Phabricator <
reviews at reviews.llvm.org> wrote:

> erik.pilkington added a comment.
>
> I'd like to know what the LLVM position is here before accepting a style
> patch like this. I can think of some VIPs (Very Important Procedures) that
> use either style, but my impression is that true on error is more common,
> which is why I wrote this function (and a bunch of other functions in the
> itanium demangler) like this. If you and @zturner feel strongly about this
> then I don't really mind either way. If you're interested in this issue
> then I think the right thing to do would be to get the LLVM community to
> standardize on one or the other.
>
>
> https://reviews.llvm.org/D52143
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180915/908d341a/attachment.html>


More information about the llvm-commits mailing list