Revert "[Orc][LLJIT] Use JITLink even if a custom JITTargetMachineBuilder is supplied."

This reverts commit 298e183e81.

This commit caused some build failures -- reverting while I investigate.
This commit is contained in:
Lang Hames 2019-12-18 15:13:35 -08:00
parent 5094e6dad6
commit 5ea91bea15
2 changed files with 3 additions and 13 deletions

View File

@ -79,18 +79,12 @@ public:
return *this;
}
/// Get the relocation model.
const Optional<Reloc::Model> &getRelocationModel() const { return RM; }
/// Set the code model.
JITTargetMachineBuilder &setCodeModel(Optional<CodeModel::Model> CM) {
this->CM = std::move(CM);
return *this;
}
/// Get the code model.
const Optional<CodeModel::Model> &getCodeModel() const { return CM; }
/// Set the LLVM CodeGen optimization level.
JITTargetMachineBuilder &setCodeGenOptLevel(CodeGenOpt::Level OptLevel) {
this->OptLevel = OptLevel;

View File

@ -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_);