[PATCH] [MCJIT] Add two useful utility functions
Lang Hames
lhames at gmail.com
Wed Jun 17 11:48:36 PDT 2015
When you call addObjectFile, MCJIT will call NotifyObjectEmitted immediately on each registered event listener, passing a reference to the original ObjectFile, and to the LoadedObjectInfo. If you specifically want to inspect the object file currently being loaded you could raise a flag on your event listener:
MyEventListener.NextObjectIsSpecial = true;
EE->addObjectFile(...);
I'm not a fan of callbacks in general, and I agree that this is a bit ugly. However, I prefer callbacks for handling loaded objects in MCJIT because they encourage you to treat JIT'd objects and precompiled ones uniformly, which is usually what you want.
If you feel strongly about this I don't mind the method being added, as long as it's not exposed via the C API.
Shameless plug: In Orc you could add trivial custom layer for this. ;)
REPOSITORY
rL LLVM
http://reviews.llvm.org/D10421
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list