From 5ea91bea15dd0cda55b83d108686c3087b479284 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Wed, 18 Dec 2019 15:13:35 -0800 Subject: [PATCH] Revert "[Orc][LLJIT] Use JITLink even if a custom JITTargetMachineBuilder is supplied." This reverts commit 298e183e813c884dd22816383405bae3ef9ef278. This commit caused some build failures -- reverting while I investigate. --- .../llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h | 6 ------ llvm/lib/ExecutionEngine/Orc/LLJIT.cpp | 10 +++------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h b/llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h index 4f2f55770996..c8c4ecdaff16 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h @@ -79,18 +79,12 @@ public: return *this; } - /// Get the relocation model. - const Optional &getRelocationModel() const { return RM; } - /// Set the code model. JITTargetMachineBuilder &setCodeModel(Optional CM) { this->CM = std::move(CM); return *this; } - /// Get the code model. - const Optional &getCodeModel() const { return CM; } - /// Set the LLVM CodeGen optimization level. JITTargetMachineBuilder &setCodeGenOptLevel(CodeGenOpt::Level OptLevel) { this->OptLevel = OptLevel; diff --git a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp index 54473ab46423..5c393739f401 100644 --- a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp +++ b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp @@ -24,15 +24,11 @@ Error LLJITBuilderState::prepareForConstruction() { JTMB = std::move(*JTMBOrErr); else return JTMBOrErr.takeError(); - } - - // If the client didn't configure any linker options then auto-configure the - // JIT linker. - if (!CreateObjectLinkingLayer && JTMB->getCodeModel() == None && - JTMB->getRelocationModel() == None) { + // If no ObjectLinkingLayer creator was set and the target supports JITLink + // then configure for JITLink. auto &TT = JTMB->getTargetTriple(); - if (TT.isOSBinFormatMachO() && + if (!CreateObjectLinkingLayer && TT.isOSBinFormatMachO() && (TT.getArch() == Triple::aarch64 || TT.getArch() == Triple::x86_64)) { JTMB->setRelocationModel(Reloc::PIC_);