From 09369c4fd6049a9aa0e97dc3a451dc61dd81b161 Mon Sep 17 00:00:00 2001 From: Bertrand Bellenot Date: Thu, 2 Mar 2017 11:37:04 +0100 Subject: [PATCH] Remove the Windows ELF formatting from IncrementalExecutor, since it is now in CIFactory --- lib/Interpreter/IncrementalExecutor.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/Interpreter/IncrementalExecutor.cpp b/lib/Interpreter/IncrementalExecutor.cpp index 4530c7fd..0da6e5f1 100644 --- a/lib/Interpreter/IncrementalExecutor.cpp +++ b/lib/Interpreter/IncrementalExecutor.cpp @@ -39,18 +39,15 @@ namespace cling { namespace { static std::unique_ptr -CreateHostTargetMachine(const clang::CodeGenOptions& CGOpt, unsigned Fmt = 0) { - Triple TheTriple(sys::getProcessTriple()); +CreateHostTargetMachine(const clang::CompilerInstance& CI, unsigned Fmt = 0) { + const clang::TargetOptions& TargetOpts = CI.getTargetOpts(); + const clang::CodeGenOptions& CGOpt = CI.getCodeGenOpts(); + Triple TheTriple(TargetOpts.Triple); if (Fmt) { assert(Fmt > llvm::Triple::UnknownObjectFormat && Fmt <= llvm::Triple::MachO && "Invalid Format"); TheTriple.setObjectFormat(static_cast(Fmt)); } -#ifdef LLVM_ON_WIN32 - // COFF format currently needs a few changes in LLVM to function properly. - else - TheTriple.setObjectFormat(llvm::Triple::ELF); -#endif std::string Error; const Target *TheTarget @@ -108,7 +105,7 @@ IncrementalExecutor::IncrementalExecutor(clang::DiagnosticsEngine& diags, m_AtExitFuncs.reserve(256); std::unique_ptr - TM(CreateHostTargetMachine(CI.getCodeGenOpts())); + TM(CreateHostTargetMachine(CI)); m_BackendPasses.reset(new BackendPasses(CI.getCodeGenOpts(), CI.getTargetOpts(), CI.getLangOpts(),