[PATCH] D99561: Support visitor pattern by PointerUnion.

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 6 17:37:15 PDT 2021


mehdi_amini added a comment.

> also the issue of "Oh, I'm used to using x.match(a, b) - ah, bother, this is the standard thing that doesn't support x.match, I have to use visit(a, b, x) instead".

The same thing could be said about many of our APIs in Support/ADT which we make in a form that we think is more convenient than the standard, like how `llvm::sort` and all the others we have don't need `.begin()`/`.end()` to operate on the entire range. I'm annoyed every time I have to an `std::` entry point that forces me in the extra boilerplate, but I wouldn't want to remove these nicer APIs from LLVM for "consistency with the standard".
(don't forget also that the standard often will have constraint around API design we don't have, for example around exception handling).


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