[Lldb-commits] [PATCH] D33241: Add Status -- llvm::Error glue

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue May 16 08:03:54 PDT 2017


labath created this revision.

I tried convert a function to llvm::Error/Expected but I quickly ran into the
issue of interfacing with code that still expects the Status objects.

This is my proposal for conversion functions between the two. I use
constructors and conversion operators on the Status class for the job,
but I make them explicit to make sure they're not converted
accidentally, as they have different semantics. I made sure conversion
preserves the errno error codes (by converting them to std::error_code,
which llvm::Error understands) as we have bits of code which switch
based on the error value. As for the other errors, only the error
message is preserved during the conversion.


https://reviews.llvm.org/D33241

Files:
  include/lldb/Utility/Status.h
  source/Utility/Status.cpp
  unittests/Utility/StatusTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33241.99148.patch
Type: text/x-patch
Size: 4668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170516/e2fdf455/attachment.bin>


More information about the lldb-commits mailing list