[PATCH] D31261: [IR] De-virtualize ~Value to save a vptr

George Burgess IV via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 15:14:59 PDT 2017


george.burgess.iv added inline comments.


================
Comment at: llvm/include/llvm/IR/DerivedUser.h:42
+/// lib/IR.
+class ValueCallbacks {
+public:
----------------
rnk wrote:
> pcc wrote:
> > Can "ValueCallbacks" just be a function pointer?
> It could be, but I had the idea that MemorySSA might prefer to add virtual methods here instead of doing switch dispatch like I ended up doing. Whatever dannyb/gbiv prefer, I'll do that.
We don't have that many virtual methods in Memory*, so I'd be perfectly happy with switch dispatch. If that changes, looks straightforward to swap back to this approach.

(If we take the `ValueCallbacks` route, though, please make `deleteValue` and `VCallbacks` const)


https://reviews.llvm.org/D31261





More information about the llvm-commits mailing list