Example #1
0
error_or<T> of_llvm_error_or(const llvm::ErrorOr<T> &e) {
    if (!e)
        return failure(e.getError().message());
    return success(e.get());
}
Example #2
0
static T unwrap(llvm::ErrorOr<T> value) {
  if (!value.getError())
    return std::move(value.get());
  std::cerr << "swift-reflection-test error: " << value.getError().message() << "\n";
  exit(EXIT_FAILURE);
}