[PATCH] D99561: Support visitor pattern by PointerUnion.

Eugene Zhulenev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 30 21:35:03 PDT 2021


ezhulenev added a comment.

True `llvm::visit` API similar to `std::visit` requires visited type <https://en.cppreference.com/w/cpp/utility/variant/visit> to be a `std::variant` (`llvm::variant`?) and implementng it is a lot of code (e.g. implementation in absl <https://github.com/abseil/abseil-cpp/blob/master/absl/types/variant.h>). Given that it's unlikely that `PointerUnion` at any point will become `std::variant`, I'd say that it will always be a separate API. And for this usability improvement the change is not that large.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99561/new/

https://reviews.llvm.org/D99561



More information about the llvm-commits mailing list