Skip to content

Commit

Permalink
Merge pull request JuliaLang#11897 from JuliaLang/kf/exportagain
Browse files Browse the repository at this point in the history
Adjust export of LLVM state
  • Loading branch information
Keno committed Jun 28, 2015
2 parents 7c65815 + a296bfc commit 73a3217
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ static Value *runtime_sym_lookup(PointerType *funcptype, char *f_lib, char *f_na
libsym = get_library(f_lib);
assert(libsym != NULL);
#ifdef USE_MCJIT
llvm_to_jl_value[libptrgv] = libsym;
jl_llvm_to_jl_value[libptrgv] = libsym;
#else
*((uv_lib_t**)jl_ExecutionEngine->getPointerToGlobal(libptrgv)) = libsym;
#endif
}
}
if (libsym == NULL) {
#ifdef USE_MCJIT
libsym = (uv_lib_t*)llvm_to_jl_value[libptrgv];
libsym = (uv_lib_t*)jl_llvm_to_jl_value[libptrgv];
#else
libsym = *((uv_lib_t**)jl_ExecutionEngine->getPointerToGlobal(libptrgv));
#endif
Expand All @@ -191,7 +191,7 @@ static Value *runtime_sym_lookup(PointerType *funcptype, char *f_lib, char *f_na
initnul, name);
symMapGV[f_name] = llvmgv;
#ifdef USE_MCJIT
llvm_to_jl_value[llvmgv] = jl_dlsym_e(libsym, f_name);
jl_llvm_to_jl_value[llvmgv] = jl_dlsym_e(libsym, f_name);
#else
*((void**)jl_ExecutionEngine->getPointerToGlobal(llvmgv)) = jl_dlsym_e(libsym, f_name);
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static GlobalVariable *stringConst(const std::string &txt)

typedef struct {Value* gv; int32_t index;} jl_value_llvm; // uses 1-based indexing
static std::map<void*, jl_value_llvm> jl_value_to_llvm;
DLLEXPORT std::map<Value *, void*> llvm_to_jl_value;
DLLEXPORT std::map<Value *, void*> jl_llvm_to_jl_value;

#ifdef USE_MCJIT
class FunctionMover : public ValueMaterializer
Expand Down Expand Up @@ -277,8 +277,8 @@ class FunctionMover : public ValueMaterializer
}
}
std::map<Value*, void *>::iterator it;
it = llvm_to_jl_value.find(GV);
if (it != llvm_to_jl_value.end()) {
it = jl_llvm_to_jl_value.find(GV);
if (it != jl_llvm_to_jl_value.end()) {
newGV->setInitializer(Constant::getIntegerValue(GV->getType()->getElementType(),APInt(sizeof(void*)*8,(ptrint_t)it->second)));
newGV->setConstant(true);
}
Expand Down Expand Up @@ -444,7 +444,7 @@ static Value *julia_gv(const char *cname, void *addr)

// make the pointer valid for this session
#ifdef USE_MCJIT
llvm_to_jl_value[gv] = addr;
jl_llvm_to_jl_value[gv] = addr;
#else
void **p = (void**)jl_ExecutionEngine->getPointerToGlobal(gv);
*p = addr;
Expand Down
2 changes: 1 addition & 1 deletion src/julia.expmap
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
utf8proc_*;
jlbacktrace;
_IO_stdin_used;
llvm_to_jl_value;
__ZN4llvm23createLowerSimdLoopPassEv;

/* freebsd */
environ;
Expand Down
3 changes: 2 additions & 1 deletion src/llvm-simdloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// createLowerSimdLoopPass: construct LLVM for lowering a marked loop later.

#include "llvm-version.h"
#include "support/dtypes.h"
#include <llvm/Analysis/LoopPass.h>
#include <llvm/IR/Instructions.h>
#include <llvm/IR/LLVMContext.h>
Expand Down Expand Up @@ -193,7 +194,7 @@ static RegisterPass<LowerSIMDLoop> X("LowerSIMDLoop", "LowerSIMDLoop Pass",
false /* Only looks at CFG */,
false /* Analysis Pass */);

Pass* createLowerSimdLoopPass() {
DLLEXPORT Pass* createLowerSimdLoopPass() {
return new LowerSIMDLoop();
}

Expand Down

0 comments on commit 73a3217

Please sign in to comment.