OSDN Git Service

[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)
commit7d5ae5bc1f7e5291ba0376ca3160a0e8813593d0
tree011b57291a320d460b797207a728970cfb7df033
parent5439a80dcadb452a27eacc6a6f14b007f04bee5b
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228557 91177308-0d34-0410-b5e6-96231b3b80d8
examples/Kaleidoscope/Orc/initial/toy.cpp
examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp
examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp
include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
include/llvm/ExecutionEngine/Orc/JITSymbol.h [new file with mode: 0644]
include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
lib/ExecutionEngine/Orc/OrcMCJITReplacement.h