llvm-6502/tools
Lang Hames da62155c11 [MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo through
MCJIT.

This patch decouples the two responsibilities of the RTDyldMemoryManager class,
memory management and symbol resolution, into two new classes:
RuntimeDyld::MemoryManager and RuntimeDyld::SymbolResolver.

The symbol resolution interface is modified slightly, from:

  uint64_t getSymbolAddress(const std::string &Name);

to:

  RuntimeDyld::SymbolInfo findSymbol(const std::string &Name);

The latter passes symbol flags along with symbol addresses, allowing RuntimeDyld
and others to reason about non-strong/non-exported symbols.


The memory management interface removes the following method:

  void notifyObjectLoaded(ExecutionEngine *EE,
                          const object::ObjectFile &) {}

as it is not related to memory management. (Note: Backwards compatibility *is*
maintained for this method in MCJIT and OrcMCJITReplacement, see below).


The RTDyldMemoryManager class remains in-tree for backwards compatibility.
It inherits directly from RuntimeDyld::SymbolResolver, and indirectly from
RuntimeDyld::MemoryManager via the new MCJITMemoryManager class, which
just subclasses RuntimeDyld::MemoryManager and reintroduces the
notifyObjectLoaded method for backwards compatibility).

The EngineBuilder class retains the existing method:

  EngineBuilder&
  setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager> mcjmm);

and includes two new methods:

  EngineBuilder&
  setMemoryManager(std::unique_ptr<MCJITMemoryManager> MM);

  EngineBuilder&
  setSymbolResolver(std::unique_ptr<RuntimeDyld::SymbolResolver> SR);

Clients should use EITHER:

A single call to setMCJITMemoryManager with an RTDyldMemoryManager.

OR (exclusive)

One call each to each of setMemoryManager and setSymbolResolver.

This patch should be fully compatible with existing uses of RTDyldMemoryManager.
If it is not it should be considered a bug, and the patch either fixed or
reverted.

If clients find the new API to be an improvement the goal will be to deprecate
and eventually remove the RTDyldMemoryManager class in favor of the new classes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233509 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30 03:37:06 +00:00
..
bugpoint bugpoint: Verify input files 2015-03-26 05:03:10 +00:00
bugpoint-passes
dsymutil Don't declare all text sections at the start of the .s 2015-03-20 20:00:01 +00:00
gold Work around pr23045 and make it easier to reproduce. 2015-03-27 15:55:06 +00:00
llc Verifier: Call verifyModule() from llc and opt 2015-03-27 22:04:28 +00:00
lli [MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo through 2015-03-30 03:37:06 +00:00
llvm-ar Purge unused includes throughout libSupport. 2015-03-23 18:07:13 +00:00
llvm-as
llvm-bcanalyzer [opaque pointer type] Bitcode support for explicit type parameter on GEP. 2015-02-25 01:08:52 +00:00
llvm-c-test Fix build breakage caused by memory leaks in llvm-c-test 2015-01-28 18:32:31 +00:00
llvm-config Refactoring CMake CrossCompile module. 2015-03-12 17:33:34 +00:00
llvm-cov llvm-cov: Require a subcommand when invoked as llvm-cov 2015-03-24 23:34:36 +00:00
llvm-cxxdump Purge unused includes throughout libSupport. 2015-03-23 18:07:13 +00:00
llvm-diff Revert "Remove the explicit SDNodeIterator::operator= in favor of the implicit default" 2015-03-03 21:18:16 +00:00
llvm-dis llvm-dis: Stop crashing when dropping debug info 2015-02-25 01:10:03 +00:00
llvm-dwarfdump Move DebugInfo to DebugInfo/DWARF. 2015-01-30 18:07:45 +00:00
llvm-extract Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00
llvm-go llvm-go: Set $GCCGO instead of putting a gccgo executable on $PATH. 2015-02-14 01:45:57 +00:00
llvm-jitlistener llvm-jitlistener: Add missing include. 2015-03-25 17:12:36 +00:00
llvm-link Work around pr23045 and make it easier to reproduce. 2015-03-27 15:55:06 +00:00
llvm-lto libLTO, llvm-lto, gold: Introduce flag for controlling optimization level. 2015-03-19 22:01:00 +00:00
llvm-mc Don't declare all text sections at the start of the .s 2015-03-20 20:00:01 +00:00
llvm-mcmarkup
llvm-nm Cleanup else-after-return and add an early-return to llvm-nm 2015-03-23 21:17:43 +00:00
llvm-objdump [Objdump] Pass the correct subtarget to printInst. 2015-03-28 20:44:05 +00:00
llvm-pdbdump [llvm-pdbdump] Display full enum definitions. 2015-03-04 06:09:53 +00:00
llvm-profdata Purge unused includes throughout libSupport. 2015-03-23 18:07:13 +00:00
llvm-readobj [llvm-readobj] add support for macho universal binary. 2015-03-24 20:26:55 +00:00
llvm-rtdyld [MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo through 2015-03-30 03:37:06 +00:00
llvm-shlib Raising minimum required CMake version to 2.8.12.2. 2015-03-23 20:03:57 +00:00
llvm-size Assigning and copying command line option objects shouldn't be allowed. 2015-01-22 01:49:59 +00:00
llvm-stress Verifier: Remove the separate -verify-di pass 2015-03-19 22:24:17 +00:00
llvm-symbolizer Purge unused includes throughout libSupport. 2015-03-23 18:07:13 +00:00
lto Fix build failure. 2015-03-19 22:12:08 +00:00
macho-dump Add printing the LC_LINKER_OPTION load command with llvm-objdump’s -private-headers. 2014-12-18 00:53:40 +00:00
msbuild
obj2yaml [obj2yaml/yaml2obj] Add SHT_GROUP support. 2015-02-21 04:28:26 +00:00
opt Verifier: Call verifyModule() from llc and opt 2015-03-27 22:04:28 +00:00
verify-uselistorder Purge unused includes throughout libSupport. 2015-03-23 18:07:13 +00:00
yaml2obj Make helper functions static. 2015-03-09 16:23:46 +00:00
CMakeLists.txt llvm-cxxdump: Rename llvm-vtabledump to llvm-cxxdump 2015-03-15 01:30:58 +00:00
LLVMBuild.txt Add llvm-pdbdump to tools. 2015-01-27 20:46:21 +00:00
Makefile llvm-cxxdump: Rename llvm-vtabledump to llvm-cxxdump 2015-03-15 01:30:58 +00:00