[PATCH] D100559: [GC][NFC] Make getGCStrategy by name available in IR

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 18 15:56:53 PDT 2021


reames added a comment.

In D100559#2765430 <https://reviews.llvm.org/D100559#2765430>, @mkazantsev wrote:

> What's the problem of having multiple instances of the same GC strategy? Currently, each strategy has only `const` methods, so it doesn't matter which instance we are using. Even if we make them mutable, isn't it possible that we are willing to get some default strategy and then configure it, e.g., depending on a platform? In that case, having different instances is even useful.

These are currently singleton objects; I'd like to preserve that.  It would be reasonable for a custom strategy to e.g. cache computation in mutable state, and having two or more copies breaks that reasonable implementation in hard to predict ways.

If you think this is too large an ask implementation wise, say so.  I'm not strongly tied to it, it's simply a mild preference.


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

https://reviews.llvm.org/D100559



More information about the llvm-commits mailing list