Skip to content

Commit

Permalink
Fix for LLVM35 API changes, closes #5984
Browse files Browse the repository at this point in the history
  • Loading branch information
ihnorton committed Mar 1, 2014
1 parent 63d6dd5 commit 475eb52
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ static Module *jl_Module;
static std::map<int, std::string> argNumberStrings;
static FunctionPassManager *FPM;

#ifdef LLVM32
#ifdef LLVM35
static DataLayoutPass *jl_data_layout;
#elif defined(LLVM32)
static DataLayout *jl_data_layout;
#else
static TargetData *jl_data_layout;
Expand Down Expand Up @@ -285,7 +287,11 @@ extern "C"
void jl_dump_bitcode(char* fname)
{
std::string err;
#ifdef LLVM35
raw_fd_ostream OS(fname, err, sys::fs::F_None);
#else
raw_fd_ostream OS(fname, err);
#endif
jl_gen_llvm_gv_array();
#ifdef USE_MCJIT
WriteBitcodeToFile(shadow_module, OS);
Expand Down Expand Up @@ -3950,7 +3956,9 @@ static void init_julia_llvm_env(Module *m)
// set up optimization passes
FPM = new FunctionPassManager(m);

#ifdef LLVM32
#ifdef LLVM35
jl_data_layout = new llvm::DataLayoutPass(*jl_ExecutionEngine->getDataLayout());
#elif defined(LLVM32)
jl_data_layout = new DataLayout(*jl_ExecutionEngine->getDataLayout());
#else
jl_data_layout = new TargetData(*jl_ExecutionEngine->getTargetData());
Expand Down

1 comment on commit 475eb52

@Keno
Copy link
Member

@Keno Keno commented on 475eb52 Mar 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.