Skip to content

Commit

Permalink
More updates for llvm-svn
Browse files Browse the repository at this point in the history
  • Loading branch information
ihnorton committed Mar 22, 2014
1 parent a9949c6 commit d988b01
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include "llvm/Object/ObjectFile.h"
#include "llvm/IR/DIBuilder.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/ADT/OwningPtr.h"
#else
#include "llvm/Analysis/Verifier.h"
#endif
Expand Down Expand Up @@ -311,7 +313,11 @@ extern "C"
void jl_dump_objfile(char* fname, int jit_model)
{
std::string err;
#ifdef LLVM35
raw_fd_ostream OS(fname, err, sys::fs::F_None);
#else
raw_fd_ostream OS(fname, err);
#endif
formatted_raw_ostream FOS(OS);
jl_gen_llvm_gv_array();

Expand All @@ -335,7 +341,11 @@ void jl_dump_objfile(char* fname, int jit_model)

PassManager PM;
PM.add(new TargetLibraryInfo(Triple(jl_TargetMachine->getTargetTriple())));
#ifdef LLVM35
PM.add(new DataLayoutPass(*jl_ExecutionEngine->getDataLayout()));
#else
PM.add(new DataLayout(*jl_ExecutionEngine->getDataLayout()));
#endif
if (TM->addPassesToEmitFile(PM, FOS, TargetMachine::CGFT_ObjectFile, false)) {
jl_error("Could not generate obj file for this target");
}
Expand Down Expand Up @@ -4134,11 +4144,12 @@ extern "C" void jl_init_codegen(void)
#endif
#ifdef USE_MCJIT
jl_mcjmm = new SectionMemoryManager();
std::vector<std::string> attrvec;
#else
// Temporarily disable Haswell BMI2 features due to LLVM bug.
const char *mattr[] = {"-bmi2", "-avx2"};
#endif
std::vector<std::string> attrvec (mattr, mattr+2);
#endif
EngineBuilder eb = EngineBuilder(engine_module)
.setEngineKind(EngineKind::JIT)
#if defined(_OS_WINDOWS_) && defined(_CPU_X86_64_)
Expand Down

0 comments on commit d988b01

Please sign in to comment.