[PATCH] D47343: [MCJIT] Call JIT notifiers only after code sections are ready.

Andres Freund via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 24 15:02:58 PDT 2018


anarazel added a comment.

> This patch doesn't affect any of my use-cases, but it's possible that some clients are relying on the fact that memory will still be writable at this point.

Would that ever be a safe thing to do? Even if, I've a hard time seeing when that'd be a reasonable solution. Not that hacks necessarily have to be reasonable.  The other in-tree users of event listeners at least don't care...

> As an alternative: ORC's RTDyldObjectLinkingLayer has a NotifyFinalized callback that is called in the equivalent location (i.e. after finalizeMemory has been called). If we want to maintain behavior for existing MCJIT clients it seems reasonable to add a matching "NotifyFinalized" callback to MCJIT.

That'd make sense. OTOH, afaict it'd require changing all the existing notifier users, because they all would want the new thing.

Now that https://reviews.llvm.org/D44890 has landed, I care a bit less. I was mostly bothered because without either https://reviews.llvm.org/D44890 or this, I was unable to test https://reviews.llvm.org/D44892.


Repository:
  rL LLVM

https://reviews.llvm.org/D47343





More information about the llvm-commits mailing list