summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2013-10-19 09:03:20 +0000
committerYaron Keren <yaron.keren@gmail.com>2013-10-19 09:03:20 +0000
commitf14bb8f5e664cda4cd720d638ad99cc635531442 (patch)
treedc8982e48227e5ec4fa2d32ea4a2950766386562 /lib
parentf099f893f3f7ae342bf087f5cbc07c8d9324c0dd (diff)
downloadllvm-f14bb8f5e664cda4cd720d638ad99cc635531442.tar.gz
llvm-f14bb8f5e664cda4cd720d638ad99cc635531442.tar.bz2
llvm-f14bb8f5e664cda4cd720d638ad99cc635531442.tar.xz
Added comments from Andrew Kaylor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193033 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJIT.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.h b/lib/ExecutionEngine/MCJIT/MCJIT.h
index 39326920ee..ebf51d48bd 100644
--- a/lib/ExecutionEngine/MCJIT/MCJIT.h
+++ b/lib/ExecutionEngine/MCJIT/MCJIT.h
@@ -74,6 +74,26 @@ private:
// like only having one module, not needing to worry about multi-threading,
// blah blah. Purely in get-it-up-and-limping mode for now.
+// About Module states:
+//
+// The purpose of the "added" state is having modules in standby. (added=known
+// but not compiled). The idea is that you can add a module to provide function
+// definitions but if nothing in that module is referenced by a module in which
+// a function is executed (note the wording here because it’s not exactly the
+// ideal case) then the module never gets compiled. This is sort of lazy
+// compilation.
+//
+// The purpose of the "loaded" state (loaded=compiled and required sections
+// copied into local memory but not yet ready for execution) is to have an
+// intermediate state wherein clients can remap the addresses of sections, using
+// MCJIT::mapSectionAddress, (in preparation for later copying to a new location
+// or an external process) before relocations and page permissions are applied.
+//
+// It might not be obvious at first glance, but the "remote-mcjit" case in the
+// lli tool does this. In that case, the intermediate action is taken by the
+// RemoteMemoryManager in response to the notifyObjectLoaded function being
+// called.
+
class MCJIT : public ExecutionEngine {
MCJIT(Module *M, TargetMachine *tm, RTDyldMemoryManager *MemMgr,
bool AllocateGVsWithCode);
@@ -136,6 +156,7 @@ public:
/// object have been relocated using mapSectionAddress. When this method is
/// called the MCJIT execution engine will reapply relocations for a loaded
/// object.
+ /// Is it OK to finalize a set of modules, add modules and finalize again.
/// FIXME: Do we really need both of these?
virtual void finalizeObject();
virtual void finalizeModule(Module *);