[Lldb-commits] [PATCH] D33241: Add Status -- llvm::Error glue
Zachary Turner via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue May 16 16:35:22 PDT 2017
zturner added inline comments.
================
Comment at: source/Utility/Status.cpp:81-88
+Status::operator llvm::Error() {
+ if (Success())
+ return llvm::Error::success();
+ if (m_type == ErrorType::eErrorTypePOSIX)
+ return llvm::errorCodeToError(std::error_code(m_code, std::generic_category()));
+ return llvm::make_error<llvm::StringError>(AsCString(),
+ llvm::inconvertibleErrorCode());
----------------
zturner wrote:
> Delete in favor of an `LLDBError` class as mentioned before.
Actually this doesn't really work, because you don't want to call `make_error<LLDBError>(S)` if `S` is a success condition.
So perhaps instead, I would at least call it something more explicit. `llvm::Error toError() const` perhaps.
https://reviews.llvm.org/D33241
More information about the lldb-commits
mailing list