llpc/util/llpcError.cpp
Result reportError(Error &&err) {
  // For details on llvm error handling, see https://llvm.org/docs/ProgrammersManual.html#recoverable-errors.
  assert(err && "llvm::ErrorSuccess is not an error");

  Result result = Result::ErrorUnknown;
  handleAllErrors(
      std::move(err),
      [&result](const ResultError &resultError) {
        result = resultError.getResult();
        LLPC_ERRS(resultError.message() << "\n");
      },
      [](const ErrorInfoBase &baseError) { LLPC_ERRS(baseError.message() << "\n"); });
  return result;
}
// =====================================================================================================================
// Prints the error message in `err` to LLPC_ERRS and consumes the error.
//
// @param err : The error to handle. This must not be an `ErrorSuccess`.
// @returns: The underlying `Result` when `err` is a `ResultError`, `Result::ErrorUnknown` otherwise.
Prints the error message in `err` to LLPC_ERRS and consumes the error.
Prints the error message in ` err ` to LLPC_ERRS and consumes the error .
Result reportError(Error &&err) {
  assert(err && "llvm::ErrorSuccess is not an error");
  Result result = Result::ErrorUnknown;
  handleAllErrors(
      std::move(err),
      [&result](const ResultError &resultError) {
        result = resultError.getResult();
        LLPC_ERRS(resultError.message() << "\n");
      },
      [](const ErrorInfoBase &baseError) { LLPC_ERRS(baseError.message() << "\n"); });
  return result;
}
Result reportError ( Error && err ) { assert ( err && " " ) ; Result result = Result :: ErrorUnknown ; handleAllErrors ( std :: move ( err ) , [ & result ] ( const ResultError & resultError ) { result = resultError . getResult ( ) ; LLPC_ERRS ( resultError . message ( ) << " \n " ) ; } , [ ] ( const ErrorInfoBase & baseError ) { LLPC_ERRS ( baseError . message ( ) << " \n " ) ; } ) ; return result ; }
Prints the error message in `err` to LLPC_ERRS and consumes the error.
Prints the error message in ` err ` to LLPC_ERRS and consumes the error .
// For details on llvm error handling, see https://llvm.org/docs/ProgrammersManual.html#recoverable-errors.