[clang] 16dcbb5 - [ORC] Return ExecutorAddrs rather than JITEvaluatedSymbols from LLJIT::lookup.
Lang Hames via cfe-commits
cfe-commits at lists.llvm.org
Thu May 5 13:56:04 PDT 2022
Author: Lang Hames
Date: 2022-05-05T13:56:00-07:00
New Revision: 16dcbb53dc7968a3752661aac731172ebe0faf64
URL: https://github.com/llvm/llvm-project/commit/16dcbb53dc7968a3752661aac731172ebe0faf64
DIFF: https://github.com/llvm/llvm-project/commit/16dcbb53dc7968a3752661aac731172ebe0faf64.diff
LOG: [ORC] Return ExecutorAddrs rather than JITEvaluatedSymbols from LLJIT::lookup.
Clients don't care about linkage, and ExecutorAddr is much more ergonomic.
Added:
Modified:
clang/lib/Interpreter/IncrementalExecutor.cpp
llvm/examples/HowToUseLLJIT/HowToUseLLJIT.cpp
llvm/examples/OrcV2Examples/LLJITDumpObjects/LLJITDumpObjects.cpp
llvm/examples/OrcV2Examples/LLJITRemovableCode/LLJITRemovableCode.cpp
llvm/examples/OrcV2Examples/LLJITWithCustomObjectLinkingLayer/LLJITWithCustomObjectLinkingLayer.cpp
llvm/examples/OrcV2Examples/LLJITWithExecutorProcessControl/LLJITWithExecutorProcessControl.cpp
llvm/examples/OrcV2Examples/LLJITWithGDBRegistrationListener/LLJITWithGDBRegistrationListener.cpp
llvm/examples/OrcV2Examples/LLJITWithLazyReexports/LLJITWithLazyReexports.cpp
llvm/examples/OrcV2Examples/LLJITWithObjectCache/LLJITWithObjectCache.cpp
llvm/examples/OrcV2Examples/LLJITWithObjectLinkingLayerPlugin/LLJITWithObjectLinkingLayerPlugin.cpp
llvm/examples/OrcV2Examples/LLJITWithOptimizingIRTransform/LLJITWithOptimizingIRTransform.cpp
llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp
llvm/examples/OrcV2Examples/LLJITWithThinLTOSummaries/LLJITWithThinLTOSummaries.cpp
llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
llvm/lib/ExecutionEngine/Orc/OrcV2CBindings.cpp
llvm/tools/lli/lli.cpp
Removed:
################################################################################
diff --git a/clang/lib/Interpreter/IncrementalExecutor.cpp b/clang/lib/Interpreter/IncrementalExecutor.cpp
index 705235aafa070..75c385aa409f3 100644
--- a/clang/lib/Interpreter/IncrementalExecutor.cpp
+++ b/clang/lib/Interpreter/IncrementalExecutor.cpp
@@ -68,7 +68,7 @@ IncrementalExecutor::getSymbolAddress(llvm::StringRef Name,
if (!Sym)
return Sym.takeError();
- return Sym->getAddress();
+ return Sym->getValue();
}
} // end namespace clang
diff --git a/llvm/examples/HowToUseLLJIT/HowToUseLLJIT.cpp b/llvm/examples/HowToUseLLJIT/HowToUseLLJIT.cpp
index 170a899136054..cdeaa745f91ef 100644
--- a/llvm/examples/HowToUseLLJIT/HowToUseLLJIT.cpp
+++ b/llvm/examples/HowToUseLLJIT/HowToUseLLJIT.cpp
@@ -91,8 +91,8 @@ int main(int argc, char *argv[]) {
ExitOnErr(J->addIRModule(std::move(M)));
// Look up the JIT'd function, cast it to a function pointer, then call it.
- auto Add1Sym = ExitOnErr(J->lookup("add1"));
- int (*Add1)(int) = (int (*)(int))Add1Sym.getAddress();
+ auto Add1Addr = ExitOnErr(J->lookup("add1"));
+ int (*Add1)(int) = Add1Addr.toPtr<int(int)>();
int Result = Add1(42);
outs() << "add1(42) = " << Result << "\n";
diff --git a/llvm/examples/OrcV2Examples/LLJITDumpObjects/LLJITDumpObjects.cpp b/llvm/examples/OrcV2Examples/LLJITDumpObjects/LLJITDumpObjects.cpp
index 2c975b188fb64..c3752cc36c060 100644
--- a/llvm/examples/OrcV2Examples/LLJITDumpObjects/LLJITDumpObjects.cpp
+++ b/llvm/examples/OrcV2Examples/LLJITDumpObjects/LLJITDumpObjects.cpp
@@ -61,8 +61,8 @@ int main(int argc, char *argv[]) {
ExitOnErr(J->addIRModule(std::move(M)));
// Look up the JIT'd function, cast it to a function pointer, then call it.
- auto Add1Sym = ExitOnErr(J->lookup("add1"));
- int (*Add1)(int) = (int (*)(int))Add1Sym.getAddress();
+ auto Add1Addr = ExitOnErr(J->lookup("add1"));
+ int (*Add1)(int) = Add1Addr.toPtr<int(int)>();
int Result = Add1(42);
outs() << "add1(42) = " << Result << "\n";
diff --git a/llvm/examples/OrcV2Examples/LLJITRemovableCode/LLJITRemovableCode.cpp b/llvm/examples/OrcV2Examples/LLJITRemovableCode/LLJITRemovableCode.cpp
index 29735d11f70d7..4739efc2eccf1 100644
--- a/llvm/examples/OrcV2Examples/LLJITRemovableCode/LLJITRemovableCode.cpp
+++ b/llvm/examples/OrcV2Examples/LLJITRemovableCode/LLJITRemovableCode.cpp
@@ -92,7 +92,7 @@ int main(int argc, char *argv[]) {
auto PrintSymbol = [&](StringRef Name) {
dbgs() << Name << " = ";
if (auto Sym = J->lookup(JD, Name))
- dbgs() << formatv("{0:x}\n", Sym->getAddress());
+ dbgs() << *Sym;
else
dbgs() << "error: " << toString(Sym.takeError()) << "\n";
};
diff --git a/llvm/examples/OrcV2Examples/LLJITWithCustomObjectLinkingLayer/LLJITWithCustomObjectLinkingLayer.cpp b/llvm/examples/OrcV2Examples/LLJITWithCustomObjectLinkingLayer/LLJITWithCustomObjectLinkingLayer.cpp
index 907dc83f46333..16c81de54c86f 100644
--- a/llvm/examples/OrcV2Examples/LLJITWithCustomObjectLinkingLayer/LLJITWithCustomObjectLinkingLayer.cpp
+++ b/llvm/examples/OrcV2Examples/LLJITWithCustomObjectLinkingLayer/LLJITWithCustomObjectLinkingLayer.cpp
@@ -56,8 +56,8 @@ int main(int argc, char *argv[]) {
ExitOnErr(J->addIRModule(std::move(M)));
// Look up the JIT'd function, cast it to a function pointer, then call it.
- auto Add1Sym = ExitOnErr(J->lookup("add1"));
- int (*Add1)(int) = (int (*)(int))Add1Sym.getAddress();
+ auto Add1Addr = ExitOnErr(J->lookup("add1"));
+ int (*Add1)(int) = Add1Addr.toPtr<int(int)>();
int Result = Add1(42);
outs() << "add1(42) = " << Result << "\n";
diff --git a/llvm/examples/OrcV2Examples/LLJITWithExecutorProcessControl/LLJITWithExecutorProcessControl.cpp b/llvm/examples/OrcV2Examples/LLJITWithExecutorProcessControl/LLJITWithExecutorProcessControl.cpp
index 45f4f481e656d..634d74d9b80ed 100644
--- a/llvm/examples/OrcV2Examples/LLJITWithExecutorProcessControl/LLJITWithExecutorProcessControl.cpp
+++ b/llvm/examples/OrcV2Examples/LLJITWithExecutorProcessControl/LLJITWithExecutorProcessControl.cpp
@@ -187,8 +187,8 @@ int main(int argc, char *argv[]) {
// arguments passed.
// Look up the JIT'd function, cast it to a function pointer, then call it.
- auto EntrySym = ExitOnErr(J->lookup("entry"));
- auto *Entry = (int (*)(int))EntrySym.getAddress();
+ auto EntryAddr = ExitOnErr(J->lookup("entry"));
+ auto *Entry = EntryAddr.toPtr<int(int)>();
int Result = Entry(argc);
outs() << "---Result---\n"
diff --git a/llvm/examples/OrcV2Examples/LLJITWithGDBRegistrationListener/LLJITWithGDBRegistrationListener.cpp b/llvm/examples/OrcV2Examples/LLJITWithGDBRegistrationListener/LLJITWithGDBRegistrationListener.cpp
index 1923139925b7c..09a9038904349 100644
--- a/llvm/examples/OrcV2Examples/LLJITWithGDBRegistrationListener/LLJITWithGDBRegistrationListener.cpp
+++ b/llvm/examples/OrcV2Examples/LLJITWithGDBRegistrationListener/LLJITWithGDBRegistrationListener.cpp
@@ -108,9 +108,8 @@ int main(int argc, char *argv[]) {
// Look up the entry point, cast it to a C main function pointer, then use
// runAsMain to call it.
- auto EntrySym = ExitOnErr(J->lookup(EntryPointName));
- auto EntryFn =
- jitTargetAddressToFunction<int (*)(int, char *[])>(EntrySym.getAddress());
+ auto EntryAddr = ExitOnErr(J->lookup(EntryPointName));
+ auto EntryFn = EntryAddr.toPtr<int(int, char *[])>();
return runAsMain(EntryFn, InputArgv, StringRef(InputFiles.front()));
}
diff --git a/llvm/examples/OrcV2Examples/LLJITWithLazyReexports/LLJITWithLazyReexports.cpp b/llvm/examples/OrcV2Examples/LLJITWithLazyReexports/LLJITWithLazyReexports.cpp
index 5d4a27c432436..e53a195c52b22 100644
--- a/llvm/examples/OrcV2Examples/LLJITWithLazyReexports/LLJITWithLazyReexports.cpp
+++ b/llvm/examples/OrcV2Examples/LLJITWithLazyReexports/LLJITWithLazyReexports.cpp
@@ -152,8 +152,8 @@ int main(int argc, char *argv[]) {
// arguments passed.
// Look up the JIT'd function, cast it to a function pointer, then call it.
- auto EntrySym = ExitOnErr(J->lookup("entry"));
- auto *Entry = (int (*)(int))EntrySym.getAddress();
+ auto EntryAddr = ExitOnErr(J->lookup("entry"));
+ auto *Entry = EntryAddr.toPtr<int(int)>();
int Result = Entry(argc);
outs() << "---Result---\n"
diff --git a/llvm/examples/OrcV2Examples/LLJITWithObjectCache/LLJITWithObjectCache.cpp b/llvm/examples/OrcV2Examples/LLJITWithObjectCache/LLJITWithObjectCache.cpp
index f94fd853ed03a..b6910c792f59d 100644
--- a/llvm/examples/OrcV2Examples/LLJITWithObjectCache/LLJITWithObjectCache.cpp
+++ b/llvm/examples/OrcV2Examples/LLJITWithObjectCache/LLJITWithObjectCache.cpp
@@ -69,8 +69,8 @@ void runJITWithCache(ObjectCache &ObjCache) {
ExitOnErr(J->addIRModule(std::move(M)));
// Look up the JIT'd function, cast it to a function pointer, then call it.
- auto Add1Sym = ExitOnErr(J->lookup("add1"));
- int (*Add1)(int) = (int (*)(int))Add1Sym.getAddress();
+ auto Add1Addr = ExitOnErr(J->lookup("add1"));
+ int (*Add1)(int) = Add1Addr.toPtr<int(int)>();
int Result = Add1(42);
outs() << "add1(42) = " << Result << "\n";
diff --git a/llvm/examples/OrcV2Examples/LLJITWithObjectLinkingLayerPlugin/LLJITWithObjectLinkingLayerPlugin.cpp b/llvm/examples/OrcV2Examples/LLJITWithObjectLinkingLayerPlugin/LLJITWithObjectLinkingLayerPlugin.cpp
index 5a41a7c1e8a6c..5b2a0b6300cfb 100644
--- a/llvm/examples/OrcV2Examples/LLJITWithObjectLinkingLayerPlugin/LLJITWithObjectLinkingLayerPlugin.cpp
+++ b/llvm/examples/OrcV2Examples/LLJITWithObjectLinkingLayerPlugin/LLJITWithObjectLinkingLayerPlugin.cpp
@@ -241,8 +241,8 @@ int main(int argc, char *argv[]) {
}
// Look up the JIT'd function, cast it to a function pointer, then call it.
- auto EntrySym = ExitOnErr(J->lookup(EntryPointName));
- auto *Entry = (int (*)())EntrySym.getAddress();
+ auto EntryAddr = ExitOnErr(J->lookup(EntryPointName));
+ auto *Entry = EntryAddr.toPtr<int()>();
int Result = Entry();
outs() << "---Result---\n"
diff --git a/llvm/examples/OrcV2Examples/LLJITWithOptimizingIRTransform/LLJITWithOptimizingIRTransform.cpp b/llvm/examples/OrcV2Examples/LLJITWithOptimizingIRTransform/LLJITWithOptimizingIRTransform.cpp
index 35421c0c5938b..6bd63bf7a7d31 100644
--- a/llvm/examples/OrcV2Examples/LLJITWithOptimizingIRTransform/LLJITWithOptimizingIRTransform.cpp
+++ b/llvm/examples/OrcV2Examples/LLJITWithOptimizingIRTransform/LLJITWithOptimizingIRTransform.cpp
@@ -112,8 +112,8 @@ int main(int argc, char *argv[]) {
ExitOnErr(J->addIRModule(ExitOnErr(parseExampleModule(MainMod, "MainMod"))));
// (4) Look up the JIT'd function and call it.
- auto EntrySym = ExitOnErr(J->lookup("entry"));
- auto *Entry = (int (*)())EntrySym.getAddress();
+ auto EntryAddr = ExitOnErr(J->lookup("entry"));
+ auto *Entry = EntryAddr.toPtr<int()>();
int Result = Entry();
outs() << "--- Result ---\n"
diff --git a/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp b/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp
index d88a4172a53cc..3c1f5f86dcbad 100644
--- a/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp
+++ b/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp
@@ -223,7 +223,7 @@ int main(int argc, char *argv[]) {
// The example uses a non-lazy JIT for simplicity. Thus, looking up the main
// function will materialize all reachable code. It also triggers debug
// registration in the remote target process.
- JITEvaluatedSymbol MainFn = ExitOnErr(J->lookup("main"));
+ auto MainAddr = ExitOnErr(J->lookup("main"));
outs() << "Running: main(";
int Pos = 0;
@@ -238,10 +238,9 @@ int main(int argc, char *argv[]) {
// the debugger attached to the target, it should be possible to inspect the
// JITed code as if it was compiled statically.
{
- JITTargetAddress MainFnAddr = MainFn.getAddress();
ExecutorProcessControl &EPC =
J->getExecutionSession().getExecutorProcessControl();
- int Result = ExitOnErr(EPC.runAsMain(ExecutorAddr(MainFnAddr), ActualArgv));
+ int Result = ExitOnErr(EPC.runAsMain(MainAddr, ActualArgv));
outs() << "Exit code: " << Result << "\n";
}
diff --git a/llvm/examples/OrcV2Examples/LLJITWithThinLTOSummaries/LLJITWithThinLTOSummaries.cpp b/llvm/examples/OrcV2Examples/LLJITWithThinLTOSummaries/LLJITWithThinLTOSummaries.cpp
index d65f77abdf6e2..a7cb4fce94909 100644
--- a/llvm/examples/OrcV2Examples/LLJITWithThinLTOSummaries/LLJITWithThinLTOSummaries.cpp
+++ b/llvm/examples/OrcV2Examples/LLJITWithThinLTOSummaries/LLJITWithThinLTOSummaries.cpp
@@ -227,11 +227,10 @@ int main(int Argc, char *Argv[]) {
}
// (5) Look up and run the JIT'd function.
- auto MainSym = ExitOnErr(J->lookup(MainFunctionName));
+ auto MainAddr = ExitOnErr(J->lookup(MainFunctionName));
using MainFnPtr = int (*)(int, char *[]);
- MainFnPtr MainFunction =
- jitTargetAddressToFunction<MainFnPtr>(MainSym.getAddress());
+ auto *MainFunction = MainAddr.toPtr<MainFnPtr>();
int Result = runAsMain(MainFunction, {}, MainModulePath);
outs() << "'" << MainFunctionName << "' finished with exit code: " << Result
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
index c726b978e61bd..d67a7f2bfeb20 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
@@ -110,30 +110,30 @@ class LLJIT {
/// Look up a symbol in JITDylib JD by the symbol's linker-mangled name (to
/// look up symbols based on their IR name use the lookup function instead).
- Expected<JITEvaluatedSymbol> lookupLinkerMangled(JITDylib &JD,
- SymbolStringPtr Name);
+ Expected<ExecutorAddr> lookupLinkerMangled(JITDylib &JD,
+ SymbolStringPtr Name);
/// Look up a symbol in JITDylib JD by the symbol's linker-mangled name (to
/// look up symbols based on their IR name use the lookup function instead).
- Expected<JITEvaluatedSymbol> lookupLinkerMangled(JITDylib &JD,
- StringRef Name) {
+ Expected<ExecutorAddr> lookupLinkerMangled(JITDylib &JD,
+ StringRef Name) {
return lookupLinkerMangled(JD, ES->intern(Name));
}
/// Look up a symbol in the main JITDylib by the symbol's linker-mangled name
/// (to look up symbols based on their IR name use the lookup function
/// instead).
- Expected<JITEvaluatedSymbol> lookupLinkerMangled(StringRef Name) {
+ Expected<ExecutorAddr> lookupLinkerMangled(StringRef Name) {
return lookupLinkerMangled(*Main, Name);
}
/// Look up a symbol in JITDylib JD based on its IR symbol name.
- Expected<JITEvaluatedSymbol> lookup(JITDylib &JD, StringRef UnmangledName) {
+ Expected<ExecutorAddr> lookup(JITDylib &JD, StringRef UnmangledName) {
return lookupLinkerMangled(JD, mangle(UnmangledName));
}
/// Look up a symbol in the main JITDylib based on its IR symbol name.
- Expected<JITEvaluatedSymbol> lookup(StringRef UnmangledName) {
+ Expected<ExecutorAddr> lookup(StringRef UnmangledName) {
return lookup(*Main, UnmangledName);
}
@@ -401,7 +401,7 @@ class LLLazyJITBuilderState : public LLJITBuilderState {
std::function<std::unique_ptr<IndirectStubsManager>()>;
Triple TT;
- JITTargetAddress LazyCompileFailureAddr = 0;
+ ExecutorAddr LazyCompileFailureAddr;
std::unique_ptr<LazyCallThroughManager> LCTMgr;
IndirectStubsManagerBuilderFunction ISMBuilder;
@@ -415,7 +415,7 @@ class LLLazyJITBuilderSetters
/// Set the address in the target address to call if a lazy compile fails.
///
/// If this method is not called then the value will default to 0.
- SetterImpl &setLazyCompileFailureAddr(JITTargetAddress Addr) {
+ SetterImpl &setLazyCompileFailureAddr(ExecutorAddr Addr) {
this->impl().LazyCompileFailureAddr = Addr;
return this->impl();
}
diff --git a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
index 8a8b285217bf2..7a490ebaa09e6 100644
--- a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
@@ -701,10 +701,14 @@ Error LLJIT::addObjectFile(JITDylib &JD, std::unique_ptr<MemoryBuffer> Obj) {
return addObjectFile(JD.getDefaultResourceTracker(), std::move(Obj));
}
-Expected<JITEvaluatedSymbol> LLJIT::lookupLinkerMangled(JITDylib &JD,
- SymbolStringPtr Name) {
- return ES->lookup(
- makeJITDylibSearchOrder(&JD, JITDylibLookupFlags::MatchAllSymbols), Name);
+Expected<ExecutorAddr> LLJIT::lookupLinkerMangled(JITDylib &JD,
+ SymbolStringPtr Name) {
+ if (auto Sym = ES->lookup(
+ makeJITDylibSearchOrder(&JD, JITDylibLookupFlags::MatchAllSymbols),
+ Name))
+ return ExecutorAddr(Sym->getAddress());
+ else
+ return Sym.takeError();
}
Expected<std::unique_ptr<ObjectLayer>>
@@ -897,7 +901,7 @@ LLLazyJIT::LLLazyJIT(LLLazyJITBuilderState &S, Error &Err) : LLJIT(S, Err) {
LCTMgr = std::move(S.LCTMgr);
else {
if (auto LCTMgrOrErr = createLocalLazyCallThroughManager(
- S.TT, *ES, S.LazyCompileFailureAddr))
+ S.TT, *ES, S.LazyCompileFailureAddr.getValue()))
LCTMgr = std::move(*LCTMgrOrErr);
else {
Err = LCTMgrOrErr.takeError();
diff --git a/llvm/lib/ExecutionEngine/Orc/OrcV2CBindings.cpp b/llvm/lib/ExecutionEngine/Orc/OrcV2CBindings.cpp
index 71be8dfdc004f..ca52d3ea3a5d0 100644
--- a/llvm/lib/ExecutionEngine/Orc/OrcV2CBindings.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/OrcV2CBindings.cpp
@@ -951,7 +951,7 @@ LLVMErrorRef LLVMOrcLLJITLookup(LLVMOrcLLJITRef J,
return wrap(Sym.takeError());
}
- *Result = Sym->getAddress();
+ *Result = Sym->getValue();
return LLVMErrorSuccess;
}
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index d20daa07196bb..f8c2c9172102f 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -881,7 +881,7 @@ int runOrcJIT(const char *ProgName) {
}
Builder.setLazyCompileFailureAddr(
- pointerToJITTargetAddress(exitOnLazyCallThroughFailure));
+ orc::ExecutorAddr::fromPtr(exitOnLazyCallThroughFailure));
Builder.setNumCompileThreads(LazyJITCompileThreads);
// If the object cache is enabled then set a custom compile function
@@ -1049,23 +1049,21 @@ int runOrcJIT(const char *ProgName) {
for (auto &ThreadEntryPoint : ThreadEntryPoints) {
auto EntryPointSym = ExitOnErr(J->lookup(ThreadEntryPoint));
typedef void (*EntryPointPtr)();
- auto EntryPoint =
- reinterpret_cast<EntryPointPtr>(static_cast<uintptr_t>(EntryPointSym.getAddress()));
+ auto EntryPoint = EntryPointSym.toPtr<EntryPointPtr>();
AltEntryThreads.push_back(std::thread([EntryPoint]() { EntryPoint(); }));
}
// Resolve and run the main function.
- JITEvaluatedSymbol MainSym = ExitOnErr(J->lookup(EntryFunc));
+ auto MainAddr = ExitOnErr(J->lookup(EntryFunc));
int Result;
if (EPC) {
// ExecutorProcessControl-based execution with JITLink.
- Result = ExitOnErr(
- EPC->runAsMain(orc::ExecutorAddr(MainSym.getAddress()), InputArgv));
+ Result = ExitOnErr(EPC->runAsMain(MainAddr, InputArgv));
} else {
// Manual in-process execution with RuntimeDyld.
using MainFnTy = int(int, char *[]);
- auto MainFn = jitTargetAddressToFunction<MainFnTy *>(MainSym.getAddress());
+ auto MainFn = MainAddr.toPtr<MainFnTy *>();
Result = orc::runAsMain(MainFn, InputArgv, StringRef(InputFile));
}
More information about the cfe-commits
mailing list