New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce ResultError
to support Result
-based llvm::Error
s
#1545
Conversation
Test summary for commit 19581efDriver commits used in build
CTS tests (Failed: 0/225388)
Rhel 8.2, Gfx10Ubuntu 18.04, Gfx9Ubuntu 20.04, Gfx8Ubuntu 20.04, Gfx103 |
Introduce a new class `Llpc::ResultError` that implements a `Result`-based `llvm::Error` type. This is primarily to support returning either error results or values with `llvm::Expected<T>`. Also implement the necessary utility functions, and move some existing ones to the new header. I also considered using `llvm::StringError` directly, but this did not work well as some `Vkgc::Result` values do not map well to any `std::errc` error codes, and it was difficult to convert back to `Vkgc::Result`, which many existing APIs expect. See the mailing list thread `[RFC] Improving LLPC Result checking` for the proposal details.
V2: Silence a clang-tidy warning. |
I don’t see these clang-tidy warnings when running it locally, so I guess they will go away once we can update llvm in the containers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Nice - (I especially liked the examples in the header)
The Jenkins run went even more wrong than normal, so I can't see test passes in it. I think we'd better try again. |
retest this please |
Hmm, maybe that doesn't work any more. I'll cherry-pick it to our internal branch and do a test run there; that should give some more confidence. |
Test summary for commit e1d583dDriver commits used in build
CTS tests (Failed: 0/225388)
Rhel 8.2, Gfx10Ubuntu 18.04, Gfx9Ubuntu 20.04, Gfx8Ubuntu 20.04, Gfx103 |
Rex told me how to internally retrigger the Jenkins build here, and it passed all tests (and it got there before internal testing). |
Introduce a new class
Llpc::ResultError
that implements aResult
-basedllvm::Error
type. This is primarily to support returning either error resultsor values with
llvm::Expected<T>
.Also implement the necessary utility functions, and move some existing ones to the
new header.
I also considered using
llvm::StringError
directly, but this did not work well assome
Vkgc::Result
values do not map well to anystd::errc
error codes, and it wasdifficult to convert back to
Vkgc::Result
, which many existing APIs expect.See the mailing list thread
[RFC] Improving LLPC Result checking
for the proposaldetails.