[Orc] Add a JITSymbol class to the Orc APIs, refactor APIs, update clients.
authorLang Hames <lhames@gmail.com>
Mon, 9 Feb 2015 01:20:51 +0000 (01:20 +0000)
committerLang Hames <lhames@gmail.com>
Mon, 9 Feb 2015 01:20:51 +0000 (01:20 +0000)
commit114b4f324b24760d6c3e12e60b0ea75956e8168e
treefad5aaa9c03f553aaee89906691c3a151213d9a8
parenta021ee62caf49739aa46164326d07909dbc8a989
[Orc] Add a JITSymbol class to the Orc APIs, refactor APIs, update clients.

This patch refactors a key piece of the Orc APIs: It removes the
*::getSymbolAddress and *::lookupSymbolAddressIn methods, which returned target
addresses (uint64_ts), and replaces them with *::findSymbol and *::findSymbolIn
respectively, which return instances of the new JITSymbol type. Unlike the old
methods, calling findSymbol or findSymbolIn does not cause the symbol to be
immediately materialized when found. Instead, the symbol will be materialized
if/when the getAddress method is called on the returned JITSymbol. This allows
us to query for the existence of symbols without actually materializing them. In
the future I expect more information to be attached to the JITSymbol class, for
example whether the returned symbol is a weak or strong definition. This will
allow us to properly handle weak symbols and multiple definitions.

llvm-svn: 228557
llvm/examples/Kaleidoscope/Orc/initial/toy.cpp
llvm/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp
llvm/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp
llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
llvm/include/llvm/ExecutionEngine/Orc/JITSymbol.h [new file with mode: 0644]
llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h