Skip to content

Commit

Permalink
DLLEXPORT some of Julia's LLVM state
Browse files Browse the repository at this point in the history
This and staged functions are the last piece necessary to get Cxx.jl
running easily off julia master
  • Loading branch information
Keno committed Aug 14, 2014
1 parent a44ea2a commit 3a252ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static GlobalVariable *prepare_global(GlobalVariable *G)
G->isConstant(), GlobalVariable::ExternalLinkage,
NULL, G->getName());
}
return gv;
return gv;
}
#endif
return G;
Expand Down Expand Up @@ -400,7 +400,8 @@ static Type *julia_struct_to_llvm(jl_value_t *jt);

static bool jltupleisbits(jl_value_t *jt, bool allow_unsized = true);

static Type *julia_type_to_llvm(jl_value_t *jt)
extern "C" {
DLLEXPORT Type *julia_type_to_llvm(jl_value_t *jt)
{
if (jt == (jl_value_t*)jl_bool_type) return T_int1;
if (jt == (jl_value_t*)jl_bottom_type) return T_void;
Expand Down Expand Up @@ -484,6 +485,7 @@ static Type *julia_type_to_llvm(jl_value_t *jt)
}
return jl_pvalue_llvmt;
}
}

static Type *julia_struct_to_llvm(jl_value_t *jt)
{
Expand Down
4 changes: 2 additions & 2 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ void __attribute__(()) __stack_chk_fail()
#define DISABLE_FLOAT16

// llvm state
static LLVMContext &jl_LLVMContext = getGlobalContext();
DLLEXPORT LLVMContext &jl_LLVMContext = getGlobalContext();
static IRBuilder<> builder(getGlobalContext());
static bool nested_compile=false;
static ExecutionEngine *jl_ExecutionEngine;
DLLEXPORT ExecutionEngine *jl_ExecutionEngine;
static TargetMachine *jl_TargetMachine;
#ifdef USE_MCJIT
static Module *shadow_module;
Expand Down

0 comments on commit 3a252ee

Please sign in to comment.