aboutsummaryrefslogtreecommitdiff
path: root/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp')
-rw-r--r--llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp26
1 files changed, 4 insertions, 22 deletions
diff --git a/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp b/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp
index 9001125..1f69415 100644
--- a/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp
+++ b/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp
@@ -77,6 +77,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/ExecutionEngine/Orc/Debugging/DebuggerSupport.h"
#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
@@ -174,32 +175,13 @@ int main(int argc, char *argv[]) {
TSMs.push_back(ExitOnErr(parseExampleModuleFromFile(Path)));
}
- std::string TT;
- StringRef MainModuleName;
- TSMs.front().withModuleDo([&MainModuleName, &TT](Module &M) {
- MainModuleName = M.getName();
- TT = M.getTargetTriple();
- if (TT.empty())
- TT = sys::getProcessTriple();
- });
-
- // Create a target machine that matches the input triple.
- JITTargetMachineBuilder JTMB((Triple(TT)));
- JTMB.setCodeModel(CodeModel::Small);
- JTMB.setRelocationModel(Reloc::PIC_);
-
// Create LLJIT and destroy it before disconnecting the target process.
outs() << "Initializing LLJIT for remote executor\n";
- auto J = ExitOnErr(LLJITBuilder()
- .setExecutorProcessControl(std::move(EPC))
- .setJITTargetMachineBuilder(std::move(JTMB))
- .setObjectLinkingLayerCreator([&](auto &ES, const auto &TT) {
- return std::make_unique<ObjectLinkingLayer>(ES);
- })
- .create());
+ auto J = ExitOnErr(
+ LLJITBuilder().setExecutorProcessControl(std::move(EPC)).create());
// Add plugin for debug support.
- ExitOnErr(addDebugSupport(J->getObjLinkingLayer()));
+ ExitOnErr(enableDebuggerSupport(*J));
// Load required shared libraries on the remote target and add a generator
// for each of it, so the compiler can lookup their symbols.