[ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol.
This patch replaces RuntimeDyld::SymbolInfo with JITSymbol: A symbol class
that is capable of lazy materialization (i.e. the symbol definition needn't be
emitted until the address is requested). This can be used to support common
and weak symbols in the JIT (though this is not implemented in this patch).
For consistency, RuntimeDyld::SymbolResolver is renamed to JITSymbolResolver.
For space efficiency a new class, JITEvaluatedSymbol, is introduced that
behaves like the old RuntimeDyld::SymbolInfo - i.e. it is just a pair of an
address and symbol flags. Instances of JITEvaluatedSymbol can be used in
symbol-tables to avoid paying the space cost of the materializer.
llvm-svn: 277386
diff --git a/llvm/unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp
index 87928347..44b44f6 100644
--- a/llvm/unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp
@@ -90,10 +90,10 @@
auto Resolver =
createLambdaResolver(
[](const std::string &Name) {
- return RuntimeDyld::SymbolInfo(nullptr);
+ return JITSymbol(nullptr);
},
[](const std::string &Name) {
- return RuntimeDyld::SymbolInfo(nullptr);
+ return JITSymbol(nullptr);
});
{
@@ -165,11 +165,11 @@
createLambdaResolver(
[&](const std::string &Name) {
if (auto Sym = ObjLayer.findSymbol(Name, true))
- return Sym.toRuntimeDyldSymbol();
- return RuntimeDyld::SymbolInfo(nullptr);
+ return Sym;
+ return JITSymbol(nullptr);
},
[](const std::string &Name) {
- return RuntimeDyld::SymbolInfo(nullptr);
+ return JITSymbol(nullptr);
});
SectionMemoryManagerWrapper SMMW;