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