[PATCH] D30536: [tablegen][globalisel] Convert the SelectionDAG importer to a tree walking approach. NFC

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 10:49:01 PDT 2017


dsanders added a comment.

In https://reviews.llvm.org/D30536#713232, @ab wrote:

> > If a function always returns an Error, what does it return on success? It would be strange to have an Error that is not an error.
>
> It returns Error::success().  The name is somewhat awkward, but think of it as a replacement for the old-style 'int' return values, or c++ std::error_code.  There are a few examples in http://llvm.org/docs/ProgrammersManual.html#recoverable-errors.


Hmm, I'm not keen returning an Error that represents success or using multiple error handling strategies for one family of functions. That said, the former is an established idiom and I suppose I could deal with the latter by renaming to createAndImport*() for the ones that return an Expected<X> and keeping import*() for the ones that return Error.

I'll commit a follow-up tomorrow to make that change.


Repository:
  rL LLVM

https://reviews.llvm.org/D30536





More information about the llvm-commits mailing list