Skip to content

Commit

Permalink
DLLEXPORT the function to add all optimization passes.
Browse files Browse the repository at this point in the history
... instead of exporting Julia-specific passes individually
and requiring users (eg. CUDAnative.jl) to rebuild the pass chain
by themselves.
  • Loading branch information
maleadt committed Jun 25, 2017
1 parent 3808de9 commit 9c9ba7a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/jitlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ void addOptimizationPasses(legacy::PassManagerBase *PM, int opt_level)
#endif
}

extern "C" JL_DLLEXPORT
void jl_add_optimization_passes(LLVMPassManagerRef PM, int opt_level) {
addOptimizationPasses(unwrap(PM), opt_level);
}

// ------------------------ TEMPORARILY COPIED FROM LLVM -----------------
// This must be kept in sync with gdb/gdb/jit.h .
extern "C" {
Expand Down
2 changes: 0 additions & 2 deletions src/julia.expmap
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
julia_type_to_llvm;
_IO_stdin_used;
__ZN4llvm23createLowerSimdLoopPassEv;
LLVMAddLowerGCFramePass;
LLVMAddLowerPTLSPass;

/* freebsd */
environ;
Expand Down
6 changes: 0 additions & 6 deletions src/llvm-ptls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <llvm/IR/Instructions.h>
#include <llvm/IR/Constants.h>
#include <llvm/IR/LLVMContext.h>
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/MDBuilder.h>

#if defined(JULIA_ENABLE_THREADING)
Expand Down Expand Up @@ -265,8 +264,3 @@ Pass *createLowerPTLSPass(bool imaging_mode)
{
return new LowerPTLS(imaging_mode);
}

extern "C" JL_DLLEXPORT
void LLVMAddLowerPTLSPass(LLVMPassManagerRef PM, int imaging_mode) {
unwrap(PM)->add(createLowerPTLSPass(imaging_mode != 0));
}

0 comments on commit 9c9ba7a

Please sign in to comment.